public static class GraphiteReporter.Builder extends Object
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.Modifier and Type | Method and Description |
---|---|
GraphiteReporter.Builder |
addMetricAttributesAsTags(boolean addMetricAttributesAsTags)
Specifies whether or not metric attributes (e.g.
|
GraphiteReporter |
build(Graphite graphite)
Builds a
GraphiteReporter with the given properties, sending metrics using the
given GraphiteSender . |
GraphiteReporter |
build(GraphiteSender graphite)
Builds a
GraphiteReporter with the given properties, sending metrics using the
given GraphiteSender . |
GraphiteReporter.Builder |
convertDurationsTo(TimeUnit durationUnit)
Convert durations to the given time unit.
|
GraphiteReporter.Builder |
convertRatesTo(TimeUnit rateUnit)
Convert rates to the given time unit.
|
GraphiteReporter.Builder |
disabledMetricAttributes(Set<com.codahale.metrics.MetricAttribute> disabledMetricAttributes)
Don't report the passed metric attributes for all metrics (e.g.
|
GraphiteReporter.Builder |
filter(com.codahale.metrics.MetricFilter filter)
Only report metrics which match the given filter.
|
GraphiteReporter.Builder |
prefixedWith(String prefix)
Prefix all metric names with the given string.
|
GraphiteReporter.Builder |
scheduleOn(ScheduledExecutorService executor)
Specifies the executor to use while scheduling reporting of metrics.
|
GraphiteReporter.Builder |
shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
Specifies whether or not, the executor (used for reporting) will be stopped with same time with reporter.
|
GraphiteReporter.Builder |
withClock(com.codahale.metrics.Clock clock)
Use the given
Clock instance for the time. |
GraphiteReporter.Builder |
withFloatingPointFormatter(DoubleFunction<String> floatingPointFormatter)
Use custom floating point formatter.
|
public GraphiteReporter.Builder shutdownExecutorOnStop(boolean shutdownExecutorOnStop)
scheduleOn(ScheduledExecutorService)
.shutdownExecutorOnStop
- if true, then executor will be stopped in same time with this reporterthis
public GraphiteReporter.Builder scheduleOn(ScheduledExecutorService executor)
executor
- the executor to use while scheduling reporting of metrics.this
public GraphiteReporter.Builder withClock(com.codahale.metrics.Clock clock)
Clock
instance for the time.clock
- a Clock
instancethis
public GraphiteReporter.Builder prefixedWith(String prefix)
prefix
- the prefix for all metric namesthis
public GraphiteReporter.Builder convertRatesTo(TimeUnit rateUnit)
rateUnit
- a unit of timethis
public GraphiteReporter.Builder convertDurationsTo(TimeUnit durationUnit)
durationUnit
- a unit of timethis
public GraphiteReporter.Builder filter(com.codahale.metrics.MetricFilter filter)
filter
- a MetricFilter
this
public GraphiteReporter.Builder disabledMetricAttributes(Set<com.codahale.metrics.MetricAttribute> disabledMetricAttributes)
MetricAttribute
.disabledMetricAttributes
- a set of MetricAttribute
this
public GraphiteReporter.Builder addMetricAttributesAsTags(boolean addMetricAttributesAsTags)
MetricAttribute
.addMetricAttributesAsTags
- if true, then metric attributes will be added as tagsthis
public GraphiteReporter.Builder withFloatingPointFormatter(DoubleFunction<String> floatingPointFormatter)
floatingPointFormatter
- a custom formatter for floating point valuesthis
public GraphiteReporter build(Graphite graphite)
GraphiteReporter
with the given properties, sending metrics using the
given GraphiteSender
.
Present for binary compatibility
graphite
- a Graphite
GraphiteReporter
public GraphiteReporter build(GraphiteSender graphite)
GraphiteReporter
with the given properties, sending metrics using the
given GraphiteSender
.graphite
- a GraphiteSender
GraphiteReporter
Copyright © 2011. All rights reserved.