Class LongAdderCounter
- java.lang.Object
-
- org.apache.pulsar.broker.stats.prometheus.metrics.LongAdderCounter
-
- All Implemented Interfaces:
org.apache.bookkeeper.stats.Counter
public class LongAdderCounter extends java.lang.Object implements org.apache.bookkeeper.stats.CounterCounterimplementation based onLongAdder.LongAdder keeps a counter per-thread and then aggregates to get the result, in order to avoid contention between multiple threads.
-
-
Constructor Summary
Constructors Constructor Description LongAdderCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(long delta)voidclear()voiddec()java.lang.Longget()voidinc()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceorg.apache.bookkeeper.stats.Counter
-
inc
public void inc()
- Specified by:
incin interfaceorg.apache.bookkeeper.stats.Counter
-
dec
public void dec()
- Specified by:
decin interfaceorg.apache.bookkeeper.stats.Counter
-
add
public void add(long delta)
- Specified by:
addin interfaceorg.apache.bookkeeper.stats.Counter
-
get
public java.lang.Long get()
- Specified by:
getin interfaceorg.apache.bookkeeper.stats.Counter
-
-