public interface MeterRegistry
MeterRegistry may be used in a reactive context. As such, implementations must not negatively impact the calling thread, e.g. it should respond immediately by avoiding IO call, deep stack recursion or any coordination. ForgeRock changes: - Removed all non-public methods - added previously package-private 'register' method which is used by Meter Builder - added previously package-private 'gauge|timer|counter|summary" methods used by Meter Builders - Removed @Incubating annotations - Removed 'LongTaskTimer' support - Removed 'TimeGauge' support - 'More' switched to interface, reduced to only support TimeGauge - 'Config' switched to interface
Modifier and Type | Interface and Description |
---|---|
static interface |
MeterRegistry.Config
Access to configuration options for this registry.
|
static interface |
MeterRegistry.More
Additional, less commonly used meter types.
|
Modifier and Type | Method and Description |
---|---|
MeterRegistry.Config |
config() |
Counter |
counter(Meter.Id id)
Only used by
Counter.builder(String) . |
void |
deregisterMatching(MeterFilter filter)
Deregister meters matching the provided filter.
|
default Search |
find(String name)
Initiate a search beginning with a metric name.
|
default void |
forEachMeter(Consumer<? super Meter> consumer)
Iterate over each meter in the registry.
|
<T> Gauge |
gauge(Meter.Id id,
T obj,
ToDoubleFunction<T> valueFunction)
Only used by
Gauge.builder(String, Object, ToDoubleFunction) . |
default RequiredSearch |
get(String name)
Initiate a search beginning with a metric name.
|
List<Meter> |
getMeters() |
MeterRegistry.More |
more()
Access to less frequently used meter types and patterns.
|
Meter |
register(Meter.Id id,
Meter.Type type,
Iterable<Measurement> measurements)
Register a custom meter type.
|
DistributionSummary |
summary(Meter.Id id,
HistogramConfig histogramConfig)
Only used by
DistributionSummary.builder(String) . |
Timer |
timer(Meter.Id id,
HistogramConfig histogramConfig,
PauseDetector pauseDetectorOverride)
Only used by
Timer.builder(String) . |
default void forEachMeter(Consumer<? super Meter> consumer)
consumer
- Consumer of each meter during iteration.MeterRegistry.Config config()
default Search find(String name)
null
.name
- The meter name to locate.default RequiredSearch get(String name)
name
- The meter name to locate.MeterRegistry.More more()
Meter register(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
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.void deregisterMatching(MeterFilter filter)
filter
- a non-null meter filter<T> Gauge gauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction)
Gauge.builder(String, Object, ToDoubleFunction)
.T
- The type of the state object from which the gauge value is extracted.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.Timer timer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride)
Timer.builder(String)
.id
- The identifier for this timer.histogramConfig
- Configuration that governs how distribution statistics are computed.Counter counter(Meter.Id id)
Counter.builder(String)
.id
- The identifier for this counter.DistributionSummary summary(Meter.Id id, HistogramConfig histogramConfig)
DistributionSummary.builder(String)
.id
- The identifier for this distribution summary.histogramConfig
- Configuration that governs how distribution statistics are computed.Copyright 2010-2022 ForgeRock AS.