public class ProbeBuilderImpl extends Object implements ProbeBuilder
Modifier and Type | Method and Description |
---|---|
String |
metricName()
Returns the name for the metric.
|
<S> void |
register(S source,
String metricName,
ProbeLevel level,
ProbeUnit unit,
DoubleProbeFunction<S> probe)
Registers a single probe.
|
<S> void |
register(S source,
String metricName,
ProbeLevel level,
ProbeUnit unit,
LongProbeFunction<S> probe)
Registers a single probe.
|
<S> void |
scanAndRegister(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. |
ProbeBuilderImpl |
withTag(String tag,
String value)
Returns a new ProbeBuilder instance with the given tag added.
|
@CheckReturnValue public ProbeBuilderImpl withTag(String tag, String value)
ProbeBuilder
withTag
in interface ProbeBuilder
public String metricName()
ProbeBuilder
metricName
in interface ProbeBuilder
public <S> void register(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull ProbeUnit unit, @Nonnull DoubleProbeFunction<S> probe)
ProbeBuilder
If a probe for the given name exists, it will be overwritten silently.
register
in interface ProbeBuilder
source
- the object to pass to probeFnmetricName
- the value of "metric" taglevel
- the ProbeLevelunit
- the unitprobe
- the probe functionpublic <S> void register(@Nonnull S source, @Nonnull String metricName, @Nonnull ProbeLevel level, @Nonnull ProbeUnit unit, @Nonnull LongProbeFunction<S> probe)
ProbeBuilder
If a probe for the given name exists, it will be overwritten silently.
register
in interface ProbeBuilder
source
- the object to pass to probeFnmetricName
- the value of "metric" taglevel
- the ProbeLevelunit
- the unitprobe
- the probe functionpublic <S> void scanAndRegister(S source)
ProbeBuilder
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.
scanAndRegister
in interface ProbeBuilder
source
- the object to scanCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.