Class WeightedSnapshot

  • All Implemented Interfaces:
    org.xbib.metrics.api.Snapshot

    public class WeightedSnapshot
    extends java.lang.Object
    implements org.xbib.metrics.api.Snapshot
    A statistical snapshot of a WeightedSnapshot.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dump​(java.io.OutputStream output)
      Writes the values of the snapshot to the given stream.
      double get75thPercentile()
      Returns the value at the 75th percentile in the distribution.
      double get95thPercentile()
      Returns the value at the 95th percentile in the distribution.
      double get98thPercentile()
      Returns the value at the 98th percentile in the distribution.
      double get999thPercentile()
      Returns the value at the 99.9th percentile in the distribution.
      double get99thPercentile()
      Returns the value at the 99th percentile in the distribution.
      long getMax()
      Returns the highest value in the snapshot.
      double getMean()
      Returns the weighted arithmetic mean of the values in the snapshot.
      double getMedian()
      Returns the median value in the distribution.
      long getMin()
      Returns the lowest value in the snapshot.
      double getStdDev()
      Returns the weighted standard deviation of the values in the snapshot.
      double getValue​(double quantile)
      Returns the value at the given quantile.
      long[] getValues()
      Returns the entire set of values in the snapshot.
      int size()
      Returns the number of values in the snapshot.
      • Methods inherited from class java.lang.Object

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

      • WeightedSnapshot

        public WeightedSnapshot​(java.util.Collection<WeightedSnapshot.WeightedSample> values)
        Create a new Snapshot with the given values.
        Parameters:
        values - an unordered set of values in the reservoir
    • Method Detail

      • getMedian

        public double getMedian()
        Returns the median value in the distribution.
        Specified by:
        getMedian in interface org.xbib.metrics.api.Snapshot
        Returns:
        the median value
      • get75thPercentile

        public double get75thPercentile()
        Returns the value at the 75th percentile in the distribution.
        Specified by:
        get75thPercentile in interface org.xbib.metrics.api.Snapshot
        Returns:
        the value at the 75th percentile
      • get95thPercentile

        public double get95thPercentile()
        Returns the value at the 95th percentile in the distribution.
        Specified by:
        get95thPercentile in interface org.xbib.metrics.api.Snapshot
        Returns:
        the value at the 95th percentile
      • get98thPercentile

        public double get98thPercentile()
        Returns the value at the 98th percentile in the distribution.
        Specified by:
        get98thPercentile in interface org.xbib.metrics.api.Snapshot
        Returns:
        the value at the 98th percentile
      • get99thPercentile

        public double get99thPercentile()
        Returns the value at the 99th percentile in the distribution.
        Specified by:
        get99thPercentile in interface org.xbib.metrics.api.Snapshot
        Returns:
        the value at the 99th percentile
      • get999thPercentile

        public double get999thPercentile()
        Returns the value at the 99.9th percentile in the distribution.
        Specified by:
        get999thPercentile in interface org.xbib.metrics.api.Snapshot
        Returns:
        the value at the 99.9th percentile
      • getValue

        public double getValue​(double quantile)
        Returns the value at the given quantile.
        Specified by:
        getValue in interface org.xbib.metrics.api.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 interface org.xbib.metrics.api.Snapshot
        Returns:
        the number of values
      • getValues

        public long[] getValues()
        Returns the entire set of values in the snapshot.
        Specified by:
        getValues in interface org.xbib.metrics.api.Snapshot
        Returns:
        the entire set of values
      • getMax

        public long getMax()
        Returns the highest value in the snapshot.
        Specified by:
        getMax in interface org.xbib.metrics.api.Snapshot
        Returns:
        the highest value
      • getMin

        public long getMin()
        Returns the lowest value in the snapshot.
        Specified by:
        getMin in interface org.xbib.metrics.api.Snapshot
        Returns:
        the lowest value
      • getMean

        public double getMean()
        Returns the weighted arithmetic mean of the values in the snapshot.
        Specified by:
        getMean in interface org.xbib.metrics.api.Snapshot
        Returns:
        the weighted arithmetic mean
      • getStdDev

        public double getStdDev()
        Returns the weighted standard deviation of the values in the snapshot.
        Specified by:
        getStdDev in interface org.xbib.metrics.api.Snapshot
        Returns:
        the weighted standard deviation value
      • dump

        public void dump​(java.io.OutputStream output)
        Writes the values of the snapshot to the given stream.
        Specified by:
        dump in interface org.xbib.metrics.api.Snapshot
        Parameters:
        output - an output stream