Package com.codahale.metrics.riemann
Class RiemannReporter.Builder
java.lang.Object
com.codahale.metrics.riemann.RiemannReporter.Builder
- Enclosing class:
- RiemannReporter
A builder for
RiemannReporter instances. 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
Modifier and TypeMethodDescriptionBuilds aRiemannReporterwith the given properties, sending metrics using the givenRiemannclient.convertDurationsTo(TimeUnit durationUnit) Convert durations to the given time unit.convertRatesTo(TimeUnit rateUnit) Convert rates to the given time unit.filter(com.codahale.metrics.MetricFilter filter) Only report metrics which match the given filter.Event source hostprefixedWith(String prefix) Prefix all metric names with the given string.tags(Collection<String> tags) Tags to attach to events.useSeparator(String separator) Separator between metric name componentswithClock(com.codahale.metrics.Clock clock) Use the givenClockinstance for the time.Default time to live of Riemann event.withValueFilterMap(ValueFilterMap valueFilterMap) ValueFilterMap to determine states reported with measures.
-
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
-
withTtl
Default time to live of Riemann event.- Parameters:
ttl- aFloat- Returns:
this
-
useSeparator
Separator between metric name components- Parameters:
separator- aString- Returns:
this
-
localHost
Event source host- Parameters:
localHost- aString- Returns:
this
-
tags
Tags to attach to events.- Parameters:
tags- aCollection<String>- Returns:
this
-
withValueFilterMap
ValueFilterMap to determine states reported with measures. Defaults to an empty map which causes "ok" to be the reported state for all measures.- Parameters:
valueFilterMap-ValueFilterMapwith keys equal to measures (e.g. "mean"). Values are lists ofValueFilters that determine the reported state- Returns:
this
-
build
Builds aRiemannReporterwith the given properties, sending metrics using the givenRiemannclient.- Parameters:
riemann- aRiemannclient.- Returns:
- a
RiemannReporter
-