public static class Slf4jReporter.Builder
extends java.lang.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(java.util.concurrent.TimeUnit durationUnit)
Convert durations to the given time unit.
|
Slf4jReporter.Builder |
convertRatesTo(java.util.concurrent.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(Marker marker)
Mark all logged metrics with the given marker.
|
Slf4jReporter.Builder |
outputTo(Logger logger)
Log metrics to the given logger.
|
Slf4jReporter.Builder |
prefixedWith(java.lang.String prefix)
Prefix all metric names with the given string.
|
Slf4jReporter.Builder |
scheduleOn(java.util.concurrent.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(java.util.concurrent.ScheduledExecutorService executor)
executor
- the executor to use while scheduling reporting of metrics.this
public Slf4jReporter.Builder outputTo(Logger logger)
logger
- an SLF4J Logger
this
public Slf4jReporter.Builder markWith(Marker marker)
marker
- an SLF4J Marker
this
public Slf4jReporter.Builder prefixedWith(java.lang.String prefix)
prefix
- the prefix for all metric namesthis
public Slf4jReporter.Builder convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
rateUnit
- a unit of timethis
public Slf4jReporter.Builder convertDurationsTo(java.util.concurrent.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 © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"