Package org.terracotta.statistics
Class SampledStatisticAdapter<T extends Serializable>
java.lang.Object
org.terracotta.statistics.SampledStatisticAdapter<T>
- All Implemented Interfaces:
SampledStatistic<T>,ValueStatistic<T>
public class SampledStatisticAdapter<T extends Serializable>
extends Object
implements SampledStatistic<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSampledStatisticAdapter(ValueStatistic<T> statistic, LongSupplier timeSource) -
Method Summary
Modifier and TypeMethodDescriptionhistory()The history of valueshistory(long since) The history of values, since a given time in msstatic <T extends Serializable>
SampledStatistic<T>sample(ValueStatistic<T> accessor, LongSupplier timeSource) type()value()
-
Field Details
-
timeSource
-
statistic
-
-
Constructor Details
-
SampledStatisticAdapter
-
-
Method Details
-
value
- Specified by:
valuein interfaceValueStatistic<T extends Serializable>- Returns:
- The current statistic value
-
history
Description copied from interface:SampledStatisticThe history of values- Specified by:
historyin interfaceSampledStatistic<T extends Serializable>- Returns:
- the list
-
history
Description copied from interface:SampledStatisticThe history of values, since a given time in ms- Specified by:
historyin interfaceSampledStatistic<T extends Serializable>- Parameters:
since- starting point of history in ms- Returns:
- the list
-
type
- Specified by:
typein interfaceValueStatistic<T extends Serializable>- Returns:
- The statistic type
-
sample
public static <T extends Serializable> SampledStatistic<T> sample(ValueStatistic<T> accessor, LongSupplier timeSource)
-