ostore.util
Class StatRecorder

java.lang.Object
  |
  +--ostore.util.StatRecorder
All Implemented Interfaces:
QuickSerializable

public class StatRecorder
extends Object
implements QuickSerializable

The StatRecorder class is a utility for recording and analyzing a number of samples for a measurement.

Version:
$Id: StatRecorder.java,v 1.7 2003/01/24 21:01:39 strib Exp $
Author:
Patrick R. Eaton

Constructor Summary
StatRecorder(InputBuffer buffer)
           
StatRecorder(String name)
           
StatRecorder(String name, String tag)
           
 
Method Summary
 void add(long sample)
           
 void add(long sample, long count)
           
 void add(StatRecorder other)
           
 double getGeometricMean()
           
 String getHistogram()
           
 String getHistogram(int bucket_size)
           
 long getMax()
           
 double getMean()
           
 long getMedian()
           
 long getMin()
           
 long getNumSamples()
           
 long getPercentile(double percentile)
           
 double getStddev()
           
 void reset()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatRecorder

public StatRecorder(String name)

StatRecorder

public StatRecorder(String name,
                    String tag)

StatRecorder

public StatRecorder(InputBuffer buffer)
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Parameters:
buffer - the output buffer to add the object to

reset

public void reset()

add

public void add(StatRecorder other)

add

public void add(long sample)

add

public void add(long sample,
                long count)

getNumSamples

public long getNumSamples()

getPercentile

public long getPercentile(double percentile)

getMedian

public long getMedian()

getMin

public long getMin()

getMax

public long getMax()

getMean

public double getMean()

getGeometricMean

public double getGeometricMean()

getStddev

public double getStddev()

getHistogram

public String getHistogram()

getHistogram

public String getHistogram(int bucket_size)