Class FixedReservoirHistogram

  • All Implemented Interfaces:
    Histogram

    public class FixedReservoirHistogram
    extends java.lang.Object
    implements Histogram
    A Histogram implementation with reservoir sampling.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int count()
      Return the number of observations.
      Histogram.Statistics statistics()
      Naive algorithm for calculating variance: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
      void update​(long value)
      Update the histogram with a new value observed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedReservoirHistogram

        public FixedReservoirHistogram​(int reservoirSize)
    • Method Detail

      • count

        public int count()
        Description copied from interface: Histogram
        Return the number of observations.
        Specified by:
        count in interface Histogram
      • update

        public void update​(long value)
        Description copied from interface: Histogram
        Update the histogram with a new value observed.
        Specified by:
        update in interface Histogram
      • statistics

        public Histogram.Statistics statistics()
        Naive algorithm for calculating variance: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
        Specified by:
        statistics in interface Histogram