org.springframework.integration.monitor
Class ExponentialMovingAverageRate

java.lang.Object
  extended by org.springframework.integration.monitor.ExponentialMovingAverageRate

public class ExponentialMovingAverageRate
extends java.lang.Object

Cumulative statistics for an event rate with higher weight given to recent data but without storing any history. Clients call increment() when a new event occurs, and then use convenience methods (e.g. getMean()) to retrieve estimates of the rate of event arrivals and the statistics of the series. Older values are given exponentially smaller weight, with a decay factor determined by a duration chosen by the client. The rate measurement weights decay in two dimensions:


Constructor Summary
ExponentialMovingAverageRate(double period, double lapsePeriod, int window)
           
 
Method Summary
 int getCount()
           
 double getMax()
           
 double getMean()
           
 double getMin()
           
 double getStandardDeviation()
           
 Statistics getStatistics()
           
 double getTimeSinceLastMeasurement()
           
 void increment()
          Add a new event to the series.
 void reset()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExponentialMovingAverageRate

public ExponentialMovingAverageRate(double period,
                                    double lapsePeriod,
                                    int window)
Parameters:
period - the period to base the rate measurement (in seconds)
lapsePeriod - the exponential lapse rate for the rate average (in seconds)
window - the exponential lapse window (number of measurements)
Method Detail

reset

public void reset()

increment

public void increment()
Add a new event to the series.


getCount

public int getCount()
Returns:
the number of measurements recorded

getTimeSinceLastMeasurement

public double getTimeSinceLastMeasurement()
Returns:
the time in seconds since the last measurement

getMean

public double getMean()
Returns:
the mean value

getStandardDeviation

public double getStandardDeviation()
Returns:
the approximate standard deviation

getMax

public double getMax()
Returns:
the maximum value recorded (not weighted)

getMin

public double getMin()
Returns:
the minimum value recorded (not weighted)

getStatistics

public Statistics getStatistics()
Returns:
summary statistics (count, mean, standard deviation etc.)

toString

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