@InterfaceAudience.Private public class SampleStat extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SampleStat.MinMax
Helper to keep running min/max
|
Constructor and Description |
---|
SampleStat()
Construct a new running sample stat
|
Modifier and Type | Method and Description |
---|---|
SampleStat |
add(double x)
Add a sample the running stat.
|
SampleStat |
add(long nSamples,
double x)
Add some sample and a partial sum to the running stat.
|
void |
copyTo(SampleStat other)
Copy the values to other (saves object creation and gc.)
|
double |
max() |
double |
mean() |
double |
min() |
long |
numSamples() |
void |
reset() |
double |
stddev() |
double |
variance() |
public void reset()
public void copyTo(SampleStat other)
other
- the destination to hold our valuespublic SampleStat add(double x)
x
- the sample numberpublic SampleStat add(long nSamples, double x)
nSamples
- number of samplesx
- the partial sumpublic long numSamples()
public double mean()
public double variance()
public double stddev()
public double min()
public double max()
Copyright © 2013 Apache Software Foundation. All rights reserved.