org.springframework.web.context.support
public class: PerformanceMonitorListener [javadoc |
source]
java.lang.Object
org.springframework.web.context.support.PerformanceMonitorListener
All Implemented Interfaces:
ApplicationListener
Deprecated! as - of Spring 2.5, to be removed in Spring 3.0.
Use a custom ApplicationListener specific to your needs instead.
Listener that logs the response times of web requests.
To be registered as bean in a WebApplicationContext.
Logs performance statistics using Commons Logging at "trace" level.
Also see:
- RequestHandledEvent
- author:
Rod - Johnson
- author:
Juergen - Hoeller
- since:
January - 21, 2001
| Field Summary |
|---|
| protected final Log | logger | |
| protected final ResponseTimeMonitorImpl | responseTimeMonitor | |
| Method from org.springframework.web.context.support.PerformanceMonitorListener Summary: |
|---|
|
onApplicationEvent |
| Method from org.springframework.web.context.support.PerformanceMonitorListener Detail: |
public void onApplicationEvent(ApplicationEvent event) {
if (event instanceof RequestHandledEvent) {
RequestHandledEvent rhe = (RequestHandledEvent) event;
this.responseTimeMonitor.recordResponseTime(rhe.getProcessingTimeMillis());
if (logger.isTraceEnabled()) {
logger.trace("PerformanceMonitorListener: last=[" + rhe.getProcessingTimeMillis() + "ms]; " +
this.responseTimeMonitor + "; " + rhe.getShortDescription());
}
}
} Deprecated! |