Interface CounterWriter
- All Known Subinterfaces:
MetricRepository
,MetricWriter
,RichGaugeRepository
- All Known Implementing Classes:
CompositeMetricWriter
,InMemoryMetricRepository
,InMemoryRichGaugeRepository
,JmxMetricWriter
,MessageChannelMetricWriter
,RedisMetricRepository
,StatsdMetricWriter
public interface CounterWriter
Simple writer for counters (metrics that increment).- Since:
- 1.3.0
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
Method Detail
increment
void increment(Delta<?> delta)
Increment the value of a metric (or decrement if the delta is negative). The name of the delta is the name of the metric to increment.- Parameters:
delta
- the amount to increment by
reset
void reset(String metricName)
Reset the value of a metric, usually to zero value. Implementations can discard the old values if desired, but may choose not to. This operation is optional (some implementations may not be able to fulfill the contract, in which case they should simply do nothing).- Parameters:
metricName
- the name to reset