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 Clock
private TimeUnit
private MetricFilter
private String
private TimeUnit
private final MetricRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds aGraphiteReporter
with the given properties, sending metrics using the givenGraphite
client.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 givenClock
instance for the time.
-
Field Details
-
registry
-
clock
-
prefix
-
rateUnit
-
durationUnit
-
filter
-
-
Constructor Details
-
Builder
-
-
Method Details
-
withClock
Use the givenClock
instance for the time.- Parameters:
clock
- aClock
instance- 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 aGraphiteReporter
with the given properties, sending metrics using the givenGraphite
client.- Parameters:
graphite
- aGraphite
client- Returns:
- a
GraphiteReporter
-