org.perf4j
Class TimingStatistics

java.lang.Object
  extended by org.perf4j.TimingStatistics
All Implemented Interfaces:
Serializable, Cloneable

public class TimingStatistics
extends Object
implements Serializable, Cloneable

TimingStatistics represent a set of statistical measures over a set of timing data, such as a collection of StopWatch instances.

Author:
Alex Devine
See Also:
Serialized Form

Constructor Summary
TimingStatistics()
          Default constructor allows you to set performance statistics later using the setter methods.
TimingStatistics(double mean, double standardDeviation, long max, long min, int count)
          Creates a TimingStatistics object with the specified data.
 
Method Summary
 TimingStatistics addSampleTime(long elapsedTime)
          This method updates the calculated statistics with a new logged execution time.
 TimingStatistics clone()
           
 boolean equals(Object o)
           
 int getCount()
           
 long getMax()
           
 double getMean()
           
 long getMin()
           
 double getStandardDeviation()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimingStatistics

public TimingStatistics()
Default constructor allows you to set performance statistics later using the setter methods.


TimingStatistics

public TimingStatistics(double mean,
                        double standardDeviation,
                        long max,
                        long min,
                        int count)
Creates a TimingStatistics object with the specified data.

Parameters:
mean - The mean execution time, in ms, of the underlying time records.
standardDeviation - The standard deviation, in ms, of the underlying time records.
max - The maximum value in ms of the logged execution times.
min - The minimum value in ms of the logged execution times.
count - The total number of executions that were timed.
Method Detail

addSampleTime

public TimingStatistics addSampleTime(long elapsedTime)
This method updates the calculated statistics with a new logged execution time.

Parameters:
elapsedTime - The elapsed time being used to update the statistics.
Returns:
this TimingStatistics instance

getMean

public double getMean()

getStandardDeviation

public double getStandardDeviation()

getMax

public long getMax()

getMin

public long getMin()

getCount

public int getCount()

toString

public String toString()
Overrides:
toString in class Object

clone

public TimingStatistics clone()
Overrides:
clone in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2009 perf4j.org. All Rights Reserved.