Class DropwizardMeterRegistry
- java.lang.Object
-
- org.forgerock.monitoring.dropwizard.AbstractMeterRegistry
-
- org.forgerock.monitoring.dropwizard.DropwizardMeterRegistry
-
- All Implemented Interfaces:
MeterRegistry
public class DropwizardMeterRegistry extends AbstractMeterRegistry
Implementation of a MeterRegistry supporting tags using dropwizard metric types.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.forgerock.monitoring.dropwizard.AbstractMeterRegistry
AbstractMeterRegistry.ConfigImpl
-
Nested classes/interfaces inherited from interface org.forgerock.monitoring.api.instrument.MeterRegistry
MeterRegistry.Config, MeterRegistry.More
-
-
Constructor Summary
Constructors Constructor Description DropwizardMeterRegistry(Clock clock)
Constructor for this class.DropwizardMeterRegistry(Clock clock, Supplier<com.codahale.metrics.Reservoir> newReservoirSupplier)
Constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HistogramConfig
defaultHistogramConfig()
Every custom registry implementation should define a default histogram expiry.protected TimeUnit
getBaseTimeUnit()
The registry's base TimeUnit.protected Counter
newCounter(Meter.Id id)
Build a new counter to be added to the registry.protected DistributionSummary
newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig)
Build a new distribution summary to be added to the registry.protected <T> Gauge
newGauge(Meter.Id id, T obj, ToDoubleFunction<T> valueFunction)
Build a new gauge to be added to the registry.protected Meter
newMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
Build a new custom meter to be added to the registry.protected Timer
newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector)
Build a new timer to be added to the registry.-
Methods inherited from class org.forgerock.monitoring.dropwizard.AbstractMeterRegistry
config, counter, deregisterMatching, gauge, getMeters, more, newTimeGauge, register, summary, timer
-
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 Detail
-
DropwizardMeterRegistry
public DropwizardMeterRegistry(Clock clock)
Constructor for this class.- Parameters:
clock
- the clock
-
-
Method Detail
-
newGauge
protected <T> Gauge newGauge(Meter.Id id, T obj, ToDoubleFunction<T> valueFunction)
Description copied from class:AbstractMeterRegistry
Build a new gauge to be added to the registry. This is guaranteed to only be called if the gauge doesn't already exist.- Specified by:
newGauge
in classAbstractMeterRegistry
- Type Parameters:
T
- The type of the state object from which the gauge value is extracted.- Parameters:
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.- Returns:
- A new gauge.
-
newCounter
protected Counter newCounter(Meter.Id id)
Description copied from class:AbstractMeterRegistry
Build a new counter to be added to the registry. This is guaranteed to only be called if the counter doesn't already exist.- Specified by:
newCounter
in classAbstractMeterRegistry
- Parameters:
id
- The id that uniquely identifies the counter.- Returns:
- A new counter.
-
newTimer
protected Timer newTimer(Meter.Id id, HistogramConfig histogramConfig, PauseDetector pauseDetector)
Description copied from class:AbstractMeterRegistry
Build a new timer to be added to the registry. This is guaranteed to only be called if the timer doesn't already exist.- Specified by:
newTimer
in classAbstractMeterRegistry
- Parameters:
id
- The id that uniquely identifies the timer.histogramConfig
- the configuration for the histogram.pauseDetector
- the pause detector.- Returns:
- A new timer.
-
newDistributionSummary
protected DistributionSummary newDistributionSummary(Meter.Id id, HistogramConfig histogramConfig)
Description copied from class:AbstractMeterRegistry
Build a new distribution summary to be added to the registry. This is guaranteed to only be called if the distribution summary doesn't already exist.- Specified by:
newDistributionSummary
in classAbstractMeterRegistry
- Parameters:
id
- The id that uniquely identifies the distribution summary.histogramConfig
- the configuration for the histogram.- Returns:
- A new distribution summary.
-
newMeter
protected Meter newMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)
Description copied from class:AbstractMeterRegistry
Build a new custom meter to be added to the registry. This is guaranteed to only be called if the custom meter doesn't already exist.- Specified by:
newMeter
in classAbstractMeterRegistry
- Parameters:
id
- The id that uniquely identifies the custom meter.type
- The type of meter.measurements
- the measurements.- Returns:
- A new custom meter.
-
getBaseTimeUnit
protected TimeUnit getBaseTimeUnit()
Description copied from class:AbstractMeterRegistry
The registry's base TimeUnit.- Specified by:
getBaseTimeUnit
in classAbstractMeterRegistry
- Returns:
- the non-null registry's base TimeUnit.
-
defaultHistogramConfig
protected HistogramConfig defaultHistogramConfig()
Description copied from class:AbstractMeterRegistry
Every custom registry implementation should define a default histogram expiry.histogramConfig.builder().histogramExpiry(defaultStep).build().merge(HistogramConfig.DEFAULT);
- Specified by:
defaultHistogramConfig
in classAbstractMeterRegistry
- Returns:
- the configuration for the histogram.
-
-