public class MetricsRegistryImpl extends Object implements MetricsRegistry
MetricsRegistry implementation.| Constructor and Description |
|---|
MetricsRegistryImpl(ILogger logger,
ProbeLevel minimumLevel)
Creates a MetricsRegistryImpl instance.
|
| Modifier and Type | Method and Description |
|---|---|
<S> void |
deregister(S source)
Deregisters all probes for a given source object.
|
Set<String> |
getNames()
Gets a set of all current probe names.
|
com.hazelcast.internal.metrics.impl.ProbeInstance |
getProbeInstance(String name) |
DoubleGauge |
newDoubleGauge(String name)
Creates a DoubleProbe for a given metric name.
|
com.hazelcast.internal.metrics.impl.LongGaugeImpl |
newLongGauge(String name)
Creates a LongGauge for a given metric name.
|
<S> void |
register(S source,
String name,
ProbeLevel level,
DoubleProbeFunction<S> function)
Registers a probe
If a probe for the given name exists, it will be overwritten.
|
<S> void |
register(S source,
String name,
ProbeLevel level,
LongProbeFunction<S> function)
Registers a probe.
|
void |
render(ProbeRenderer renderer)
Renders the content of the MetricsRegistry.
|
<S> void |
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 probes instances. |
void |
scheduleAtFixedRate(Runnable publisher,
long period,
TimeUnit timeUnit)
Schedules a publisher to be executed at a fixed rate.
|
void |
shutdown() |
public MetricsRegistryImpl(ILogger logger, ProbeLevel minimumLevel)
logger - the ILogger usedminimumLevel - the minimum ProbeLevel. If a probe is registered with a ProbeLevel lower than the minimum ProbeLevel,
then the registration is skipped.NullPointerException - if logger or minimumLevel is nullpublic Set<String> getNames()
MetricsRegistrygetNames in interface MetricsRegistrypublic <S> void scanAndRegister(S source,
String namePrefix)
MetricsRegistryProbe annotation, and
registering these fields/methods as probes instances.
If a probe is called, 'queueSize' and the namePrefix is 'operations, then the name of the probe-instance
is 'operations.queueSize'.
If probes with the same name already exist, then the probes are replaced.
If an object has no @Gauge annotations, the call is ignored.scanAndRegister in interface MetricsRegistrysource - the object to scan.namePrefix - the name prefix.public <S> void register(S source,
String name,
ProbeLevel level,
LongProbeFunction<S> function)
MetricsRegistryregister in interface MetricsRegistryname - the name of the probe.level - the ProbeLevelfunction - the probepublic <S> void register(S source,
String name,
ProbeLevel level,
DoubleProbeFunction<S> function)
MetricsRegistryregister in interface MetricsRegistryname - the name of the probelevel - the ProbeLevelfunction - the probepublic com.hazelcast.internal.metrics.impl.ProbeInstance getProbeInstance(String name)
public com.hazelcast.internal.metrics.impl.LongGaugeImpl newLongGauge(String name)
MetricsRegistrynewLongGauge in interface MetricsRegistryname - the name of the metric.public DoubleGauge newDoubleGauge(String name)
MetricsRegistrynewDoubleGauge in interface MetricsRegistryname - name of the metricMetricsRegistry.newLongGauge(String)public <S> void deregister(S source)
MetricsRegistryderegister in interface MetricsRegistrysource - the object to deregisterpublic void render(ProbeRenderer renderer)
MetricsRegistryrender in interface MetricsRegistryrenderer - the ProbeRendererpublic void scheduleAtFixedRate(Runnable publisher, long period, TimeUnit timeUnit)
MetricsRegistryscheduleAtFixedRate in interface MetricsRegistrypublisher - the published task that needs to be executedperiod - the time between executionstimeUnit - the timeunit for periodpublic void shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.