public class CodahaleMetricWriter extends Object implements MetricWriter
MetricWriter
that send data to a Codahale MetricRegistry
based on a
naming convention:
increment(Delta)
with names in "meter.*" are treated as
Meter
eventsCounter
valuesset(Metric)
with names in "histogram.*" are treated as
Histogram
updatesset(Metric)
with names in "timer.*" are treated as Timer
updatesGauge
values (single valued
measurements of type double)Constructor and Description |
---|
CodahaleMetricWriter(MetricRegistry registry)
Create a new
CodahaleMetricWriter instance. |
Modifier and Type | Method and Description |
---|---|
void |
increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative).
|
void |
reset(String metricName)
Reset the value of a metric, usually to zero value.
|
void |
set(Metric<?> value)
Set the value of a metric.
|
public CodahaleMetricWriter(MetricRegistry registry)
CodahaleMetricWriter
instance.registry
- the underlying metric registrypublic void increment(Delta<?> delta)
MetricWriter
increment
in interface MetricWriter
delta
- the amount to increment bypublic void set(Metric<?> value)
MetricWriter
set
in interface MetricWriter
public void reset(String metricName)
MetricWriter
reset
in interface MetricWriter
metricName
- the name to resetCopyright © 2014. All rights reserved.