Class LoggingMeterRegistry


@Incubating(since="1.1.0") public class LoggingMeterRegistry extends StepMeterRegistry
Logging MeterRegistry.
Since:
1.1.0
  • Constructor Details

    • LoggingMeterRegistry

      public LoggingMeterRegistry()
    • LoggingMeterRegistry

      public LoggingMeterRegistry(LoggingRegistryConfig config, Clock clock)
      Constructor allowing a custom clock and configuration.
      Parameters:
      config - the LoggingRegistryConfig
      clock - the Clock
    • LoggingMeterRegistry

      public LoggingMeterRegistry(Consumer<String> loggingSink)
      Constructor allowing custom sink instead of a default log::info.
      Parameters:
      loggingSink - the custom sink that will be called for each time series.
      Since:
      1.11.0
    • LoggingMeterRegistry

      public LoggingMeterRegistry(LoggingRegistryConfig config, Clock clock, Consumer<String> loggingSink)
      Constructor allowing a custom sink, clock and configuration.
      Parameters:
      config - the LoggingRegistryConfig
      clock - the Clock
      loggingSink - the custom sink that will be called for each time series.
      Since:
      1.11.0
  • Method Details

    • publish

      protected void publish()
      Specified by:
      publish in class PushMeterRegistry
    • newTimer

      protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector)
      Description copied from class: MeterRegistry
      Build a new timer to be added to the registry. This is guaranteed to only be called if the timer doesn't already exist.
      Overrides:
      newTimer in class StepMeterRegistry
      Parameters:
      id - The id that uniquely identifies the timer.
      distributionStatisticConfig - Configuration for published distribution statistics.
      pauseDetector - The pause detector to use for coordinated omission compensation.
      Returns:
      A new timer.
    • newDistributionSummary

      protected DistributionSummary newDistributionSummary(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale)
      Description copied from class: MeterRegistry
      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.
      Overrides:
      newDistributionSummary in class StepMeterRegistry
      Parameters:
      id - The id that uniquely identifies the distribution summary.
      distributionStatisticConfig - Configuration for published distribution statistics.
      scale - Multiply every recorded sample by this factor.
      Returns:
      A new distribution summary.
    • getBaseTimeUnit

      protected TimeUnit getBaseTimeUnit()
      Specified by:
      getBaseTimeUnit in class MeterRegistry
      Returns:
      the registry's base TimeUnit. Must not be null.
    • builder

      public static LoggingMeterRegistry.Builder builder(LoggingRegistryConfig config)