Package io.airlift.stats
Class CounterStat
- java.lang.Object
-
- io.airlift.stats.CounterStat
-
@ThreadSafe public final class CounterStat extends Object
Event statistics.Thread-safety: instances of
CounterStatare thread-safe. However, there is no consistency guarantee when usingreset()orresetTo(io.airlift.stats.CounterStat)concurrently withupdate(long)ormerge(io.airlift.stats.CounterStat).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCounterStat.CounterStatSnapshot
-
Constructor Summary
Constructors Constructor Description CounterStat()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DecayCountergetFifteenMinute()DecayCountergetFiveMinute()DecayCountergetOneMinute()longgetTotalCount()voidmerge(CounterStat counterStat)voidreset()Resets counters.voidresetTo(CounterStat counterStat)Deprecated.CounterStat.CounterStatSnapshotsnapshot()voidupdate(long count)
-
-
-
Method Detail
-
update
public void update(long count)
-
merge
public void merge(CounterStat counterStat)
-
reset
public void reset()
Resets counters.Note: this method is guaranteed to obliterate effect of previous
update(long)ormerge(io.airlift.stats.CounterStat)invocations. When it invoked concurrently withupdate(long)ormerge(io.airlift.stats.CounterStat), the result is indeterminate.
-
resetTo
@Deprecated public void resetTo(CounterStat counterStat)
Deprecated.This is a hack to work around limitations in Jmxutils.
-
getTotalCount
public long getTotalCount()
-
getOneMinute
public DecayCounter getOneMinute()
-
getFiveMinute
public DecayCounter getFiveMinute()
-
getFifteenMinute
public DecayCounter getFifteenMinute()
-
snapshot
public CounterStat.CounterStatSnapshot snapshot()
-
-