public class StatisticRegistry extends Object
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.
| Constructor and Description |
|---|
StatisticRegistry(Object contextObject) |
StatisticRegistry(Object contextObject,
LongSupplier timeSource) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,ValueStatistic<? extends Serializable>> |
getStatistics() |
<T extends Serializable> |
queryStatistic(String fullStatisticName)
Query a statistic based on the full statistic name.
|
<T extends Serializable> |
queryStatistic(String fullStatisticName,
long sinceMillis)
Query a statistic based on the full statistic name.
|
Map<String,Statistic<? extends Serializable>> |
queryStatistics() |
Map<String,Statistic<? extends Serializable>> |
queryStatistics(long sinceMillis) |
void |
registerCounter(String fullStatName,
Supplier<Number> accessor)
Directly register a COUNTER stat with its accessor
|
void |
registerGauge(String fullStatName,
Supplier<Number> accessor)
Directly register a GAUGE stat with its accessor
|
<T extends Enum<T>> |
registerStatistic(String statNameSuffix,
OperationStatisticDescriptor<T> descriptor,
EnumSet<T> outcomes) |
<T extends Serializable> |
registerStatistic(String fullStatName,
StatisticType type,
Supplier<T> accessor) |
<T extends Serializable> |
registerStatistic(String fullStatName,
ValueStatistic<T> accessor) |
<T extends Serializable> |
registerStatistic(String statNameSuffix,
ValueStatisticDescriptor descriptor) |
void |
registerTable(String fullStatName,
Supplier<Table> accessor)
Directly register a TABLE stat with its accessors
|
public StatisticRegistry(Object contextObject)
public StatisticRegistry(Object contextObject, LongSupplier timeSource)
protected Map<String,ValueStatistic<? extends Serializable>> getStatistics()
public <T extends Serializable> Optional<Statistic<T>> queryStatistic(String fullStatisticName)
public <T extends Serializable> Optional<Statistic<T>> queryStatistic(String fullStatisticName, long sinceMillis)
public Map<String,Statistic<? extends Serializable>> queryStatistics()
public Map<String,Statistic<? extends Serializable>> queryStatistics(long sinceMillis)
public <T extends Serializable> void registerStatistic(String fullStatName, StatisticType type, Supplier<T> accessor)
public <T extends Serializable> void registerStatistic(String fullStatName, ValueStatistic<T> accessor)
public void registerTable(String fullStatName, Supplier<Table> accessor)
public void registerGauge(String fullStatName, Supplier<Number> accessor)
public void registerCounter(String fullStatName, Supplier<Number> accessor)
public <T extends Serializable> boolean registerStatistic(String statNameSuffix, ValueStatisticDescriptor descriptor)
public <T extends Enum<T>> boolean registerStatistic(String statNameSuffix, OperationStatisticDescriptor<T> descriptor, EnumSet<T> outcomes)
Copyright © 2018. All rights reserved.