Interface MeterRegistry
-
- All Known Implementing Classes:
AbstractMeterRegistry
,DropwizardMeterRegistry
,MeterRegistryHolder
,MeterRegistryHolder
public interface MeterRegistry
Creates and manages your application's set of meters. Exporters use the meter registry to iterate over the set of meters instrumenting your application, and then further iterate over each meter's metrics, generally resulting in a time series in the metrics backend for each combination of metrics and dimensions.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MeterRegistry.Config
Access to configuration options for this registry.static interface
MeterRegistry.More
Additional, less commonly used meter types.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MeterRegistry.Config
config()
Counter
counter(Meter.Id id)
Only used byCounter.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 byGauge.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 byDistributionSummary.builder(String)
.Timer
timer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride)
Only used byTimer.builder(String)
.
-
-
-
Method Detail
-
forEachMeter
default void forEachMeter(Consumer<? super Meter> consumer)
Iterate over each meter in the registry.- Parameters:
consumer
- Consumer of each meter during iteration.
-
config
MeterRegistry.Config config()
- Returns:
- A configuration object used to change the behavior of this registry.
-
find
default Search find(String name)
Initiate a search beginning with a metric name. If constraints added in the search are not satisfied, the search will returnnull
.- Parameters:
name
- The meter name to locate.- Returns:
- A new search.
-
get
default RequiredSearch get(String name)
Initiate a search beginning with a metric name. All constraints added in the search must be satisfied or a MeterNotFoundException is thrown.- Parameters:
name
- The meter name to locate.- Returns:
- A new search.
-
more
MeterRegistry.More more()
Access to less frequently used meter types and patterns.- Returns:
- Access to additional meter types and patterns.
-
register
Meter register(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
Register a custom meter type.- 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
void deregisterMatching(MeterFilter filter)
Deregister meters matching the provided filter.- Parameters:
filter
- a non-null meter filter
-
gauge
<T> Gauge gauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction)
Only used byGauge.builder(String, Object, ToDoubleFunction)
.- 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
Timer timer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride)
Only used byTimer.builder(String)
.- Parameters:
id
- The identifier for this timer.histogramConfig
- Configuration that governs how distribution statistics are computed.- Returns:
- A new or existing timer.
-
counter
Counter counter(Meter.Id id)
Only used byCounter.builder(String)
.- Parameters:
id
- The identifier for this counter.- Returns:
- A new or existing counter.
-
summary
DistributionSummary summary(Meter.Id id, HistogramConfig histogramConfig)
Only used byDistributionSummary.builder(String)
.- Parameters:
id
- The identifier for this distribution summary.histogramConfig
- Configuration that governs how distribution statistics are computed.- Returns:
- A new or existing distribution summary.
-
-