Package com.codahale.metrics.collectd
Class CollectdReporter
- java.lang.Object
-
- com.codahale.metrics.ScheduledReporter
-
- com.codahale.metrics.collectd.CollectdReporter
-
- All Implemented Interfaces:
Reporter
,Closeable
,AutoCloseable
public class CollectdReporter extends ScheduledReporter
A reporter which publishes metric values to a Collectd server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CollectdReporter.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CollectdReporter.Builder
forRegistry(MetricRegistry registry)
Returns a builder for the specified registry.void
report(SortedMap<String,Gauge> gauges, SortedMap<String,Counter> counters, SortedMap<String,Histogram> histograms, SortedMap<String,Meter> meters, SortedMap<String,Timer> timers)
Called periodically by the polling thread.void
start(long period, TimeUnit unit)
Starts the reporter polling at the given period.-
Methods inherited from class com.codahale.metrics.ScheduledReporter
close, convertDuration, convertRate, getDisabledMetricAttributes, getDurationUnit, getRateUnit, isShutdownExecutorOnStop, report, start, stop
-
-
-
-
Method Detail
-
forRegistry
public static CollectdReporter.Builder forRegistry(MetricRegistry registry)
Returns a builder for the specified registry.The default settings are:
- hostName: InetAddress.getLocalHost().getHostName()
- executor: default executor created by
ScheduledReporter
- shutdownExecutorOnStop: true
- clock: Clock.defaultClock()
- rateUnit: TimeUnit.SECONDS
- durationUnit: TimeUnit.MILLISECONDS
- filter: MetricFilter.ALL
- securityLevel: NONE
- username: ""
- password: ""
-
start
public void start(long period, TimeUnit unit)
Description copied from class:ScheduledReporter
Starts the reporter polling at the given period.- Overrides:
start
in classScheduledReporter
- Parameters:
period
- the amount of time between pollsunit
- the unit forperiod
-
report
public void report(SortedMap<String,Gauge> gauges, SortedMap<String,Counter> counters, SortedMap<String,Histogram> histograms, SortedMap<String,Meter> meters, SortedMap<String,Timer> timers)
Description copied from class:ScheduledReporter
Called periodically by the polling thread. Subclasses should report all the given metrics.- Specified by:
report
in classScheduledReporter
- Parameters:
gauges
- all of the gauges in the registrycounters
- all of the counters in the registryhistograms
- all of the histograms in the registrymeters
- all of the meters in the registrytimers
- all of the timers in the registry
-
-