Package com.codahale.metrics
Class Slf4jReporter.Builder
java.lang.Object
com.codahale.metrics.Slf4jReporter.Builder
- Enclosing class:
Slf4jReporter
A builder for
CsvReporter
instances. Defaults to logging to metrics
, not
using a marker, converting rates to events/second, converting durations to milliseconds, and
not filtering metrics.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TimeUnit
private MetricFilter
private org.slf4j.Logger
private org.slf4j.Marker
private TimeUnit
private final MetricRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aSlf4jReporter
with the given properties.convertDurationsTo
(TimeUnit durationUnit) Convert durations to the given time unit.convertRatesTo
(TimeUnit rateUnit) Convert rates to the given time unit.filter
(MetricFilter filter) Only report metrics which match the given filter.markWith
(org.slf4j.Marker marker) Mark all logged metrics with the given marker.outputTo
(org.slf4j.Logger logger) Log metrics to the given logger.
-
Field Details
-
registry
-
logger
private org.slf4j.Logger logger -
marker
private org.slf4j.Marker marker -
rateUnit
-
durationUnit
-
filter
-
-
Constructor Details
-
Builder
-
-
Method Details
-
outputTo
Log metrics to the given logger.- Parameters:
logger
- an SLF4JLogger
- Returns:
this
-
markWith
Mark all logged metrics with the given marker.- Parameters:
marker
- an SLF4JMarker
- Returns:
this
-
convertRatesTo
Convert rates to the given time unit.- Parameters:
rateUnit
- a unit of time- Returns:
this
-
convertDurationsTo
Convert durations to the given time unit.- Parameters:
durationUnit
- a unit of time- Returns:
this
-
filter
Only report metrics which match the given filter.- Parameters:
filter
- aMetricFilter
- Returns:
this
-
build
Builds aSlf4jReporter
with the given properties.- Returns:
- a
Slf4jReporter
-