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.
  • Constructor Details

    • DropwizardMeterRegistry

      public DropwizardMeterRegistry(Clock clock)
      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 clock
      newReservoirSupplier - supplies a new reservoir
  • Method Details

    • 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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      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 class AbstractMeterRegistry
      Returns:
      the configuration for the histogram.