Package com.codahale.metrics
Class ConsoleReporter.Builder
java.lang.Object
com.codahale.metrics.ConsoleReporter.Builder
- Enclosing class:
ConsoleReporter
A builder for
ConsoleReporter
instances. Defaults to using the default locale and
time zone, writing to System.out
, converting rates to events/second, converting
durations to milliseconds, and not filtering metrics.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Clock
private TimeUnit
private MetricFilter
private Locale
private PrintStream
private TimeUnit
private final MetricRegistry
private TimeZone
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aConsoleReporter
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.formattedFor
(Locale locale) Format numbers for the givenLocale
.formattedFor
(TimeZone timeZone) Use the givenTimeZone
for the time.outputTo
(PrintStream output) Write to the givenPrintStream
.Use the givenClock
instance for the time.
-
Field Details
-
registry
-
output
-
locale
-
clock
-
timeZone
-
rateUnit
-
durationUnit
-
filter
-
-
Constructor Details
-
Builder
-
-
Method Details
-
outputTo
Write to the givenPrintStream
.- Parameters:
output
- aPrintStream
instance.- Returns:
this
-
formattedFor
Format numbers for the givenLocale
.- Parameters:
locale
- aLocale
- Returns:
this
-
withClock
Use the givenClock
instance for the time.- Parameters:
clock
- aClock
instance- Returns:
this
-
formattedFor
Use the givenTimeZone
for the time.- Parameters:
timeZone
- aTimeZone
- 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 aConsoleReporter
with the given properties.- Returns:
- a
ConsoleReporter
-