Example usage for org.springframework.web.context.support RequestHandledEvent getProcessingTimeMillis

List of usage examples for org.springframework.web.context.support RequestHandledEvent getProcessingTimeMillis

Introduction

In this page you can find the example usage for org.springframework.web.context.support RequestHandledEvent getProcessingTimeMillis.

Prototype

public long getProcessingTimeMillis() 

Source Link

Document

Return the processing time of the request in milliseconds.

Usage

From source file:org.springframework.web.context.support.PerformanceMonitorListener.java

public void onApplicationEvent(ApplicationEvent event) {
    if (event instanceof RequestHandledEvent) {
        RequestHandledEvent rhe = (RequestHandledEvent) event;
        this.responseTimeMonitor.recordResponseTime(rhe.getProcessingTimeMillis());
        if (logger.isTraceEnabled()) {
            // Stringifying objects is expensive. Don't do it unless it will show.
            logger.trace("PerformanceMonitorListener: last=[" + rhe.getProcessingTimeMillis() + "ms]; "
                    + this.responseTimeMonitor + "; client=[" + rhe.getClientAddress() + "]");
        }//from  ww  w . j a  va2 s . c o  m
    }
}