@ThreadSafe
@Immutable
public abstract class OverPeriodAverageCounter<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
MAX_NUMBER_OF_MEASURE_POINTS |
| Modifier | Constructor and Description |
|---|---|
protected |
OverPeriodAverageCounter(Duration measurePeriod,
Duration resolution) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
add(T value,
T to) |
protected abstract T |
averageFor(T totalSumOfValues,
long totalSumOfValueCount) |
T |
get() |
Duration |
getMeasurePeriod() |
int |
getNumberOfMeasureSlots() |
Duration |
getResolution() |
protected abstract T |
getZeroValue() |
void |
record(T value) |
java.lang.String |
toString() |
protected static final int MAX_NUMBER_OF_MEASURE_POINTS
public void record(@Nonnull
T value)
@Nonnull public T get()
@Nonnull public Duration getMeasurePeriod()
@Nonnull public Duration getResolution()
@Nonnegative public int getNumberOfMeasureSlots()
@Nonnull protected abstract T getZeroValue()
@Nonnull protected abstract T averageFor(@Nonnull T totalSumOfValues, @Nonnegative long totalSumOfValueCount)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013 echocat. All Rights Reserved.