Class StatisticRegistry
java.lang.Object
org.terracotta.statistics.registry.StatisticRegistry
This class replaces the previous
StatisticRegistry
in the cases where you do not need any sampling and history.
This class typically does a sort of mapping between the registrations and the discovered operations or passthrough statistics.
This class also support the generation of management metadata from the discovered statistics.
Non thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Objectprivate final Map<String,ValueStatistic<? extends Serializable>> private final LongSupplier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,ValueStatistic<? extends Serializable>> hasTags(Collection<String> tags) <T extends Serializable>
Optional<Statistic<T>>queryStatistic(String fullStatisticName) Query a statistic based on the full statistic name.<T extends Serializable>
Optional<Statistic<T>>queryStatistic(String fullStatisticName, long sinceMillis) Query a statistic based on the full statistic name.Map<String,Statistic<? extends Serializable>> Map<String,Statistic<? extends Serializable>> queryStatistics(long sinceMillis) voidregisterCounter(String fullStatName, Supplier<Number> accessor) Directly register a COUNTER stat with its accessorvoidregisterGauge(String fullStatName, Supplier<Number> accessor) Directly register a GAUGE stat with its accessor<T extends Enum<T>>
booleanregisterStatistic(String statNameSuffix, OperationStatisticDescriptor<T> descriptor, EnumSet<T> outcomes) <T extends Serializable>
booleanregisterStatistic(String statNameSuffix, ValueStatisticDescriptor descriptor) <T extends Serializable>
voidregisterStatistic(String fullStatName, StatisticType type, Supplier<T> accessor) <T extends Serializable>
voidregisterStatistic(String fullStatName, ValueStatistic<T> accessor) voidregisterTable(String fullStatName, Supplier<Table> accessor) Directly register a TABLE stat with its accessors
-
Field Details
-
contextObject
-
timeSource
-
statistics
-
-
Constructor Details
-
StatisticRegistry
-
-
Method Details
-
getStatistics
-
queryStatistic
Query a statistic based on the full statistic name. Returns null if not found. -
queryStatistic
public <T extends Serializable> Optional<Statistic<T>> queryStatistic(String fullStatisticName, long sinceMillis) Query a statistic based on the full statistic name. Returns null if not found. -
queryStatistics
-
queryStatistics
-
registerStatistic
public <T extends Serializable> void registerStatistic(String fullStatName, StatisticType type, Supplier<T> accessor) -
registerStatistic
public <T extends Serializable> void registerStatistic(String fullStatName, ValueStatistic<T> accessor) -
registerTable
Directly register a TABLE stat with its accessors -
registerGauge
Directly register a GAUGE stat with its accessor -
registerCounter
Directly register a COUNTER stat with its accessor -
registerStatistic
public <T extends Serializable> boolean registerStatistic(String statNameSuffix, ValueStatisticDescriptor descriptor) -
registerStatistic
public <T extends Enum<T>> boolean registerStatistic(String statNameSuffix, OperationStatisticDescriptor<T> descriptor, EnumSet<T> outcomes) -
hasTags
-