Package org.apache.beam.sdk.util
Class MovingFunction
- java.lang.Object
-
- org.apache.beam.sdk.util.MovingFunction
-
public class MovingFunction extends java.lang.Object
Keep track of the moving minimum/maximum/sum of sampled long values. The minimum/maximum/sum is over at most the user-specified lastsamplePeriodMs
, and is updated everysampleUpdateMs
.
-
-
Constructor Summary
Constructors Constructor Description MovingFunction(long samplePeriodMs, long sampleUpdateMs, int numSignificantBuckets, int numSignificantSamples, Combine.BinaryCombineLongFn function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long nowMsSinceEpoch, long value)
Addvalue
atnowMsSinceEpoch
.long
get(long nowMsSinceEpoch)
Return the minimum/maximum/sum of all retained values within samplePeriodMs ofnowMsSinceEpoch
.boolean
isSignificant()
Is the current result 'significant'? Ie is it drawn from enough buckets or from enough samples?
-
-
-
Constructor Detail
-
MovingFunction
public MovingFunction(long samplePeriodMs, long sampleUpdateMs, int numSignificantBuckets, int numSignificantSamples, Combine.BinaryCombineLongFn function)
-
-
Method Detail
-
add
public void add(long nowMsSinceEpoch, long value)
Addvalue
atnowMsSinceEpoch
.
-
get
public long get(long nowMsSinceEpoch)
Return the minimum/maximum/sum of all retained values within samplePeriodMs ofnowMsSinceEpoch
.
-
isSignificant
public boolean isSignificant()
Is the current result 'significant'? Ie is it drawn from enough buckets or from enough samples?
-
-