org.springframework.util
Class ResponseTimeMonitorImpl


public class ResponseTimeMonitorImpl
implements ResponseTimeMonitor

Implementation of ResponseTimeMonitor for use via delegation by objects that implement this interface.

Uses no synchronization, so is suitable for use in a web application.

Author:
Rod Johnson
Version: $Id: ResponseTimeMonitorImpl.java,v 1.2 2003/09/22 21:28:04 aarendsen Exp $
Since: November 21, 2000

Constructor Summary
ResponseTimeMonitorImpl()
          Creates a new ResponseTimeMonitorImpl.

Method Summary
 final intgetAccessCount()
          Return the number of hits this object has handled.
 final intgetAverageResponseTimeMillis()
          Return the average response time achieved by this object.
 final intgetBestResponseTimeMillis()
          Return the best (lowest) response time achieved by this object.
 final DategetLoadDate()
          Return the date when this object was loaded.
 final longgetUptime()
          Return the number of milliseconds since this object was loaded.
 final intgetWorstResponseTimeMillis()
          Return the worst (slowest) response time achieved by this object.
 final voidrecordResponseTime(long responseTime)
          Utility method to record this response time, updating the best and worst response times if necessary.
 StringtoString()
           

Constructor Detail

ResponseTimeMonitorImpl

public ResponseTimeMonitorImpl()
Creates a new ResponseTimeMonitorImpl.
Method Detail

getAccessCount

public final int getAccessCount()
Return the number of hits this object has handled.
Returns: the number of hits this object has handled

getAverageResponseTimeMillis

public final int getAverageResponseTimeMillis()
Return the average response time achieved by this object.
Returns: the average response time achieved by this object

getBestResponseTimeMillis

public final int getBestResponseTimeMillis()
Return the best (lowest) response time achieved by this object.
Returns: the best (lowest) response time achieved by this object

getLoadDate

public final Date getLoadDate()
Return the date when this object was loaded.
Returns: the date when this object was loaded

getUptime

public final long getUptime()
Return the number of milliseconds since this object was loaded.
Returns: the number of milliseconds since this object was loaded

getWorstResponseTimeMillis

public final int getWorstResponseTimeMillis()
Return the worst (slowest) response time achieved by this object.
Returns: the worst (slowest) response time achieved by this object

recordResponseTime

public final void recordResponseTime(long responseTime)
Utility method to record this response time, updating the best and worst response times if necessary.
Parameters:
responseTime - the response time of this request

toString

public String toString()
Returns: a human-readable string showing the performance data recorded by this object.