Package org.eclipse.jetty.util.statistic
Class SampleStatistic
java.lang.Object
org.eclipse.jetty.util.statistic.SampleStatistic
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
Statistics on a sampled value.
Provides max, total, mean, count, variance, and standard deviation of continuous sequence of samples.
Calculates estimates of mean, variance, and standard deviation characteristics of a sample using a non synchronized approximation of the on-line algorithm presented in Donald Knuth's Art of Computer Programming, Volume 2, Semi numerical Algorithms, 3rd edition, page 232, Boston: Addison-Wesley. That cites a 1962 paper by B.P. Welford: Note on a Method for Calculating Corrected Sums of Squares and Products
This algorithm is also described in Wikipedia in the section "Online algorithm": Algorithms for calculating variance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetCount()Deprecated.longgetMax()Deprecated.doublegetMean()Deprecated.doubleDeprecated.longgetTotal()Deprecated.doubleDeprecated.voidrecord(long sample) Deprecated.Records a sample value.voidreset()Deprecated.Resets the statistics.voidset(long sample) Deprecated.userecord(long)insteadtoString()Deprecated.
-
Constructor Details
-
SampleStatistic
public SampleStatistic()Deprecated.
-
-
Method Details
-
reset
public void reset()Deprecated.Resets the statistics. -
record
public void record(long sample) Deprecated.Records a sample value.- Parameters:
sample- the value to record.
-
set
Deprecated.userecord(long)instead- Parameters:
sample- the value to record.
-
getMax
public long getMax()Deprecated.- Returns:
- the max value of the recorded samples
-
getTotal
public long getTotal()Deprecated.- Returns:
- the sum of all the recorded samples
-
getCount
public long getCount()Deprecated.- Returns:
- the number of samples recorded
-
getMean
public double getMean()Deprecated.- Returns:
- the average value of the samples recorded, or zero if there are no samples
-
getVariance
public double getVariance()Deprecated.- Returns:
- the variance of the samples recorded, or zero if there are less than 2 samples
-
getStdDev
public double getStdDev()Deprecated.- Returns:
- the standard deviation of the samples recorded
-
toString
Deprecated.
-