juju.reattore.util
Class DurationStat

java.lang.Object
  |
  +--juju.reattore.util.BaseStat
        |
        +--juju.reattore.util.DurationStat
All Implemented Interfaces:
Stat

public class DurationStat
extends BaseStat

Statistic module that manages durations.


Constructor Summary
DurationStat(java.lang.Class clazz, java.lang.String leaf)
           
 
Method Summary
 void end(long ref)
          Commit a event using a reference from #start
 double getAverage()
          Average over the whole run.
protected  java.lang.String getDefaultFormat()
          Returns the default format string to use.
protected  java.lang.Object[] getFormatArgs()
          Returns the argument list used in formatting the summary.
 long getMaximum()
          Maximum value.
 long getMinimum()
          Minimum value.
 long getNumSamples()
          Number of hits
 double getRunningAverage()
          Running average over a recent set of samples.
 long start()
          Start recording a new event for this stat.
 
Methods inherited from class juju.reattore.util.BaseStat
format, getName, setFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DurationStat

public DurationStat(java.lang.Class clazz,
                    java.lang.String leaf)
See Also:
BaseStat
Method Detail

start

public long start()
Start recording a new event for this stat.

Returns:
A reference to pass into #end

end

public void end(long ref)
Commit a event using a reference from #start

Parameters:
ref - A reference from #start

getNumSamples

public long getNumSamples()
Number of hits

Returns:
Number of hits.

getMaximum

public long getMaximum()
Maximum value.

Returns:
Maximum value.

getMinimum

public long getMinimum()
Minimum value.

Returns:
Minimum value.

getAverage

public double getAverage()
Average over the whole run.

Returns:
Average.

getRunningAverage

public double getRunningAverage()
Running average over a recent set of samples. Result is undefined if enough samples have not been collected.

Returns:
The averge.

getDefaultFormat

protected java.lang.String getDefaultFormat()
Description copied from class: BaseStat
Returns the default format string to use.

Specified by:
getDefaultFormat in class BaseStat
Returns:
The default format string.
See Also:
BaseStat

getFormatArgs

protected java.lang.Object[] getFormatArgs()
Description copied from class: BaseStat
Returns the argument list used in formatting the summary.

Specified by:
getFormatArgs in class BaseStat
Returns:
A list of objects for MessageFormat.
See Also:
BaseStat


Copyright © 2002-2003 Michael Hope. All Rights Reserved.