You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a small, very useful enhancement to help triage startup times of a Spring application. The methods annotated with @PostConstruct are all executed on the main thread during startup. In a large, legacy spring application there can be many such methods. Adding the ability to record how much time each method is contributing to the startup time is very useful. This can even be something that is only reported when debug logging is enabled. It might be more useful to report a warning if a @PostConstruct method exceeds a certain threshold (although this is not critical).
I have implemented this locally by making a change to the InitDestroyAnnotationBeanPostProcessor.LifecycleMetadata.invokeInitMethods()
Tyler K Van Gorder opened SPR-16287 and commented
This is a small, very useful enhancement to help triage startup times of a Spring application. The methods annotated with
@PostConstruct
are all executed on the main thread during startup. In a large, legacy spring application there can be many such methods. Adding the ability to record how much time each method is contributing to the startup time is very useful. This can even be something that is only reported when debug logging is enabled. It might be more useful to report a warning if a@PostConstruct
method exceeds a certain threshold (although this is not critical).I have implemented this locally by making a change to the InitDestroyAnnotationBeanPostProcessor.LifecycleMetadata.invokeInitMethods()
Affects: 4.3.14
The text was updated successfully, but these errors were encountered: