public static class Slf4jReporter.Builder extends Object
Slf4jReporter
instances. Defaults to logging to metrics
, not
using a marker, converting rates to events/second, converting durations to milliseconds, and
not filtering metrics.Modifier and Type | Method and Description |
---|---|
Slf4jReporter |
build()
Builds a
Slf4jReporter with the given properties. |
Slf4jReporter.Builder |
convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.
|
Slf4jReporter.Builder |
convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.
|
Slf4jReporter.Builder |
filter(MetricFilter filter)
Only report metrics which match the given filter.
|
Slf4jReporter.Builder |
markWith(org.slf4j.Marker marker)
Mark all logged metrics with the given marker.
|
Slf4jReporter.Builder |
outputTo(org.slf4j.Logger logger)
Log metrics to the given logger.
|
Slf4jReporter.Builder |
prefixedWith(String prefix)
Prefix all metric names with the given string.
|
Slf4jReporter.Builder |
scheduleOn(ScheduledExecutorService executor)
Specifies the executor to use while scheduling reporting of metrics.
|
Slf4jReporter.Builder |
shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.
|
Slf4jReporter.Builder |
withLoggingLevel(Slf4jReporter.LoggingLevel loggingLevel)
Use Logging Level when reporting.
|
public Slf4jReporter.Builder shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
scheduleOn(ScheduledExecutorService)
.shutdownExecutorOnStop
- if true, then executor will be stopped in same time with this reporterthis
public Slf4jReporter.Builder scheduleOn(ScheduledExecutorService executor)
executor
- the executor to use while scheduling reporting of metrics.this
public Slf4jReporter.Builder outputTo(org.slf4j.Logger logger)
logger
- an SLF4J Logger
this
public Slf4jReporter.Builder markWith(org.slf4j.Marker marker)
marker
- an SLF4J Marker
this
public Slf4jReporter.Builder prefixedWith(String prefix)
prefix
- the prefix for all metric namesthis
public Slf4jReporter.Builder convertRatesTo(TimeUnit rateUnit)
rateUnit
- a unit of timethis
public Slf4jReporter.Builder convertDurationsTo(TimeUnit durationUnit)
durationUnit
- a unit of timethis
public Slf4jReporter.Builder filter(MetricFilter filter)
filter
- a MetricFilter
this
public Slf4jReporter.Builder withLoggingLevel(Slf4jReporter.LoggingLevel loggingLevel)
loggingLevel
- a (@link Slf4jReporter.LoggingLevel}this
public Slf4jReporter build()
Slf4jReporter
with the given properties.Slf4jReporter
Copyright © 2018. All Rights Reserved.