@API(value=MAINTAINED) public final class StoreTimerSnapshot extends Object
StoreTimer
.
Subtracting a snapshot of a timer from the original timer after subsequent operations have
been performed and timed can provide useful metrics as to the cost of those subsequent operations.
See StoreTimer.getDifference(StoreTimer, StoreTimerSnapshot)
.
Modifier and Type | Class and Description |
---|---|
static class |
StoreTimerSnapshot.CounterSnapshot
An immutable snapshot of a
StoreTimer.Counter . |
Modifier and Type | Method and Description |
---|---|
boolean |
containsCounter(StoreTimer.Event event)
Determine if there is a counter recorded for a given event.
|
boolean |
containsTimeoutCounter(StoreTimer.Event event)
Determine if there is a timeout counter recorded for a given event.
|
boolean |
derivedFrom(StoreTimer timer)
Determine if this snapshot is derived from the provided timer.
|
static StoreTimerSnapshot |
from(StoreTimer timer)
Creates an immutable snapshot of a
StoreTimer . |
StoreTimerSnapshot.CounterSnapshot |
getCounterSnapshot(StoreTimer.Event event)
Get the counter for a given event.
|
StoreTimerSnapshot.CounterSnapshot |
getTimeoutCounterSnapshot(StoreTimer.Event event)
Get the timeout counter for a given event.
|
void |
setResetTime(StoreTimer timer)
Set the reset time on the provided timer to the create time of this snapshot.
|
boolean |
takenAfterReset(StoreTimer timer)
Determine if this snapshot was taken after the provided timer was last reset.
|
@Nonnull public static StoreTimerSnapshot from(@Nonnull StoreTimer timer)
StoreTimer
.timer
- to create the snapshot from@Nullable public StoreTimerSnapshot.CounterSnapshot getCounterSnapshot(@Nonnull StoreTimer.Event event)
event
- the event of interest@Nonnull public boolean containsCounter(@Nonnull StoreTimer.Event event)
event
- the event of interest@Nullable public StoreTimerSnapshot.CounterSnapshot getTimeoutCounterSnapshot(@Nonnull StoreTimer.Event event)
event
- the event of interest@Nonnull public boolean containsTimeoutCounter(@Nonnull StoreTimer.Event event)
event
- the event of interestpublic boolean derivedFrom(StoreTimer timer)
timer
- the provided timerpublic boolean takenAfterReset(StoreTimer timer)
timer
- the provided timerpublic void setResetTime(StoreTimer timer)
timer
- the provided timer to srt