com.twitter.common.stats
Class MovingAverage<T extends Number>

java.lang.Object
  extended by com.twitter.common.stats.StatImpl<T>
      extended by com.twitter.common.stats.SampledStat<Double>
          extended by com.twitter.common.stats.MovingAverage<T>
All Implemented Interfaces:
Stat<Double>

public class MovingAverage<T extends Number>
extends SampledStat<Double>

Function to compute the moving average of a time series.


Method Summary
 Double doSample()
           
static
<T extends Number>
MovingAverage<T>
of(Stat<T> input)
           
static
<T extends Number>
MovingAverage<T>
of(Stat<T> input, int windowSize)
           
static
<T extends Number>
MovingAverage<T>
of(String name, Stat<T> input, int windowSize)
           
 
Methods inherited from class com.twitter.common.stats.SampledStat
read, sample
 
Methods inherited from class com.twitter.common.stats.StatImpl
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.twitter.common.stats.Stat
getName
 

Method Detail

of

public static <T extends Number> MovingAverage<T> of(Stat<T> input)

of

public static <T extends Number> MovingAverage<T> of(Stat<T> input,
                                                     int windowSize)

of

public static <T extends Number> MovingAverage<T> of(String name,
                                                     Stat<T> input,
                                                     int windowSize)

doSample

public Double doSample()
Specified by:
doSample in class SampledStat<Double>