|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hazelcast.internal.metrics.impl.MetricsRegistryImpl
public class MetricsRegistryImpl
The MetricsRegistry
implementation.
Constructor Summary | |
---|---|
MetricsRegistryImpl(ILogger logger)
Creates a MetricsRegistryImpl instance. |
Method Summary | ||
---|---|---|
|
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. |
|
|
register(S source,
String name,
DoubleProbe<S> input)
Registers a probe If a Metric with the given name already has an input, that input will be overwritten. |
|
|
register(S source,
String name,
LongProbe<S> input)
Registers a probe. |
|
|
scanAndRegister(S source,
String namePrefix)
Scans the source object for any fields/methods that have been annotated with Probe annotation, and
registering these fields/methods as metrics. |
|
void |
scheduleAtFixedRate(Runnable publisher,
long period,
TimeUnit timeUnit)
Schedules a publisher to be executed at a fixed rate. |
|
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetricsRegistryImpl(ILogger logger)
logger
- the ILogger used
NullPointerException
- if logger is nullMethod Detail |
---|
public 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, there source/inputs will be updated. So multiple registrations
if the same object are ignored.
If an object has no @Gauge annotations, the call is ignored.
scanAndRegister
in interface MetricsRegistry
source
- the object to scan.namePrefix
- the name prefix.public <S> void register(S source, String name, LongProbe<S> input)
MetricsRegistry
register
in interface MetricsRegistry
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
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
public <S> void deregister(S source)
MetricsRegistry
deregister
in interface MetricsRegistry
source
- the object to deregisterpublic void scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit)
MetricsRegistry
scheduleAtFixedRate
in interface MetricsRegistry
publisher
- the published task that needs to be executedperiod
- the time between executionstimeUnit
- the timeunit for periodpublic void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |