Package org.apache.bookkeeper.stats
Interface Counter
- All Known Implementing Classes:
LongAdderCounter,NullStatsLogger.NullCounter,OtelCounter,ThreadScopedLongAdderCounter
public interface Counter
Simple stats that require only increment and decrement
functions on a Long. Metrics like the number of topics, persist queue size
etc. should use this.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCount(long delta) Add delta to the value associated with this stat.voidaddLatency(long eventLatency, TimeUnit unit) An operation succeeded with the given eventLatency.voidclear()Clear this stat.voiddec()Decrement the value associated with this stat.get()Get the value associated with this stat.voidinc()Increment the value associated with this stat.
-
Method Details
-
clear
void clear()Clear this stat. -
inc
void inc()Increment the value associated with this stat. -
dec
void dec()Decrement the value associated with this stat. -
addCount
void addCount(long delta) Add delta to the value associated with this stat.- Parameters:
delta-
-
addLatency
An operation succeeded with the given eventLatency. Update stats to reflect the same- Parameters:
eventLatency- The event latencyunit-
-
get
Long get()Get the value associated with this stat.
-