Class StoreTimer.Counter
- java.lang.Object
-
- com.apple.foundationdb.record.provider.common.StoreTimer.Counter
-
- Enclosing class:
- StoreTimer
public static class StoreTimer.Counter extends Object
Contains the number of occurrences and cummulative time spent on an associatedStoreTimer.Event
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(StoreTimer.Counter counter)
Add the value of one counter into another counter.int
getCount()
Get the number of occurrences of the associated event.long
getTimeNanos()
Get the cumulative time spent on the associated event.void
increment(int amount)
Add an additional number of occurrences spent performing the associated event.protected StoreTimer.Counter
makeImmutable()
For internal use during aggregate event computation; the counter can remain mutable until the computation is completed, then the counter is made immutable, ensuring that other code doesn't accidentally think it is updating a regular counter.void
record(long timeDifference)
Add additional time spent performing the associated event.
-
-
-
Method Detail
-
getCount
public int getCount()
Get the number of occurrences of the associated event.- Returns:
- the number of occurrences of the associated event
-
getTimeNanos
public long getTimeNanos()
Get the cumulative time spent on the associated event.- Returns:
- the cumulative time spent on the associated event
-
record
public void record(long timeDifference)
Add additional time spent performing the associated event.- Parameters:
timeDifference
- additional time spent performing the associated event
-
increment
public void increment(int amount)
Add an additional number of occurrences spent performing the associated event.- Parameters:
amount
- additional number of times spent performing the associated event
-
add
public void add(@Nonnull StoreTimer.Counter counter)
Add the value of one counter into another counter.- Parameters:
counter
- the other counter to add into this counter
-
makeImmutable
protected StoreTimer.Counter makeImmutable()
For internal use during aggregate event computation; the counter can remain mutable until the computation is completed, then the counter is made immutable, ensuring that other code doesn't accidentally think it is updating a regular counter.- Returns:
- this counter, now immutable
-
-