Class MeterRegistryHolder
java.lang.Object
org.forgerock.monitoring.api.instrument.MeterRegistryHolder
- All Implemented Interfaces:
MeterRegistry
Decorator for a meter registry. It can:
- prefix the dimensional metric names
- prefix the hierarchical metric names
- forward the metric creation to the decorated
MeterRegistry
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.monitoring.api.instrument.MeterRegistry
MeterRegistry.Config, MeterRegistry.More
-
Constructor Summary
ConstructorDescriptionMeterRegistryHolder
(String dimensionalNamePrefix, MeterRegistry registry) Constructor for this class. -
Method Summary
Modifier and TypeMethodDescriptionconfig()
Only used byCounter.builder(String)
.void
Deregister all meters held by this object.void
deregisterMatching
(MeterFilter filter) Deregister meters matching the provided filter.<T> Gauge
gauge
(Meter.Id id, T obj, ToDoubleFunction<T> valueFunction) Only used byGauge.builder(String, Object, ToDoubleFunction)
.hierarchicalNamePrefix
(String value) Add a hierarchical name prefix for thisMeterRegistryHolder
.more()
Access to less frequently used meter types and patterns.register
(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements) Register a custom meter type.summary
(Meter.Id id, HistogramConfig histogramConfig) Only used byDistributionSummary.builder(String)
.Adds a tag that will be automatically added to all meters registered against this meter registry.timer
(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride) Only used byTimer.builder(String)
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.forgerock.monitoring.api.instrument.MeterRegistry
find, forEachMeter, get
-
Constructor Details
-
MeterRegistryHolder
Constructor for this class.- Parameters:
dimensionalNamePrefix
- prefix for the dimensional metric names. It will be used as a prefix for the hierarchical metric names unless a specific hierarchical name prefix is specified throughhierarchicalNamePrefix(String)
.registry
- the decorated registry
-
-
Method Details
-
tag
Adds a tag that will be automatically added to all meters registered against this meter registry.- Parameters:
key
- the tag's keyvalue
- the tag's value- Returns:
- this meter registry
-
hierarchicalNamePrefix
Add a hierarchical name prefix for thisMeterRegistryHolder
.- Parameters:
value
- the value for the hierarchical name- Returns:
- this meter registry
-
counter
Description copied from interface:MeterRegistry
Only used byCounter.builder(String)
.- Specified by:
counter
in interfaceMeterRegistry
- Parameters:
id
- The identifier for this counter.- Returns:
- A new or existing counter.
-
gauge
Description copied from interface:MeterRegistry
Only used byGauge.builder(String, Object, ToDoubleFunction)
.- Specified by:
gauge
in interfaceMeterRegistry
- Type Parameters:
T
- The type of the state object from which the gauge value is extracted.- Parameters:
id
- The identifier for this gauge.obj
- State object used to compute a value.valueFunction
- Function that is applied on the value for the number.- Returns:
- A new or existing long task timer.
-
timer
public Timer timer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride) Description copied from interface:MeterRegistry
Only used byTimer.builder(String)
.- Specified by:
timer
in interfaceMeterRegistry
- Parameters:
id
- The identifier for this timer.histogramConfig
- Configuration that governs how distribution statistics are computed.- Returns:
- A new or existing timer.
-
summary
Description copied from interface:MeterRegistry
Only used byDistributionSummary.builder(String)
.- Specified by:
summary
in interfaceMeterRegistry
- Parameters:
id
- The identifier for this distribution summary.histogramConfig
- Configuration that governs how distribution statistics are computed.- Returns:
- A new or existing distribution summary.
-
register
Description copied from interface:MeterRegistry
Register a custom meter type.- Specified by:
register
in interfaceMeterRegistry
- Parameters:
id
- Id of the meter being registered.type
- Meter type, which may be used by naming conventions to normalize the name.measurements
- A sequence of measurements describing how to sample the meter.- Returns:
- The registry.
-
deregisterMatching
Description copied from interface:MeterRegistry
Deregister meters matching the provided filter.- Specified by:
deregisterMatching
in interfaceMeterRegistry
- Parameters:
filter
- a non-null meter filter
-
deregisterAll
public void deregisterAll()Deregister all meters held by this object. -
config
- Specified by:
config
in interfaceMeterRegistry
- Returns:
- A configuration object used to change the behavior of this registry.
-
more
Description copied from interface:MeterRegistry
Access to less frequently used meter types and patterns.- Specified by:
more
in interfaceMeterRegistry
- Returns:
- Access to additional meter types and patterns.
-
getMeters
- Specified by:
getMeters
in interfaceMeterRegistry
- Returns:
- The set of registered meters.
-