Package io.dropwizard.metrics5
Class CsvReporter.Builder
- java.lang.Object
-
- io.dropwizard.metrics5.CsvReporter.Builder
-
- Enclosing class:
- CsvReporter
public static class CsvReporter.Builder extends Object
A builder forCsvReporterinstances. Defaults to using the default locale, 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 CsvReporterbuild(File directory)Builds aCsvReporterwith the given properties, writing.csvfiles to the given directory.CsvReporter.BuilderconvertDurationsTo(TimeUnit durationUnit)Convert durations to the given time unit.CsvReporter.BuilderconvertRatesTo(TimeUnit rateUnit)Convert rates to the given time unit.CsvReporter.Builderfilter(MetricFilter filter)Only report metrics which match the given filter.CsvReporter.BuilderformatFor(Locale locale)Format numbers for the givenLocale.CsvReporter.BuilderscheduleOn(ScheduledExecutorService executor)Specifies the executor to use while scheduling reporting of metrics.CsvReporter.BuildershutdownExecutorOnStop(boolean shutdownExecutorOnStop)Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.CsvReporter.BuilderwithClock(Clock clock)Use the givenClockinstance for the time.CsvReporter.BuilderwithCsvFileProvider(CsvFileProvider csvFileProvider)CsvReporter.BuilderwithSeparator(String separator)Use the given string to use as the separator for values.
-
-
-
Method Detail
-
shutdownExecutorOnStop
public CsvReporter.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 viascheduleOn(ScheduledExecutorService).- Parameters:
shutdownExecutorOnStop- if true, then executor will be stopped in same time with this reporter- Returns:
this
-
scheduleOn
public CsvReporter.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.- Returns:
this
-
formatFor
public CsvReporter.Builder formatFor(Locale locale)
Format numbers for the givenLocale.- Parameters:
locale- aLocale- Returns:
this
-
convertRatesTo
public CsvReporter.Builder convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.- Parameters:
rateUnit- a unit of time- Returns:
this
-
convertDurationsTo
public CsvReporter.Builder convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.- Parameters:
durationUnit- a unit of time- Returns:
this
-
withSeparator
public CsvReporter.Builder withSeparator(String separator)
Use the given string to use as the separator for values.- Parameters:
separator- the string to use for the separator.- Returns:
this
-
withClock
public CsvReporter.Builder withClock(Clock clock)
Use the givenClockinstance for the time.- Parameters:
clock- aClockinstance- Returns:
this
-
filter
public CsvReporter.Builder filter(MetricFilter filter)
Only report metrics which match the given filter.- Parameters:
filter- aMetricFilter- Returns:
this
-
withCsvFileProvider
public CsvReporter.Builder withCsvFileProvider(CsvFileProvider csvFileProvider)
-
build
public CsvReporter build(File directory)
Builds aCsvReporterwith the given properties, writing.csvfiles to the given directory.- Parameters:
directory- the directory in which the.csvfiles will be created- Returns:
- a
CsvReporter
-
-