Package org.jitsi.metrics
Class CounterMetric
-
- All Implemented Interfaces:
public final class CounterMetric extends Metric<Long>
A long metric wrapper for Prometheus Counters, which are monotonically increasing. Provides atomic operations such as incAndGet.
-
-
Constructor Summary
Constructors Constructor Description CounterMetric(String name, String help, String namespace, Long initialValue)CounterMetric(String name, String help, String namespace)
-
Method Summary
Modifier and Type Method Description StringgetName()the name of this metric Longget()Supplies the current value of this metric. final Unitadd(Long delta)Atomically adds the given value to this counter. final LongaddAndGet(Long delta)Atomically adds the given value to this counter, returning the updated value. final LongincAndGet()Atomically increments the value of this counter by one, returning the updated value. final Unitinc()Atomically increments the value of this counter by one. -
-
Method Detail
-
addAndGet
final Long addAndGet(Long delta)
Atomically adds the given value to this counter, returning the updated value.
- Returns:
the updated value
-
incAndGet
final Long incAndGet()
Atomically increments the value of this counter by one, returning the updated value.
- Returns:
the updated value
-
-
-
-