@ThreadSafe public final class CounterStat extends Object
Thread-safety: instances of CounterStat are thread-safe. However,
there is no consistency guarantee when using reset() or resetTo(io.airlift.stats.CounterStat) concurrently
with update(long) or merge(io.airlift.stats.CounterStat).
| Modifier and Type | Class and Description |
|---|---|
static class |
CounterStat.CounterStatSnapshot |
| Constructor and Description |
|---|
CounterStat() |
| Modifier and Type | Method and Description |
|---|---|
DecayCounter |
getFifteenMinute() |
DecayCounter |
getFiveMinute() |
DecayCounter |
getOneMinute() |
long |
getTotalCount() |
void |
merge(CounterStat counterStat) |
void |
reset()
Resets counters.
|
void |
resetTo(CounterStat counterStat)
Deprecated.
|
CounterStat.CounterStatSnapshot |
snapshot() |
void |
update(long count) |
public void update(long count)
public void merge(CounterStat counterStat)
public void reset()
Note: this method is guaranteed to obliterate effect of previous update(long) or merge(io.airlift.stats.CounterStat)
invocations. When it invoked concurrently with update(long) or merge(io.airlift.stats.CounterStat), the result is
indeterminate.
@Deprecated public void resetTo(CounterStat counterStat)
public long getTotalCount()
public DecayCounter getOneMinute()
public DecayCounter getFiveMinute()
public DecayCounter getFifteenMinute()
public CounterStat.CounterStatSnapshot snapshot()
Copyright © 2010–2021 Airlift. All rights reserved.