Class Statistic<T extends java.io.Serializable>
- java.lang.Object
-
- org.terracotta.statistics.registry.Statistic<T>
-
- All Implemented Interfaces:
java.io.Serializable
public class Statistic<T extends java.io.Serializable> extends java.lang.Object implements java.io.Serializable- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Sample<T>>samplesprivate static longserialVersionUIDprivate StatisticTypetype
-
Constructor Summary
Constructors Constructor Description Statistic(StatisticType type)Statistic(StatisticType type, java.util.List<Sample<T>> samples)Statistic(StatisticType type, Sample<T> sample)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <T extends java.io.Serializable>
booleanaccepted(T sample)(package private) static <T extends java.io.Serializable>
Statistic<T>extract(ValueStatistic<T> valueStatistic, long sinceMillis, long now)java.util.Optional<Sample<T>>getLatestSample()java.util.Optional<T>getLatestSampleValue()java.util.List<Sample<T>>getSamples()StatisticTypegetType()booleanisEmpty()java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
type
private final StatisticType type
-
-
Constructor Detail
-
Statistic
public Statistic(StatisticType type)
-
Statistic
public Statistic(StatisticType type, Sample<T> sample)
-
Statistic
public Statistic(StatisticType type, java.util.List<Sample<T>> samples)
-
-
Method Detail
-
getType
public StatisticType getType()
-
isEmpty
public boolean isEmpty()
-
getLatestSampleValue
public java.util.Optional<T> getLatestSampleValue()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
extract
static <T extends java.io.Serializable> Statistic<T> extract(ValueStatistic<T> valueStatistic, long sinceMillis, long now)
-
accepted
private static <T extends java.io.Serializable> boolean accepted(T sample)
-
-