Users can easily extend this class and provide the implementation of toString() method to format the stats as desired. By default all the stats are printed in a single line.
| Modifier and Type | Field and Description |
|---|---|
| private double | |
| private double | |
| private long | |
| pack-priv double | |
| pack-priv double | |
| private Statistics | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | StatisticsAccumulator(String
a String representing the units for the samples collected unit)Construct the Statistics Accumulator by providing the unit as a String. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public double | |
| public void | |
| public long | |
| public synchronized Statistics | |
| public String | getValue()
Computes the Standard Statistic Results based on the samples collected so far and provides the complete value as a formatted String |
| public double | |
| public double | |
| public void | |
| public double | |
| public String | toString()
Overrides java. Users can extend StatisticsAccumulator to provide the complete Stats in the format they prefer, if the default format doesn't suffice. |
| public String | |
| public void | unitTestValidate(String expectedUnit, double expectedMin, double expectedMax, long expectedSampleCount, double expectedAverage, double expectedStandardDeviation)
This is an internal API to test StatisticsAccumulator... |
| max | back to summary |
|---|---|
| private double max | |
| min | back to summary |
|---|---|
| private double min | |
| sampleCount | back to summary |
|---|---|
| private long sampleCount | |
| sampleSquareSum | back to summary |
|---|---|
| pack-priv double sampleSquareSum | |
| sampleSum | back to summary |
|---|---|
| pack-priv double sampleSum | |
| stats | back to summary |
|---|---|
| private Statistics stats | |
| unit | back to summary |
|---|---|
| private String unit | |
| StatisticsAccumulator | back to summary |
|---|---|
| public StatisticsAccumulator(String unit) Construct the Statistics Accumulator by providing the unit as a String. The examples of units are "Hours", "Minutes", "Seconds", "MilliSeconds", "Micro Seconds" etc.,
| |
| augment | back to summary |
|---|---|
| public void augment(StatisticsAccumulator acc) | |
| average | back to summary |
|---|---|
| public double average() | |
| clearState | back to summary |
|---|---|
| public void clearState() Clears the samples and starts fresh on new samples. | |
| count | back to summary |
|---|---|
| public long count() | |
| getStats | back to summary |
|---|---|
| public synchronized Statistics getStats() | |
| getValue | back to summary |
|---|---|
| public String getValue() Computes the Standard Statistic Results based on the samples collected so far and provides the complete value as a formatted String | |
| max | back to summary |
|---|---|
| public double max() | |
| min | back to summary |
|---|---|
| public double min() | |
| sample | back to summary |
|---|---|
| public void sample(double value) | |
| standardDeviation | back to summary |
|---|---|
| public double standardDeviation() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Users can extend StatisticsAccumulator to provide the complete Stats in the format they prefer, if the default format doesn't suffice. | |
| unit | back to summary |
|---|---|
| public String unit() | |
| unitTestValidate | back to summary |
|---|---|
| public void unitTestValidate(String expectedUnit, double expectedMin, double expectedMax, long expectedSampleCount, double expectedAverage, double expectedStandardDeviation) This is an internal API to test StatisticsAccumulator... | |