@@ -38,6 +38,10 @@ public class TimingInterceptor {
38
38
39
39
private StopWatch init = new StopWatch ("init" );
40
40
41
+ private StopWatch app = new StopWatch ("app" );
42
+
43
+ private int level = 0 ;
44
+
41
45
@ Around ("execution(private * org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(Object, String, ..)) && args(bean,..)" )
42
46
public Object bind (ProceedingJoinPoint joinPoint , Object bean ) throws Throwable {
43
47
bind .start ();
@@ -59,6 +63,38 @@ public Object post(ProceedingJoinPoint joinPoint, Object bean) throws Throwable
59
63
return result ;
60
64
}
61
65
66
+ @ Around ("execution(* org.springframework.boot.SpringApplication+.*(..))" )
67
+ public Object initializer (ProceedingJoinPoint joinPoint ) throws Throwable {
68
+ String task = app .currentTaskName ();
69
+ if (task != null ) {
70
+ app .stop ();
71
+ }
72
+ long t0 = System .currentTimeMillis ();
73
+ level ++;
74
+ app .start (joinPoint .getSignature ().getName ());
75
+ Object result = joinPoint .proceed ();
76
+ long t1 = System .currentTimeMillis ();
77
+ app .stop ();
78
+ if (task != null ) {
79
+ app .start (task );
80
+ }
81
+ logger .info ("App," + level + "," + joinPoint .getSignature ().getName () + ","
82
+ + (t1 - t0 ));
83
+ level --;
84
+ return result ;
85
+ }
86
+
87
+ @ Around ("execution(* org.springframework.web.reactive.DispatcherHandler+.initStrategies(..))" )
88
+ public Object initStrategies (ProceedingJoinPoint joinPoint ) throws Throwable {
89
+ long t0 = System .currentTimeMillis ();
90
+ Object result = joinPoint .proceed ();
91
+ long t1 = System .currentTimeMillis ();
92
+ logger .info ("Strategies,"
93
+ + joinPoint .getSignature ().getDeclaringType ().getSimpleName () + "."
94
+ + joinPoint .getSignature ().getName () + "," + (t1 - t0 ));
95
+ return result ;
96
+ }
97
+
62
98
@ Around ("execution(* org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory+.initializeBean(String, Object, ..)) && args(name,bean,..)" )
63
99
public Object init (ProceedingJoinPoint joinPoint , String name , Object bean )
64
100
throws Throwable {
0 commit comments