java.lang.Object
com.pervasive.datarush.monitoring.AccumulatedTimer
- All Implemented Interfaces:
AccumulatedTimerSupplier,StatisticSupplier
Basic mutable implementation of
AccumulatedTimerSupplier.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongThe accumulated time so far.getState()Returns the current state of the supplier.voidpause()Pauses the timer; time will not accumulate until the next call tostart().snapshot()Creates a snapshot of this timer.voidstart()Starts the timer; time will begin to accumulatevoidstop()Stops the timer.
-
Constructor Details
-
AccumulatedTimer
public AccumulatedTimer()Creates a new timer in theStatisticState.UNAVAILABLEstate.
-
-
Method Details
-
getState
Description copied from interface:StatisticSupplierReturns the current state of the supplier.- Specified by:
getStatein interfaceStatisticSupplier- Returns:
- the state of the supplier
-
start
public void start()Starts the timer; time will begin to accumulate- Throws:
IllegalStateException- if the timer is already started or has finished
-
pause
public void pause()Pauses the timer; time will not accumulate until the next call tostart(). -
stop
public void stop()Stops the timer. This method can be called while in any state and thus is safe to call within afinallyblock. -
getAccumulatedTimeMillis
public long getAccumulatedTimeMillis()Description copied from interface:AccumulatedTimerSupplierThe accumulated time so far. For aggregations, this is the sum over all partitions of the to be the sum over all partitions of the partition'sAccumulatedTimerSupplier.getAccumulatedTimeMillis(). This value is undefined if the timer isStatisticState.UNAVAILABLE.- Specified by:
getAccumulatedTimeMillisin interfaceAccumulatedTimerSupplier- Returns:
- the accumulated time in milliseconds.
-
snapshot
Description copied from interface:AccumulatedTimerSupplierCreates a snapshot of this timer. If the timer is in theStatisticState.ACTIVE- Specified by:
snapshotin interfaceAccumulatedTimerSupplier- Specified by:
snapshotin interfaceStatisticSupplier- Returns:
- a snapshot of this statistic.
-