com.jeantessier.metrics
Class StatisticalMeasurement

java.lang.Object
  |
  +--com.jeantessier.metrics.MeasurementBase
        |
        +--com.jeantessier.metrics.StatisticalMeasurement
All Implemented Interfaces:
Measurement

public class StatisticalMeasurement
extends MeasurementBase

Computes the statistical properties of a given measurement across the submetrics of the measurement's context. Given a measurement name, it explores the tree of metrics rooted at the context and finds the numerical value of these named measurements in the tree. For these measurements, it computes:

This is the syntax for initializing this type of measurement:

  <init>
      monitored measurement name [DISPOSE_x]
      [DISPOSE_x]
  </init>
  

If the monitored measurement is itself a statistical measurement, the disposition indicates how to deal with it, which of its values to use in this measurement's calculation. The default is DISPOSE_IGNORE, meaning it should skip statistical measurements look in further submetrics for raw values.

The second disposition tells which internal value to return in calls to its compute() method, which will be used by clients that do not distinguish between StatisticalMeasurent and other Measurements. The default is DISPOSE_AVERAGE.


Field Summary
static int DISPOSE_AVERAGE
          Use Average() value on StatisticalMeasurements
static int DISPOSE_IGNORE
          Ignore StatisticalMeasurements and drill down to the next level
static int DISPOSE_MAXIMUM
          Use Maximum() value on StatisticalMeasurements
static int DISPOSE_MEDIAN
          Use Median() value on StatisticalMeasurements
static int DISPOSE_MINIMUM
          Use Minimum() value on StatisticalMeasurements
static int DISPOSE_NB_DATA_POINTS
          Use NbDataPoints() value on StatisticalMeasurements
static int DISPOSE_STANDARD_DEVIATION
          Use StandardDeviation() value on StatisticalMeasurements
static int DISPOSE_SUM
          Use Sum() value on StatisticalMeasurements
 
Constructor Summary
StatisticalMeasurement(MeasurementDescriptor descriptor, Metrics context, java.lang.String initText)
           
 
Method Summary
 void accept(MeasurementVisitor visitor)
           
protected  double compute()
           
 double getAverage()
           
static java.lang.String getDisposeAbbreviation(int dispose)
           
static java.lang.String getDisposeLabel(int dispose)
           
 double getMaximum()
           
 double getMedian()
           
 double getMinimum()
           
 int getNbDataPoints()
           
 double getStandardDeviation()
          Real standard deviation of the data set.
 double getSum()
           
 boolean isEmpty()
           
 java.lang.String toString()
           
 
Methods inherited from class com.jeantessier.metrics.MeasurementBase
add, add, add, add, add, doubleValue, floatValue, getContext, getDescriptor, getLongName, getShortName, getValue, intValue, isCached, isInRange, longValue, perl, setCached, setEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DISPOSE_IGNORE

public static final int DISPOSE_IGNORE
Ignore StatisticalMeasurements and drill down to the next level

DISPOSE_MINIMUM

public static final int DISPOSE_MINIMUM
Use Minimum() value on StatisticalMeasurements

DISPOSE_MEDIAN

public static final int DISPOSE_MEDIAN
Use Median() value on StatisticalMeasurements

DISPOSE_AVERAGE

public static final int DISPOSE_AVERAGE
Use Average() value on StatisticalMeasurements

DISPOSE_STANDARD_DEVIATION

public static final int DISPOSE_STANDARD_DEVIATION
Use StandardDeviation() value on StatisticalMeasurements

DISPOSE_MAXIMUM

public static final int DISPOSE_MAXIMUM
Use Maximum() value on StatisticalMeasurements

DISPOSE_SUM

public static final int DISPOSE_SUM
Use Sum() value on StatisticalMeasurements

DISPOSE_NB_DATA_POINTS

public static final int DISPOSE_NB_DATA_POINTS
Use NbDataPoints() value on StatisticalMeasurements
Constructor Detail

StatisticalMeasurement

public StatisticalMeasurement(MeasurementDescriptor descriptor,
                              Metrics context,
                              java.lang.String initText)
Method Detail

getDisposeLabel

public static java.lang.String getDisposeLabel(int dispose)

getDisposeAbbreviation

public static java.lang.String getDisposeAbbreviation(int dispose)

getMinimum

public double getMinimum()

getMedian

public double getMedian()

getAverage

public double getAverage()

getStandardDeviation

public double getStandardDeviation()
Real standard deviation of the data set. This is NOT the estimator "s".

getMaximum

public double getMaximum()

getSum

public double getSum()

getNbDataPoints

public int getNbDataPoints()

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class MeasurementBase

accept

public void accept(MeasurementVisitor visitor)

compute

protected double compute()
Overrides:
compute in class MeasurementBase

toString

public java.lang.String toString()
Overrides:
toString in class MeasurementBase


Dependency Finder 1.1.0 © 2001-2004 Jean Tessier.