Package com.codahale.metrics.graphite
Class GraphiteReporter.Builder
java.lang.Object
com.codahale.metrics.graphite.GraphiteReporter.Builder
- Enclosing class:
GraphiteReporter
A builder for
GraphiteReporter instances. Defaults to not using a prefix, using the
default clock, converting rates to events/second, converting durations to milliseconds, and
not filtering metrics.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Clockprivate TimeUnitprivate MetricFilterprivate Stringprivate TimeUnitprivate final MetricRegistry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds aGraphiteReporterwith the given properties, sending metrics using the givenGraphiteclient.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.prefixedWith(String prefix) Prefix all metric names with the given string.Use the givenClockinstance for the time.
-
Field Details
-
registry
-
clock
-
prefix
-
rateUnit
-
durationUnit
-
filter
-
-
Constructor Details
-
Builder
-
-
Method Details
-
withClock
Use the givenClockinstance for the time.- Parameters:
clock- aClockinstance- Returns:
this
-
prefixedWith
Prefix all metric names with the given string.- Parameters:
prefix- the prefix for all metric names- 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 aGraphiteReporterwith the given properties, sending metrics using the givenGraphiteclient.- Parameters:
graphite- aGraphiteclient- Returns:
- a
GraphiteReporter
-