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 HistogramConfigdefaultHistogramConfig()Every custom registry implementation should define a default histogram expiry.protected TimeUnitgetBaseTimeUnit()The registry's base TimeUnit.protected CounternewCounter(Meter.Id id)Build a new counter to be added to the registry.protected DistributionSummarynewDistributionSummary(Meter.Id id, HistogramConfig histogramConfig)Build a new distribution summary to be added to the registry.protected <T> GaugenewGauge(Meter.Id id, T obj, ToDoubleFunction<T> valueFunction)Build a new gauge to be added to the registry.protected MeternewMeter(Meter.Id id, Meter.Type type, Iterable<Measurement> measurements)Build a new custom meter to be added to the registry.protected TimernewTimer(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:AbstractMeterRegistryBuild 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:
newGaugein 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:AbstractMeterRegistryBuild 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:
newCounterin 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:AbstractMeterRegistryBuild 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:
newTimerin 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:AbstractMeterRegistryBuild 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:
newDistributionSummaryin 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:AbstractMeterRegistryBuild 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:
newMeterin 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:AbstractMeterRegistryThe registry's base TimeUnit.- Specified by:
getBaseTimeUnitin classAbstractMeterRegistry- Returns:
- the non-null registry's base TimeUnit.
-
defaultHistogramConfig
protected HistogramConfig defaultHistogramConfig()
Description copied from class:AbstractMeterRegistryEvery custom registry implementation should define a default histogram expiry.histogramConfig.builder().histogramExpiry(defaultStep).build().merge(HistogramConfig.DEFAULT);
- Specified by:
defaultHistogramConfigin classAbstractMeterRegistry- Returns:
- the configuration for the histogram.
-
-