public class Statistic
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicInteger |
count |
protected boolean |
enableMinMax |
protected boolean |
enableStdDev |
Constructor and Description |
---|
Statistic() |
Modifier and Type | Method and Description |
---|---|
void |
addCount(int c)
Add to the accumulated count.
|
void |
addDelta(double delta)
Add to the cumulative and increments the count.
|
void |
addDelta(double delta,
int n)
Add to the cumulative and increments the count.
|
void |
addDelta(long delta)
Add to the cumulative and increments the count.
|
void |
addDelta(long delta,
int n)
Add to the cumulative and increments the count.
|
protected Statistic |
enableMinMax()
Enable tracking of min and max.
|
protected Statistic |
enableStdDev()
Enable computation of standard deviation.
|
double |
getAvg() |
double |
getCoefOfVariation()
Compute the coefficient of variation.
|
int |
getCount() |
double |
getCumulative()
Get the accumulated value.
|
double |
getMax() |
double |
getMin() |
double |
getStdDev() |
void |
reset()
Resets numbers.
|
protected final java.util.concurrent.atomic.AtomicInteger count
protected boolean enableStdDev
protected boolean enableMinMax
public final void addCount(int c)
c
- public final void addDelta(long delta)
public final void addDelta(double delta)
public final void addDelta(long delta, int n)
delta
- to add to the statisticn
- amount to add to the countpublic final void addDelta(double delta, int n)
delta
- to addn
- amount to add to the countpublic final double getAvg()
public final double getCoefOfVariation()
public final int getCount()
public final double getCumulative()
public final double getStdDev()
Double.Nan
is returned.public final double getMin()
public final double getMax()
public final void reset()
enableStandardDeviationComputation
or enableMinMax
.protected Statistic enableStdDev()
protected Statistic enableMinMax()