public interface MetricTagger
| Modifier and Type | Method and Description |
|---|---|
String |
metricId()
Returns the id for the metric.
|
String |
metricName()
Returns the name for the metric.
|
<S> void |
registerStaticMetrics(S source)
Scans the source object for any fields/methods that have been annotated
with
Probe annotation, and registers these fields/methods as
probe instances. |
<S> void |
registerStaticProbe(S source,
String metricName,
ProbeLevel level,
DoubleProbeFunction<S> probeFn)
Registers a single probe.
|
<S> void |
registerStaticProbe(S source,
String metricName,
ProbeLevel level,
LongProbeFunction<S> probeFn)
Registers a single probe.
|
<S> void |
registerStaticProbe(S source,
String metricName,
ProbeLevel level,
ProbeUnit unit,
DoubleProbeFunction<S> probeFn)
Registers a single probe.
|
<S> void |
registerStaticProbe(S source,
String metricName,
ProbeLevel level,
ProbeUnit unit,
LongProbeFunction<S> probeFn)
Registers a single probe.
|
MetricTagger |
withIdTag(String tag,
String value)
Returns a new MetricTagger instance with the given identifier tag
added.
|
MetricTagger |
withMetricTag(String value)
Returns a new MetricTagger instance with the given metric name tag
added.
|
MetricTagger |
withTag(String tag,
String value)
Returns a new MetricTagger instance with the given general purpose tag added.
|
MetricTagger withTag(String tag, String value)
tag - The name of the tagvalue - The value of the tagMetricTagger withIdTag(String tag, String value)
MetricsRegistryImpl
in the key of the tag as a discriminator if the metric built with
this MetricTagger is a static metric.tag - The name of the tagvalue - The value of the tagmetricId()MetricTagger withMetricTag(String value)
value - The value of the tag<S> void registerStaticProbe(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull ProbeUnit unit, @Nonnull DoubleProbeFunction<S> probeFn)
If a probe for the given name exists, it will be overwritten silently.
source - the object to pass to probeFnmetricName - the value of "metric" taglevel - the ProbeLevelunit - the unitprobeFn - the probe functionNullPointerException - if any of the arguments is null<S> void registerStaticProbe(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull DoubleProbeFunction<S> probeFn)
If a probe for the given name exists, it will be overwritten silently.
source - the object to pass to probeFnmetricName - the value of "metric" taglevel - the ProbeLevelprobeFn - the probe functionNullPointerException - if any of the arguments is null<S> void registerStaticProbe(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull ProbeUnit unit, @Nonnull LongProbeFunction<S> probeFn)
If a probe for the given name exists, it will be overwritten silently.
source - the object to pass to probeFnmetricName - the value of "metric" taglevel - the ProbeLevelunit - the unitprobeFn - the probe functionNullPointerException - if any of the arguments is null<S> void registerStaticProbe(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull LongProbeFunction<S> probeFn)
If a probe for the given name exists, it will be overwritten silently.
source - the object to pass to probeFnmetricName - the value of "metric" taglevel - the ProbeLevelprobeFn - the probe functionNullPointerException - if any of the arguments is null<S> void registerStaticMetrics(S source)
Probe annotation, and registers these fields/methods as
probe instances.
If a probe with the same name already exists, the probe is overwritten silently.
If an object has no @Probe annotations, the call is ignored.
source - the object to scanIllegalArgumentException - if the source contains Probe annotation
on a field/method of unsupported type.String metricName()
MetricsCollectors
and MetricsPublishers. The returned format is like
[name=myMap,unit=count,metric=map.entryCount].String metricId()
MetricsRegistryImpl
as the key of the static metric built with this MetricTagger. The
returned format is map[myMap].entryCount.
The purpose of the metricId is to make creating Gauges easier
and less error prone. With the metricName(), changing the
order of the tags, adding/removing tags break existing gauges.Copyright © 2019 Hazelcast, Inc.. All rights reserved.