Package io.dropwizard.metrics5.influxdb
Class InfluxDbReporter.Builder
- java.lang.Object
-
- io.dropwizard.metrics5.influxdb.InfluxDbReporter.Builder
-
- Enclosing class:
- InfluxDbReporter
public static class InfluxDbReporter.Builder extends Object
A builder forInfluxDbReporterinstances. Defaults to not using a prefix, using the default clock, 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 InfluxDbReporterbuild(InfluxDbSender sender)Builds a InfluxDbReporter with the given properties, sending metrics using the given InfluxDbSender.InfluxDbReporter.BuilderconvertDurationsTo(TimeUnit durationUnit)Convert durations to the given time unit.InfluxDbReporter.BuilderconvertRatesTo(TimeUnit rateUnit)Convert rates to the given time unit.InfluxDbReporter.BuilderdisabledMetricAttributes(Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes)Don't report the passed metric attributes for all metrics (e.g.InfluxDbReporter.Builderfilter(io.dropwizard.metrics5.MetricFilter filter)Only report metrics which match the given filter.InfluxDbReporter.BuilderprefixedWith(io.dropwizard.metrics5.MetricName prefix)Prefix all metric names with the given name.InfluxDbReporter.BuilderscheduleOn(ScheduledExecutorService executor)Specifies the executor to use while scheduling reporting of metrics.InfluxDbReporter.BuildershutdownExecutorOnStop(boolean shutdownExecutorOnStop)Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.InfluxDbReporter.BuilderwithClock(io.dropwizard.metrics5.Clock clock)Use the givenClockinstance for the time.
-
-
-
Method Detail
-
shutdownExecutorOnStop
public InfluxDbReporter.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 InfluxDbReporter.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
-
withClock
public InfluxDbReporter.Builder withClock(io.dropwizard.metrics5.Clock clock)
Use the givenClockinstance for the time.- Parameters:
clock- aClockinstance- Returns:
this
-
prefixedWith
public InfluxDbReporter.Builder prefixedWith(io.dropwizard.metrics5.MetricName prefix)
Prefix all metric names with the given name.- Parameters:
prefix- the prefix for all metric names- Returns:
this
-
convertRatesTo
public InfluxDbReporter.Builder convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.- Parameters:
rateUnit- a unit of time- Returns:
this
-
convertDurationsTo
public InfluxDbReporter.Builder convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.- Parameters:
durationUnit- a unit of time- Returns:
this
-
filter
public InfluxDbReporter.Builder filter(io.dropwizard.metrics5.MetricFilter filter)
Only report metrics which match the given filter.- Parameters:
filter- aMetricFilter- Returns:
this
-
disabledMetricAttributes
public InfluxDbReporter.Builder disabledMetricAttributes(Set<io.dropwizard.metrics5.MetricAttribute> disabledMetricAttributes)
Don't report the passed metric attributes for all metrics (e.g. "p999", "stddev" or "m15").- Parameters:
disabledMetricAttributes- the disabled metric attributes- Returns:
this
-
build
public InfluxDbReporter build(InfluxDbSender sender)
Builds a InfluxDbReporter with the given properties, sending metrics using the given InfluxDbSender.- Parameters:
sender- the InfluxDbSender- Returns:
- the InfluxDbReporter
-
-