java.lang.Object | |||
↳ | org.springframework.aop.interceptor.AbstractTraceInterceptor | ||
↳ | org.springframework.aop.interceptor.AbstractMonitoringInterceptor | ||
↳ | org.springframework.aop.interceptor.JamonPerformanceMonitorInterceptor |
Performance monitor interceptor that uses JAMon library to perform the performance measurement on the intercepted method and output the stats.
This code is inspired by Thierry Templier's blog.
PerformanceMonitorInterceptor
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.aop.interceptor.AbstractTraceInterceptor
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new JamonPerformanceMonitorInterceptor with a static logger.
| |||||||||||
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger,
according to the given flag.
| |||||||||||
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger,
according to the given flag.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set whether to track all invocations that go through this interceptor,
or just invocations with trace logging enabled.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Wraps the invocation with a JAMon Monitor and writes the current
performance statistics to the log (if enabled).
| |||||||||||
Always applies the interceptor if the "trackAllInvocations" flag has been set;
else just kicks in if the log is enabled.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.aop.interceptor.AbstractMonitoringInterceptor
| |||||||||||
From class
org.springframework.aop.interceptor.AbstractTraceInterceptor
| |||||||||||
From class
java.lang.Object
|
Create a new JamonPerformanceMonitorInterceptor with a static logger.
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
useDynamicLogger | whether to use a dynamic logger or a static logger |
---|
Create a new JamonPerformanceMonitorInterceptor with a dynamic or static logger, according to the given flag.
useDynamicLogger | whether to use a dynamic logger or a static logger |
---|---|
trackAllInvocations | whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled |
Set whether to track all invocations that go through this interceptor, or just invocations with trace logging enabled.
Default is "false": Only invocations with trace logging enabled will be monitored. Specify "true" to let JAMon track all invocations, gathering statistics even when trace logging is disabled.
Wraps the invocation with a JAMon Monitor and writes the current performance statistics to the log (if enabled).
logger | the Log to write trace messages to |
---|
MethodInvocation.proceed()
Throwable |
---|
Always applies the interceptor if the "trackAllInvocations" flag has been set; else just kicks in if the log is enabled.
invocation | the MethodInvocation being traced |
---|---|
logger | the Log instance to check |