Package io.dropwizard.metrics5.graphite
Class GraphiteReporter
java.lang.Object
io.dropwizard.metrics5.ScheduledReporter
io.dropwizard.metrics5.graphite.GraphiteReporter
- All Implemented Interfaces:
io.dropwizard.metrics5.Reporter,Closeable,AutoCloseable
public class GraphiteReporter
extends io.dropwizard.metrics5.ScheduledReporter
A reporter which publishes metric values to a Graphite server.
- See Also:
- Graphite - Scalable Realtime Graphing
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGraphiteReporter.BuilderA builder forGraphiteReporterinstances. -
Constructor Summary
Constructors Modifier Constructor Description protectedGraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes)Creates a newGraphiteReporterinstance.protectedGraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags)Creates a newGraphiteReporterinstance.protectedGraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags, DoubleFunction<String> floatingPointFormatter)Creates a newGraphiteReporterinstance. -
Method Summary
Modifier and Type Method Description protected Stringformat(double v)static GraphiteReporter.BuilderforRegistry(io.dropwizard.metrics5.MetricRegistry registry)Returns a newGraphiteReporter.BuilderforGraphiteReporter.voidreport(SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Gauge<?>> gauges, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Counter> counters, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Histogram> histograms, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Meter> meters, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Timer> timers)voidstop()Methods inherited from class io.dropwizard.metrics5.ScheduledReporter
close, convertDuration, convertRate, getDisabledMetricAttributes, getDurationUnit, getRateUnit, isShutdownExecutorOnStop, report, start, start
-
Constructor Details
-
GraphiteReporter
protected GraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes)Creates a newGraphiteReporterinstance.- Parameters:
registry- theMetricRegistrycontaining the metrics this reporter will reportgraphite- theGraphiteSenderwhich is responsible for sending metrics to a Carbon server via a transport protocolclock- the instance of the time. UseClock.defaultClock()for the defaultprefix- the prefix of all metric names (may be null)rateUnit- the time unit of in which rates will be converteddurationUnit- the time unit of in which durations will be convertedfilter- the filter for which metrics to reportexecutor- 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 reporterdisabledMetricAttributes- do not report specific metric attributes
-
GraphiteReporter
protected GraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags)Creates a newGraphiteReporterinstance.- Parameters:
registry- theMetricRegistrycontaining the metrics this reporter will reportgraphite- theGraphiteSenderwhich is responsible for sending metrics to a Carbon server via a transport protocolclock- the instance of the time. UseClock.defaultClock()for the defaultprefix- the prefix of all metric names (may be null)rateUnit- the time unit of in which rates will be converteddurationUnit- the time unit of in which durations will be convertedfilter- the filter for which metrics to reportexecutor- 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 reporterdisabledMetricAttributes- do not report specific metric attributesaddMetricAttributesAsTags- if true, then add metric attributes as tags instead of suffixes
-
GraphiteReporter
protected GraphiteReporter(io.dropwizard.metrics5.MetricRegistry registry, GraphiteSender graphite, io.dropwizard.metrics5.Clock clock, String prefix, TimeUnit rateUnit, TimeUnit durationUnit, io.dropwizard.metrics5.MetricFilter filter, ScheduledExecutorService executor, boolean shutdownExecutorOnStop, Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes, boolean addMetricAttributesAsTags, DoubleFunction<String> floatingPointFormatter)Creates a newGraphiteReporterinstance.- Parameters:
registry- theMetricRegistrycontaining the metrics this reporter will reportgraphite- theGraphiteSenderwhich is responsible for sending metrics to a Carbon server via a transport protocolclock- the instance of the time. UseClock.defaultClock()for the defaultprefix- the prefix of all metric names (may be null)rateUnit- the time unit of in which rates will be converteddurationUnit- the time unit of in which durations will be convertedfilter- the filter for which metrics to reportexecutor- 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 reporterdisabledMetricAttributes- do not report specific metric attributesaddMetricAttributesAsTags- if true, then add metric attributes as tags instead of suffixesfloatingPointFormatter- custom floating point formatter
-
-
Method Details
-
forRegistry
Returns a newGraphiteReporter.BuilderforGraphiteReporter.- Parameters:
registry- the registry to report- Returns:
- a
GraphiteReporter.Builderinstance for aGraphiteReporter
-
report
public void report(SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Gauge<?>> gauges, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Counter> counters, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Histogram> histograms, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Meter> meters, SortedMap<io.dropwizard.metrics5.MetricName,io.dropwizard.metrics5.Timer> timers)- Specified by:
reportin classio.dropwizard.metrics5.ScheduledReporter
-
stop
public void stop()- Overrides:
stopin classio.dropwizard.metrics5.ScheduledReporter
-
format
-