Package org.apache.zookeeper.metrics
Interface CounterSet
-
- All Known Implementing Classes:
SimpleCounterSet
public interface CounterSet
A counter refers to a value which can only increase. Usually the value is reset when the process starts. A CounterSet is a set ofCounter
grouped by keys.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
add(String key, long delta)
Increment the value by a given amount for the given keydefault void
inc(String key)
Increment the value by one for the given key
-
-
-
Method Detail
-
inc
default void inc(String key)
Increment the value by one for the given keyThis method is thread safe, The MetricsProvider will take care of synchronization.
- Parameters:
key
- the key to increment the count
-
add
void add(String key, long delta)
Increment the value by a given amount for the given keyThis method is thread safe, The MetricsProvider will take care of synchronization.
- Parameters:
key
- the key to increment the count for the given keydelta
- amount to increment, this cannot be a negative number.
-
-