Class GraphiteReporter

java.lang.Object
com.codahale.metrics.ScheduledReporter
com.codahale.metrics.graphite.GraphiteReporter
All Implemented Interfaces:
com.codahale.metrics.Reporter, Closeable, AutoCloseable

public class GraphiteReporter extends com.codahale.metrics.ScheduledReporter
A reporter which publishes metric values to a Graphite server.
See Also:
  • Constructor Details

    • GraphiteReporter

      protected GraphiteReporter(com.codahale.metrics.MetricRegistry registry, GraphiteSender graphite, com.codahale.metrics.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, com.codahale.metrics.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<com.codahale.metrics.MetricAttribute> disabledMetricAttributes)
      Creates a new GraphiteReporter instance.
      Parameters:
      registry - the MetricRegistry containing the metrics this reporter will report
      graphite - the GraphiteSender which is responsible for sending metrics to a Carbon server via a transport protocol
      clock - the instance of the time. Use Clock.defaultClock() for the default
      prefix - the prefix of all metric names (may be null)
      rateUnit - the time unit of in which rates will be converted
      durationUnit - the time unit of in which durations will be converted
      filter - the filter for which metrics to report
      executor - the executor to use while scheduling reporting of metrics (may be null).
      shutdownExecutorOnStop - if true, then executor will be stopped in same time with this reporter
      disabledMetricAttributes - do not report specific metric attributes
    • GraphiteReporter

      protected GraphiteReporter(com.codahale.metrics.MetricRegistry registry, GraphiteSender graphite, com.codahale.metrics.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, com.codahale.metrics.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<com.codahale.metrics.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags)
      Creates a new GraphiteReporter instance.
      Parameters:
      registry - the MetricRegistry containing the metrics this reporter will report
      graphite - the GraphiteSender which is responsible for sending metrics to a Carbon server via a transport protocol
      clock - the instance of the time. Use Clock.defaultClock() for the default
      prefix - the prefix of all metric names (may be null)
      rateUnit - the time unit of in which rates will be converted
      durationUnit - the time unit of in which durations will be converted
      filter - the filter for which metrics to report
      executor - the executor to use while scheduling reporting of metrics (may be null).
      shutdownExecutorOnStop - if true, then executor will be stopped in same time with this reporter
      disabledMetricAttributes - do not report specific metric attributes
      addMetricAttributesAsTags - if true, then add metric attributes as tags instead of suffixes
    • GraphiteReporter

      protected GraphiteReporter(com.codahale.metrics.MetricRegistry registry, GraphiteSender graphite, com.codahale.metrics.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, com.codahale.metrics.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<com.codahale.metrics.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags, DoubleFunction<String> floatingPointFormatter)
      Creates a new GraphiteReporter instance.
      Parameters:
      registry - the MetricRegistry containing the metrics this reporter will report
      graphite - the GraphiteSender which is responsible for sending metrics to a Carbon server via a transport protocol
      clock - the instance of the time. Use Clock.defaultClock() for the default
      prefix - the prefix of all metric names (may be null)
      rateUnit - the time unit of in which rates will be converted
      durationUnit - the time unit of in which durations will be converted
      filter - the filter for which metrics to report
      executor - the executor to use while scheduling reporting of metrics (may be null).
      shutdownExecutorOnStop - if true, then executor will be stopped in same time with this reporter
      disabledMetricAttributes - do not report specific metric attributes
      addMetricAttributesAsTags - if true, then add metric attributes as tags instead of suffixes
      floatingPointFormatter - custom floating point formatter
  • Method Details