Class SimpleCounter
- java.lang.Object
-
- org.apache.zookeeper.server.metric.Metric
-
- org.apache.zookeeper.server.metric.SimpleCounter
-
-
Constructor Summary
Constructors Constructor Description SimpleCounter(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long value)
Increment the value by a given amount.long
get()
Get the current value held by the counter.void
reset()
Map<String,Object>
values()
-
-
-
Constructor Detail
-
SimpleCounter
public SimpleCounter(String name)
-
-
Method Detail
-
add
public void add(long value)
Description copied from interface:Counter
Increment the value by a given amount.This method is thread safe, The MetricsProvider will take care of synchronization.
-
get
public long get()
Description copied from interface:Counter
Get the current value held by the counter.This method is thread safe, The MetricsProvider will take care of synchronization.
-
-