-
public final class CodahaleSlf4jReporter.BuilderA builder for Slf4jReporter instances. Defaults to logging to
metrics, not using a marker, converting rates to events/second, converting durations to milliseconds, and not filtering metrics.
-
-
Constructor Summary
Constructors Constructor Description CodahaleSlf4jReporter.Builder(MetricRegistry registry)
-
Method Summary
Modifier and Type Method Description final CodahaleSlf4jReporter.BuildershutdownExecutorOnStop(Boolean shutdownExecutorOnStop)Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter. final CodahaleSlf4jReporter.BuilderscheduleOn(ScheduledExecutorService executor)Specifies the executor to use while scheduling reporting of metrics. final CodahaleSlf4jReporter.BuilderoutputTo(Logger logger)Log metrics to the given logger. final CodahaleSlf4jReporter.BuildermarkWith(Marker marker)Mark all logged metrics with the given marker. final CodahaleSlf4jReporter.BuilderprefixedWith(String prefix)Prefix all metric names with the given string. final CodahaleSlf4jReporter.BuilderconvertRatesTo(TimeUnit rateUnit)Convert rates to the given time unit. final CodahaleSlf4jReporter.BuilderconvertDurationsTo(TimeUnit durationUnit)Convert durations to the given time unit. final CodahaleSlf4jReporter.Builderfilter(MetricFilter filter)Only report metrics which match the given filter. final CodahaleSlf4jReporter.BuilderwithLoggingLevel(CodahaleSlf4jReporter.LoggingLevel loggingLevel)Use Logging Level when reporting. final CodahaleSlf4jReporter.BuilderdisabledMetricAttributes(Set<MetricAttribute> disabledMetricAttributes)Don't report the passed metric attributes for all metrics (e.g. final CodahaleSlf4jReporterbuild()Builds a Slf4jReporter with the given properties. -
-
Method Detail
-
shutdownExecutorOnStop
final CodahaleSlf4jReporter.Builder shutdownExecutorOnStop(Boolean shutdownExecutorOnStop)
Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter. Default value is true. Setting this parameter to false, has the sense in combining with providing external managed executor via .scheduleOn.
- Parameters:
shutdownExecutorOnStop- if true, then executor will be stopped in same time with this reporter
-
scheduleOn
final CodahaleSlf4jReporter.Builder scheduleOn(ScheduledExecutorService executor)
Specifies the executor to use while scheduling reporting of metrics. Default value is null. Null value leads to executor will be auto created on start.
- Parameters:
executor- the executor to use while scheduling reporting of metrics.
-
outputTo
final CodahaleSlf4jReporter.Builder outputTo(Logger logger)
Log metrics to the given logger.
- Parameters:
logger- an SLF4J Logger
-
markWith
final CodahaleSlf4jReporter.Builder markWith(Marker marker)
Mark all logged metrics with the given marker.
- Parameters:
marker- an SLF4J Marker
-
prefixedWith
final CodahaleSlf4jReporter.Builder prefixedWith(String prefix)
Prefix all metric names with the given string.
- Parameters:
prefix- the prefix for all metric names
-
convertRatesTo
final CodahaleSlf4jReporter.Builder convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.
- Parameters:
rateUnit- a unit of time
-
convertDurationsTo
final CodahaleSlf4jReporter.Builder convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.
- Parameters:
durationUnit- a unit of time
-
filter
final CodahaleSlf4jReporter.Builder filter(MetricFilter filter)
Only report metrics which match the given filter.
- Parameters:
filter- a MetricFilter
-
withLoggingLevel
final CodahaleSlf4jReporter.Builder withLoggingLevel(CodahaleSlf4jReporter.LoggingLevel loggingLevel)
Use Logging Level when reporting.
- Parameters:
loggingLevel- a (@link Slf4jReporter.
-
disabledMetricAttributes
final CodahaleSlf4jReporter.Builder disabledMetricAttributes(Set<MetricAttribute> disabledMetricAttributes)
Don't report the passed metric attributes for all metrics (e.g. "p999", "stddev" or "m15"). See MetricAttribute.
- Parameters:
disabledMetricAttributes- a set of MetricAttribute
-
build
final CodahaleSlf4jReporter build()
Builds a Slf4jReporter with the given properties.
-
-
-
-