public abstract class AbstractMeterRegistry extends Object implements 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:
Modifier and Type | Class and Description |
---|---|
class |
AbstractMeterRegistry.ConfigImpl
Access to configuration options for this registry.
|
MeterRegistry.Config, MeterRegistry.More
Modifier | Constructor and Description |
---|---|
protected |
AbstractMeterRegistry(Clock clock)
Creates an abstract meter registry.
|
Modifier and Type | Method and Description |
---|---|
MeterRegistry.Config |
config() |
Counter |
counter(Meter.Id id)
Only used by
Counter.builder(String) . |
protected abstract HistogramConfig |
defaultHistogramConfig()
Every custom registry implementation should define a default histogram expiry.
|
void |
deregisterMatching(MeterFilter filter)
Deregister meters matching the provided filter.
|
<T> Gauge |
gauge(Meter.Id id,
T obj,
ToDoubleFunction<T> valueFunction)
Only used by
Gauge.builder(String, Object, ToDoubleFunction) . |
protected abstract TimeUnit |
getBaseTimeUnit()
The registry's base TimeUnit.
|
List<Meter> |
getMeters() |
MeterRegistry.More |
more()
Access to less frequently used meter types and patterns.
|
protected abstract Counter |
newCounter(Meter.Id id)
Build a new counter to be added to the registry.
|
protected abstract DistributionSummary |
newDistributionSummary(Meter.Id id,
HistogramConfig histogramConfig)
Build a new distribution summary to be added to the registry.
|
protected abstract <T> Gauge |
newGauge(Meter.Id id,
T obj,
ToDoubleFunction<T> valueFunction)
Build a new gauge to be added to the registry.
|
protected abstract Meter |
newMeter(Meter.Id id,
Meter.Type type,
Iterable<Measurement> measurements)
Build a new custom meter to be added to the registry.
|
protected <T> TimeGauge |
newTimeGauge(Meter.Id id,
T obj,
TimeUnit valueFunctionUnit,
ToDoubleFunction<T> valueFunction)
Build a new time gauge to be added to the registry.
|
protected abstract Timer |
newTimer(Meter.Id id,
HistogramConfig histogramConfig,
PauseDetector pauseDetector)
Build a new timer to be added to the registry.
|
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) . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
find, forEachMeter, get
protected AbstractMeterRegistry(Clock clock)
clock
- the clock to use for this meter registryprotected abstract <T> Gauge newGauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction)
T
- The type of the state object from which the gauge value is extracted.id
- The id that uniquely identifies the gauge.obj
- State object used to compute a value.valueFunction
- Function that is applied on the value for the number.protected abstract Counter newCounter(Meter.Id id)
id
- The id that uniquely identifies the counter.protected abstract Timer newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector)
id
- The id that uniquely identifies the timer.histogramConfig
- the configuration for the histogram.pauseDetector
- the pause detector.protected abstract DistributionSummary newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig)
id
- The id that uniquely identifies the distribution summary.histogramConfig
- the configuration for the histogram.protected abstract Meter newMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
id
- The id that uniquely identifies the custom meter.type
- The type of meter.measurements
- the measurements.protected <T> TimeGauge newTimeGauge(Meter.Id id, T obj, TimeUnit valueFunctionUnit, ToDoubleFunction<T> valueFunction)
T
- The type of the state object from which the gauge value is extracted.id
- The id that uniquely identifies the time gauge.obj
- State object used to compute a value.valueFunction
- Function that is applied on the value for the number.valueFunctionUnit
- the time unit of the value returned by the value function.protected abstract TimeUnit getBaseTimeUnit()
protected abstract HistogramConfig defaultHistogramConfig()
histogramConfig.builder().histogramExpiry(defaultStep).build().merge(HistogramConfig.DEFAULT);
public Counter counter(Meter.Id id)
MeterRegistry
Counter.builder(String)
.counter
in interface MeterRegistry
id
- The identifier for this counter.public <T> Gauge gauge(Meter.Id id, @Nullable T obj, ToDoubleFunction<T> valueFunction)
MeterRegistry
Gauge.builder(String, Object, ToDoubleFunction)
.gauge
in interface MeterRegistry
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.public Timer timer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetectorOverride)
MeterRegistry
Timer.builder(String)
.timer
in interface MeterRegistry
id
- The identifier for this timer.histogramConfig
- Configuration that governs how distribution statistics are computed.public DistributionSummary summary(Meter.Id id, HistogramConfig histogramConfig)
MeterRegistry
DistributionSummary.builder(String)
.summary
in interface MeterRegistry
id
- The identifier for this distribution summary.histogramConfig
- Configuration that governs how distribution statistics are computed.public Meter register(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
MeterRegistry
register
in interface MeterRegistry
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.public void deregisterMatching(MeterFilter filter)
MeterRegistry
deregisterMatching
in interface MeterRegistry
filter
- a non-null meter filterpublic List<Meter> getMeters()
getMeters
in interface MeterRegistry
public MeterRegistry.Config config()
config
in interface MeterRegistry
public MeterRegistry.More more()
MeterRegistry
more
in interface MeterRegistry
Copyright 2011-2017 ForgeRock AS.