org.nuiton.web.jmx
Class RequestStatistics

java.lang.Object
  extended by org.nuiton.web.jmx.RequestStatistics
All Implemented Interfaces:
Serializable

public class RequestStatistics
extends Object
implements Serializable

This pojo gather statistics for a given (not stored) request.

See Also:
Serialized Form

Field Summary
protected  int count
           
protected  long elapsedSum
           
protected  long highestElapsed
           
protected  long lowestElapsed
           
 
Constructor Summary
RequestStatistics()
           
 
Method Summary
 void count(long start, long stop)
          Each time a request is processed, this method should be called.
 long getAverageElapsed()
          The average time observed
 int getCount()
          The number of time this Url was killed.
 long getElapsedSum()
          The total time passed to process all the request.
 long getHighestElapsed()
          The longest time observed (duration of the lowest request)
 long getLowestElapsed()
          The shortest time observed (duration of the fastest request)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

count

protected int count

elapsedSum

protected long elapsedSum

lowestElapsed

protected long lowestElapsed

highestElapsed

protected long highestElapsed
Constructor Detail

RequestStatistics

public RequestStatistics()
Method Detail

getCount

public int getCount()
The number of time this Url was killed.

Returns:
the total number of times this url was called

getElapsedSum

public long getElapsedSum()
The total time passed to process all the request.

Returns:
a duration in milli-seconds.

getLowestElapsed

public long getLowestElapsed()
The shortest time observed (duration of the fastest request)

Returns:
a duration in milli-seconds.

getHighestElapsed

public long getHighestElapsed()
The longest time observed (duration of the lowest request)

Returns:
a duration in milli-seconds.

getAverageElapsed

public long getAverageElapsed()
The average time observed

Returns:
a duration in milli-seconds.

count

public void count(long start,
                  long stop)
Each time a request is processed, this method should be called. It will record the statistics for this request.

Parameters:
start - the time (in ms), when the request was queried by the user
stop - the time (in ms), the request processing ended
Throws:
IllegalArgumentException - if given times implies that stop time is not after start

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 CodeLutin. All Rights Reserved.