Package io.dropwizard.metrics5
Class CsvReporter.Builder
java.lang.Object
io.dropwizard.metrics5.CsvReporter.Builder
- Enclosing class:
- CsvReporter
A builder for
CsvReporter
instances. Defaults to using the default locale, converting
rates to events/second, converting durations to milliseconds, and not filtering metrics.-
Method Summary
Modifier and TypeMethodDescriptionBuilds aCsvReporter
with the given properties, writing.csv
files to the given directory.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.Format numbers for the givenLocale
.scheduleOn
(ScheduledExecutorService executor) Specifies the executor to use while scheduling reporting of metrics.shutdownExecutorOnStop
(boolean shutdownExecutorOnStop) Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.Use the givenClock
instance for the time.withCsvFileProvider
(CsvFileProvider csvFileProvider) withSeparator
(String separator) Use the given string to use as the separator for values.
-
Method Details
-
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 viascheduleOn(ScheduledExecutorService)
.- Parameters:
shutdownExecutorOnStop
- if true, then executor will be stopped in same time with this reporter- Returns:
this
-
scheduleOn
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.- Returns:
this
-
formatFor
Format numbers for the givenLocale
.- Parameters:
locale
- aLocale
- 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
-
withSeparator
Use the given string to use as the separator for values.- Parameters:
separator
- the string to use for the separator.- Returns:
this
-
withClock
Use the givenClock
instance for the time.- Parameters:
clock
- aClock
instance- Returns:
this
-
filter
Only report metrics which match the given filter.- Parameters:
filter
- aMetricFilter
- Returns:
this
-
withCsvFileProvider
-
build
Builds aCsvReporter
with the given properties, writing.csv
files to the given directory.- Parameters:
directory
- the directory in which the.csv
files will be created- Returns:
- a
CsvReporter
-