com.hazelcast.internal.metrics
public interface MetricsRegistry
Metric
instances. Each metric has an input and each metric can be
identified using a name; a String. This name can be any string, the general structure is something like:
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.
|
<S> void scanAndRegister(S source, String namePrefix)
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.source
- the source object to scan.namePrefix
- search the source object for fields/methods that have this name prefix.NullPointerException
- if namePrefix or source is null.IllegalArgumentException
- if the source contains Gauge annotation on a field/method of unsupported type.<S> void register(S source, String name, LongProbe<S> input)
source
- the source object.name
- the name of the metric.input
- the input for the metric.NullPointerException
- if source, name or input is null.<S> void register(S source, String name, DoubleProbe<S> input)
source
- the source object.name
- the name of the metric.input
- the input for the metric.NullPointerException
- if name or input is null.<S> void deregister(S source)
source
- the object to deregister.NullPointerException
- if source is null.void scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit)
publisher
- the published task that needs to be periodically executed.period
- the time between executions.timeUnit
- the timeunit for period.NullPointerException
- if publisher or timeUnit is null.Gauge getGauge(String name)
name
- the name of the gauge to get.NullPointerException
- if name is null.Set<String> getNames()
int modCount()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.