net.sf.sensor.timer
Class TimerStatistics

java.lang.Object
  extended bynet.sf.sensor.timer.TimerStatistics
All Implemented Interfaces:
SensorStatistics

public class TimerStatistics
extends Object
implements SensorStatistics

Thread-safe, refreshable snapshot view to the internally managed TimerData representing the timing values as they were when the refresh() method was last called.

Author:
Age Mooy

Method Summary
 long getAverageTime()
          Returns the average time (in milliseconds) measured until the last call to refresh().
 List getChildren()
           
 String getId()
          Returns the string that uniquely identifies one instance of SensorStatistics.
 Set getLabels()
          Returns a Set<String> of all labels associated with an instance of SensorStatistics.
 long getMaximumTime()
          Returns the maximum time (in milliseconds) measured until the last call to refresh().
 long getMinimumTime()
          Returns the minimum time (in milliseconds) measured until the last call to refresh().
 long getNumberOfHits()
          Returns the number of hits counted until the last call to refresh().
 long getStandardDeviation()
          Returns the standard deviation (in milliseconds) measured until the last call to refresh().
 long getSumOfSquaresOfTimes()
          Returns the sumOfSquaresOfTimes.
 long getTimeOfFirstUpdate()
          Returns the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.
 long getTimeOfLastUpdate()
          Returns the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.
 long getTotalTime()
          Returns the total time (in milliseconds) measured until the last call to refresh().
 boolean hasChildren()
          Returns true if this instance has one or more child instances.
 void refresh()
          Refreshes this instances and all its children.
 void reset()
          Resets the statistics to their default values.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getId

public String getId()
Description copied from interface: SensorStatistics
Returns the string that uniquely identifies one instance of SensorStatistics.

Specified by:
getId in interface SensorStatistics
Returns:
the string that uniquely identifies one instance of SensorStatistics.
See Also:
SensorStatistics.getId()

getLabels

public Set getLabels()
Description copied from interface: SensorStatistics
Returns a Set<String> of all labels associated with an instance of SensorStatistics.

Specified by:
getLabels in interface SensorStatistics
Returns:
a Set<String> of all labels associated with an instance of SensorStatistics.
See Also:
SensorStatistics.getLabels()

refresh

public void refresh()
Refreshes this instances and all its children.

Specified by:
refresh in interface SensorStatistics
See Also:
SensorStatistics.refresh()

reset

public void reset()
Description copied from interface: SensorStatistics
Resets the statistics to their default values.

Specified by:
reset in interface SensorStatistics
See Also:
SensorStatistics.reset()

hasChildren

public boolean hasChildren()
Returns true if this instance has one or more child instances.

Returns:
true if this instance has one or more child instances.

getChildren

public List getChildren()
Returns:
a List<TimerStatistics> of all the child instances.

getNumberOfHits

public long getNumberOfHits()
Returns the number of hits counted until the last call to refresh().

Returns:
the number of hits counted until the last call to refresh().

getTotalTime

public long getTotalTime()
Returns the total time (in milliseconds) measured until the last call to refresh().

Returns:
the total time (in milliseconds) measured until the last call to refresh().

getAverageTime

public long getAverageTime()
Returns the average time (in milliseconds) measured until the last call to refresh().

Returns:
the average time (in milliseconds) measured until the last call to refresh().

getStandardDeviation

public long getStandardDeviation()
Returns the standard deviation (in milliseconds) measured until the last call to refresh().

Returns:
the standard deviation (in milliseconds) measured until the last call to refresh().

getSumOfSquaresOfTimes

public long getSumOfSquaresOfTimes()
Returns the sumOfSquaresOfTimes.

Returns:
Returns the sumOfSquaresOfTimes.

getMinimumTime

public long getMinimumTime()
Returns the minimum time (in milliseconds) measured until the last call to refresh().

Returns:
the minimum time (in milliseconds) measured until the last call to refresh().

getMaximumTime

public long getMaximumTime()
Returns the maximum time (in milliseconds) measured until the last call to refresh().

Returns:
the maximum time (in milliseconds) measured until the last call to refresh().

getTimeOfFirstUpdate

public long getTimeOfFirstUpdate()
Returns the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

Returns:
the timeOfFirstUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

getTimeOfLastUpdate

public long getTimeOfLastUpdate()
Returns the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

Returns:
the timeOfLastUpdate in millseconds since the usual 01-01-1970 00:00 UTC.

toString

public String toString()
See Also:
Object.toString()


Copyright © 2005-2006 SourceForge. All Rights Reserved.