接口 CounterWriter
- 所有已知子接口:
MetricRepository
,MetricWriter
,RichGaugeRepository
- 所有已知实现类:
CompositeMetricWriter
,InMemoryMetricRepository
,InMemoryRichGaugeRepository
,JmxMetricWriter
,MessageChannelMetricWriter
,RedisMetricRepository
,StatsdMetricWriter
public interface CounterWriter
Simple writer for counters (metrics that increment).- 从以下版本开始:
- 1.3.0
方法详细资料
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.- 参数:
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).- 参数:
metricName
- the name to reset