|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jorphan.math.StatCalculator<T>
public abstract class StatCalculator<T extends Number & Comparable<? super T>>
This class serves as a way to calculate the median, max, min etc. of a list of values. It is not threadsafe.
Constructor Summary | |
---|---|
StatCalculator(T zero,
T min,
T max)
This constructor is used to set up particular values for the generic class instance. |
Method Summary | |
---|---|
void |
addAll(StatCalculator<T> calc)
|
void |
addBytes(long newValue)
|
void |
addValue(T val)
Add a single value (normally elapsed time) |
void |
addValue(T val,
long sampleCount)
Update the calculator with the value for an aggregated sample. |
void |
clear()
|
protected abstract T |
divide(T val,
int n)
|
protected abstract T |
divide(T val,
long n)
|
long |
getCount()
|
Map<Number,Number[]> |
getDistribution()
Returns the distribution of the values in the list. |
T |
getMax()
|
double |
getMean()
|
T |
getMedian()
|
T |
getMin()
|
T |
getPercentPoint(double percent)
Get the value which %percent% of the values are less than. |
T |
getPercentPoint(float percent)
Get the value which %percent% of the values are less than. |
double |
getStandardDeviation()
|
double |
getSum()
|
long |
getTotalBytes()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StatCalculator(T zero, T min, T max)
zero
- - value to return for Median and PercentPoint if there are no valuesmin
- - value to return for minimum if there are no valuesmax
- - value to return for maximum if there are no valuesMethod Detail |
---|
public void clear()
public void addBytes(long newValue)
public void addAll(StatCalculator<T> calc)
public T getMedian()
public long getTotalBytes()
public T getPercentPoint(float percent)
percent
-
public T getPercentPoint(double percent)
percent
-
public Map<Number,Number[]> getDistribution()
public double getMean()
public double getStandardDeviation()
public T getMin()
public T getMax()
public long getCount()
public double getSum()
protected abstract T divide(T val, int n)
protected abstract T divide(T val, long n)
public void addValue(T val, long sampleCount)
val
- the aggregate value, normally the elapsed timesampleCount
- the number of samples contributing to the aggregate valuepublic void addValue(T val)
val
- the value to add, which should correspond with a single sampleaddValue(Number, long)
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |