Package com.codahale.metrics
Class CsvReporter
java.lang.Object
com.codahale.metrics.ScheduledReporter
com.codahale.metrics.CsvReporter
- All Implemented Interfaces:
Closeable,AutoCloseable
A reporter which creates a comma-separated values file of the measurements for each metric.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCsvReporter(MetricRegistry registry, File directory, Locale locale, TimeUnit rateUnit, TimeUnit durationUnit, Clock clock, MetricFilter filter) -
Method Summary
Modifier and TypeMethodDescriptionstatic CsvReporter.BuilderforRegistry(MetricRegistry registry) Returns a newCsvReporter.BuilderforCsvReporter.private voidvoidreport(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.private voidreportCounter(long timestamp, String name, Counter counter) private voidreportGauge(long timestamp, String name, Gauge gauge) private voidreportHistogram(long timestamp, String name, Histogram histogram) private voidreportMeter(long timestamp, String name, Meter meter) private voidreportTimer(long timestamp, String name, Timer timer) protected StringMethods inherited from class com.codahale.metrics.ScheduledReporter
close, convertDuration, convertRate, getDurationUnit, getRateUnit, report, start, stop
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
UTF_8
-
directory
-
locale
-
clock
-
-
Constructor Details
-
CsvReporter
private CsvReporter(MetricRegistry registry, File directory, Locale locale, TimeUnit rateUnit, TimeUnit durationUnit, Clock clock, MetricFilter filter)
-
-
Method Details
-
forRegistry
Returns a newCsvReporter.BuilderforCsvReporter.- Parameters:
registry- the registry to report- Returns:
- a
CsvReporter.Builderinstance for aCsvReporter
-
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:ScheduledReporterCalled periodically by the polling thread. Subclasses should report all the given metrics.- Specified by:
reportin 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
-
reportTimer
-
reportMeter
-
reportHistogram
-
reportCounter
-
reportGauge
-
report
-
sanitize
-