Class StatisticsStream

java.lang.Object
com.comphenix.protocol.timing.StatisticsStream

public class StatisticsStream extends Object
Represents an online algortihm for computing the mean and standard deviation without storing every value.
  • Constructor Details

    • StatisticsStream

      public StatisticsStream()
      Construct a new stream with no observations.
    • StatisticsStream

      public StatisticsStream(StatisticsStream other)
      Construct a copy of the given stream.
      Parameters:
      other - - copy of the stream.
  • Method Details

    • observe

      public void observe(double value)
      Observe a value.
      Parameters:
      value - - the observed value.
    • getMean

      public double getMean()
      Retrieve the average of all the observations.
      Returns:
      The average.
    • getVariance

      public double getVariance()
      Retrieve the variance of all the observations.
      Returns:
      The variance.
    • getStandardDeviation

      public double getStandardDeviation()
      Retrieve the standard deviation of all the observations.
      Returns:
      The STDV.
    • getMinimum

      public double getMinimum()
      Retrieve the minimum observation yet observed.
      Returns:
      The minimum observation.
    • getMaximum

      public double getMaximum()
      Retrieve the maximum observation yet observed.
      Returns:
      The maximum observation.
    • add

      public StatisticsStream add(StatisticsStream other)
      Combine the two statistics.
      Parameters:
      other - - the other statistics.
      Returns:
      Combined statistics
    • getCount

      public int getCount()
      Retrieve the number of observations.
      Returns:
      Number of observations.
    • toString

      public String toString()
      Overrides:
      toString in class Object