Class UniformSnapshot

    • Constructor Detail

      • UniformSnapshot

        public UniformSnapshot​(Collection<Long> values)
        Create a new Snapshot with the given values.
        Parameters:
        values - an unordered set of values in the reservoir
      • UniformSnapshot

        public UniformSnapshot​(long[] values)
        Create a new Snapshot with the given values.
        Parameters:
        values - an unordered set of values in the reservoir that can be used by this class directly
    • Method Detail

      • getValue

        public double getValue​(double quantile)
        Returns the value at the given quantile.
        Specified by:
        getValue in class Snapshot
        Parameters:
        quantile - a given quantile, in [0..1]
        Returns:
        the value in the distribution at quantile
      • size

        public int size()
        Returns the number of values in the snapshot.
        Specified by:
        size in class Snapshot
        Returns:
        the number of values
      • getValues

        public long[] getValues()
        Returns the entire set of values in the snapshot.
        Specified by:
        getValues in class Snapshot
        Returns:
        the entire set of values
      • getMax

        public long getMax()
        Returns the highest value in the snapshot.
        Specified by:
        getMax in class Snapshot
        Returns:
        the highest value
      • getMin

        public long getMin()
        Returns the lowest value in the snapshot.
        Specified by:
        getMin in class Snapshot
        Returns:
        the lowest value
      • getMean

        public double getMean()
        Returns the arithmetic mean of the values in the snapshot.
        Specified by:
        getMean in class Snapshot
        Returns:
        the arithmetic mean
      • getStdDev

        public double getStdDev()
        Returns the standard deviation of the values in the snapshot.
        Specified by:
        getStdDev in class Snapshot
        Returns:
        the standard deviation value
      • dump

        public void dump​(OutputStream output)
        Writes the values of the snapshot to the given stream.
        Specified by:
        dump in class Snapshot
        Parameters:
        output - an output stream