public class MetricsRegistryImpl extends Object implements MetricsRegistry
MetricsRegistry implementation.| Constructor and Description |
|---|
MetricsRegistryImpl(ILogger logger)
Creates a MetricsRegistryImpl instance.
|
| Modifier and Type | Method and Description |
|---|---|
<S> void |
deregister(S source)
Deregisters and scans object with probe annotations.
|
Gauge |
getGauge(String name)
Gets the Gauge for a given name.
|
Set<String> |
getNames()
Gets a set of all current metric names.
|
int |
modCount()
Returns the modCount.
|
<S> void |
register(S source,
String name,
DoubleProbe<S> input)
Registers a probe.
|
<S> void |
register(S source,
String name,
LongProbe<S> input)
Registers a probe.
|
<S> void |
scanAndRegister(S source,
String namePrefix)
Scans the source object for any fields/methods that have been given a name prefix with
Probe
annotation, and registering these fields/methods as metrics. |
void |
scheduleAtFixedRate(Runnable publisher,
long period,
TimeUnit timeUnit)
Schedules a publisher to be periodically executed.
|
void |
shutdown() |
public MetricsRegistryImpl(ILogger logger)
logger - the ILogger usedNullPointerException - if logger is nullpublic int modCount()
MetricsRegistrymodCount in interface MetricsRegistrypublic Set<String> getNames()
MetricsRegistrygetNames in interface MetricsRegistrypublic <S> void scanAndRegister(S source,
String namePrefix)
MetricsRegistryProbe
annotation, and registering these fields/methods as metrics.
If metrics with the same name already exist, their source/inputs will be updated. Multiple registrations
of the same object are ignored.
If an object has no @Gauge annotations, the call is ignored.scanAndRegister in interface MetricsRegistrysource - the source object to scan.namePrefix - search the source object for fields/methods that have this name prefix.public <S> void register(S source,
String name,
LongProbe<S> input)
MetricsRegistryregister in interface MetricsRegistrysource - the source object.name - the name of the metric.input - the input for the metric.public <S> void register(S source,
String name,
DoubleProbe<S> input)
MetricsRegistryregister in interface MetricsRegistrysource - the source object.name - the name of the metric.input - the input for the metric.public Gauge getGauge(String name)
MetricsRegistrygetGauge in interface MetricsRegistryname - the name of the gauge to get.public <S> void deregister(S source)
MetricsRegistryderegister in interface MetricsRegistrysource - the object to deregister.public void scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit)
MetricsRegistryscheduleAtFixedRate in interface MetricsRegistrypublisher - the published task that needs to be periodically executed.period - the time between executions.timeUnit - the timeunit for period.public void shutdown()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.