Package org.apache.cassandra.utils
Class ExpMovingAverage
java.lang.Object
org.apache.cassandra.utils.ExpMovingAverage
- All Implemented Interfaces:
MovingAverage
Sample-based exponential moving average. On every update a fraction of the current average is replaced by the new
sample. New values have greater representation in the average, and older samples' effect exponentially decays with
new data.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExpMovingAverageCreate aExpMovingAveragewhere older values have less than 1% effect after 10 samples.static ExpMovingAverageCreate aExpMovingAveragewhere older values have less than 1% effect after 100 samples.static MovingAverageCreate aExpMovingAveragewhere older values have less than 1% effect after 1000 samples.doubleget()toString()update(double val) static ExpMovingAveragewithDecay(double ratio, int samples) Create aExpMovingAveragewhere older values have less effect than the given ratio after the given number of samples.
-
Method Details
-
decayBy1000
Create aExpMovingAveragewhere older values have less than 1% effect after 1000 samples. -
decayBy100
Create aExpMovingAveragewhere older values have less than 1% effect after 100 samples. -
decayBy10
Create aExpMovingAveragewhere older values have less than 1% effect after 10 samples. -
withDecay
Create aExpMovingAveragewhere older values have less effect than the given ratio after the given number of samples. -
update
- Specified by:
updatein interfaceMovingAverage
-
get
public double get()- Specified by:
getin interfaceMovingAverage
-
toString
-