Class DropwizardMeterRegistry
java.lang.Object
org.forgerock.monitoring.dropwizard.AbstractMeterRegistry
org.forgerock.monitoring.dropwizard.DropwizardMeterRegistry
- All Implemented Interfaces:
MeterRegistry
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.ConfigImplNested classes/interfaces inherited from interface org.forgerock.monitoring.api.instrument.MeterRegistry
MeterRegistry.Config, MeterRegistry.More -
Constructor Summary
ConstructorsConstructorDescriptionDropwizardMeterRegistry(Clock clock) Constructor for this class.DropwizardMeterRegistry(Clock clock, Supplier<com.codahale.metrics.Reservoir> newReservoirSupplier) Constructor for this class. -
Method Summary
Modifier and TypeMethodDescriptionprotected HistogramConfigEvery custom registry implementation should define a default histogram expiry.protected TimeUnitThe 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> FunctionCounternewFunctionCounter(Meter.Id id, T obj, ToDoubleFunction<T> f) Build a new function counter 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, functionCounter, gauge, getMeters, more, newTimeGauge, register, summary, timerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.forgerock.monitoring.api.instrument.MeterRegistry
find, forEachMeter, get
-
Constructor Details
-
DropwizardMeterRegistry
Constructor for this class.- Parameters:
clock- the clock
-
DropwizardMeterRegistry
public DropwizardMeterRegistry(Clock clock, Supplier<com.codahale.metrics.Reservoir> newReservoirSupplier) Constructor for this class.- Parameters:
clock- the clocknewReservoirSupplier- supplies a new reservoir
-
-
Method Details
-
newGauge
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
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.
-
newFunctionCounter
Description copied from class:AbstractMeterRegistryBuild a new function counter to be added to the registry. This is guaranteed to only be called if the function counter doesn't already exist.- Specified by:
newFunctionCounterin classAbstractMeterRegistry- Type Parameters:
T- The type of the object upon which the value function derives a measurement.- Parameters:
id- The id that uniquely identifies the function counter.obj- The state object from which the count function derives a measurement.f- A monotonically increasing count function.- Returns:
- A new function counter.
-
newTimer
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
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
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
Description copied from class:AbstractMeterRegistryThe registry's base TimeUnit.- Specified by:
getBaseTimeUnitin classAbstractMeterRegistry- Returns:
- the non-null registry's base TimeUnit.
-
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.
-