Package io.dropwizard.metrics5
Class Slf4jReporter
java.lang.Object
io.dropwizard.metrics5.ScheduledReporter
io.dropwizard.metrics5.Slf4jReporter
- All Implemented Interfaces:
Reporter,Closeable,AutoCloseable
A reporter class for logging metrics values to a SLF4J
Logger periodically, similar to
ConsoleReporter or CsvReporter, but using the SLF4J framework instead. It also
supports specifying a Marker instance that can be used by custom appenders and filters
for the bound logging toolkit to further process metrics reports.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Slf4jReporter.BuilderforRegistry(MetricRegistry registry) Returns a newSlf4jReporter.BuilderforSlf4jReporter.voidreport(SortedMap<MetricName, Gauge<?>> gauges, SortedMap<MetricName, Counter> counters, SortedMap<MetricName, Histogram> histograms, SortedMap<MetricName, Meter> meters, SortedMap<MetricName, Timer> timers) Called periodically by the polling thread.Methods inherited from class io.dropwizard.metrics5.ScheduledReporter
close, convertDuration, convertRate, getDisabledMetricAttributes, getDurationUnit, getScheduledFuture, getScheduledFuture, isShutdownExecutorOnStop, report, start, start, stop
-
Method Details
-
forRegistry
Returns a newSlf4jReporter.BuilderforSlf4jReporter.- Parameters:
registry- the registry to report- Returns:
- a
Slf4jReporter.Builderinstance for aSlf4jReporter
-
report
public void report(SortedMap<MetricName, Gauge<?>> gauges, SortedMap<MetricName, Counter> counters, SortedMap<MetricName, Histogram> histograms, SortedMap<MetricName, Meter> meters, SortedMap<MetricName, 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
-
getRateUnit
- Overrides:
getRateUnitin classScheduledReporter
-