Class 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 last samplePeriodMs, and is updated every sampleUpdateMs.
    • 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)
      Add value at nowMsSinceEpoch.
      long get​(long nowMsSinceEpoch)
      Return the minimum/maximum/sum of all retained values within samplePeriodMs of nowMsSinceEpoch.
      boolean isSignificant()
      Is the current result 'significant'? Ie is it drawn from enough buckets or from enough samples?
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)
        Add value at nowMsSinceEpoch.
      • get

        public long get​(long nowMsSinceEpoch)
        Return the minimum/maximum/sum of all retained values within samplePeriodMs of nowMsSinceEpoch.
      • isSignificant

        public boolean isSignificant()
        Is the current result 'significant'? Ie is it drawn from enough buckets or from enough samples?