Package fr.gouv.vitam.common.metrics
Class LogbackReporter.Builder
- java.lang.Object
-
- fr.gouv.vitam.common.metrics.LogbackReporter.Builder
-
- Enclosing class:
- LogbackReporter
public static class LogbackReporter.Builder extends java.lang.Object
A builder forConsoleReporter
instances. Defaults to using the default locale and time zone, writing toSystem.out
, converting rates to events/second, converting durations to milliseconds, and not filtering metrics.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogbackReporter
build()
Builds aConsoleReporter
with the given properties.LogbackReporter.Builder
convertDurationsTo(java.util.concurrent.TimeUnit durationUnit)
Convert durations to the given time unit.LogbackReporter.Builder
convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
Convert rates to the given time unit.LogbackReporter.Builder
filter(com.codahale.metrics.MetricFilter filter)
Only report metrics which match the given filter.LogbackReporter.Builder
formattedFor(java.util.Locale locale)
Format numbers for the givenLocale
.LogbackReporter.Builder
formattedFor(java.util.TimeZone timeZone)
Use the givenTimeZone
for the time.LogbackReporter.Builder
logLevel(VitamLogLevel logLevel)
Set the LogBack log levelLogbackReporter.Builder
withClock(com.codahale.metrics.Clock clock)
Use the givenClock
instance for the time.
-
-
-
Method Detail
-
formattedFor
public LogbackReporter.Builder formattedFor(java.util.Locale locale)
Format numbers for the givenLocale
.- Parameters:
locale
- aLocale
- Returns:
this
-
withClock
public LogbackReporter.Builder withClock(com.codahale.metrics.Clock clock)
Use the givenClock
instance for the time.- Parameters:
clock
- aClock
instance- Returns:
this
-
formattedFor
public LogbackReporter.Builder formattedFor(java.util.TimeZone timeZone)
Use the givenTimeZone
for the time.- Parameters:
timeZone
- aTimeZone
- Returns:
this
-
convertRatesTo
public LogbackReporter.Builder convertRatesTo(java.util.concurrent.TimeUnit rateUnit)
Convert rates to the given time unit.- Parameters:
rateUnit
- a unit of time- Returns:
this
-
convertDurationsTo
public LogbackReporter.Builder convertDurationsTo(java.util.concurrent.TimeUnit durationUnit)
Convert durations to the given time unit.- Parameters:
durationUnit
- a unit of time- Returns:
this
-
filter
public LogbackReporter.Builder filter(com.codahale.metrics.MetricFilter filter)
Only report metrics which match the given filter.- Parameters:
filter
- aMetricFilter
- Returns:
this
-
logLevel
public LogbackReporter.Builder logLevel(VitamLogLevel logLevel)
Set the LogBack log level- Parameters:
logLevel
-VitamLogLevel
- Returns:
this
-
build
public LogbackReporter build()
Builds aConsoleReporter
with the given properties.- Returns:
- a
ConsoleReporter
-
-