com.hazelcast.internal.metrics.impl
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()
MetricsRegistry
modCount
in interface MetricsRegistry
public Set<String> getNames()
MetricsRegistry
getNames
in interface MetricsRegistry
public <S> void scanAndRegister(S source, String namePrefix)
MetricsRegistry
Probe
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 MetricsRegistry
source
- 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)
MetricsRegistry
register
in interface MetricsRegistry
source
- 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)
MetricsRegistry
register
in interface MetricsRegistry
source
- the source object.name
- the name of the metric.input
- the input for the metric.public Gauge getGauge(String name)
MetricsRegistry
getGauge
in interface MetricsRegistry
name
- the name of the gauge to get.public <S> void deregister(S source)
MetricsRegistry
deregister
in interface MetricsRegistry
source
- the object to deregister.public void scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit)
MetricsRegistry
scheduleAtFixedRate
in interface MetricsRegistry
publisher
- 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.