Class CodahaleMetricsProvider

java.lang.Object
org.apache.bookkeeper.stats.codahale.CodahaleMetricsProvider
All Implemented Interfaces:
StatsProvider
Direct Known Subclasses:
FastCodahaleMetricsProvider

public class CodahaleMetricsProvider extends Object implements StatsProvider
A StatsProvider implemented based on Codahale metrics library.
  • Field Details

    • LOG

      static final org.slf4j.Logger LOG
    • metrics

      com.codahale.metrics.MetricRegistry metrics
    • reporters

      List<com.codahale.metrics.ScheduledReporter> reporters
    • jmx

      com.codahale.metrics.jmx.JmxReporter jmx
  • Constructor Details

    • CodahaleMetricsProvider

      public CodahaleMetricsProvider()
  • Method Details

    • initIfNecessary

      void initIfNecessary()
    • getMetrics

      public com.codahale.metrics.MetricRegistry getMetrics()
    • start

      public void start(org.apache.commons.configuration2.Configuration conf)
      Description copied from interface: StatsProvider
      Initialize the stats provider by loading the given configuration conf.
      Specified by:
      start in interface StatsProvider
      Parameters:
      conf - Configuration to configure the stats provider.
    • stop

      public void stop()
      Description copied from interface: StatsProvider
      Close the stats provider.
      Specified by:
      stop in interface StatsProvider
    • getStatsLogger

      public StatsLogger getStatsLogger(String name)
      Description copied from interface: StatsProvider
      Return the stats logger to a given scope.
      Specified by:
      getStatsLogger in interface StatsProvider
      Parameters:
      name - Scope for the given stats
      Returns:
      stats logger for the given scope
    • getStatsName

      public String getStatsName(String... statsComponents)
      Description copied from interface: StatsProvider
      Return the fully qualified stats name comprised of given statsComponents.
      Specified by:
      getStatsName in interface StatsProvider
      Parameters:
      statsComponents - stats components to comprise the fully qualified stats name
      Returns:
      the fully qualified stats name