- java.lang.Object
-
- com.pervasive.datarush.monitoring.AbstractIntervalTimerSupplier
-
- com.pervasive.datarush.monitoring.IntervalTimerSnapshot
-
- All Implemented Interfaces:
IntervalTimerSupplier,StatisticSupplier,Serializable
public final class IntervalTimerSnapshot extends AbstractIntervalTimerSupplier implements Serializable
A snapshot that reflects a point-in-time of aIntervalTimerSupplier.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static IntervalTimerSnapshotUNAVAILABLEConstant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLEstate.
-
Constructor Summary
Constructors Constructor Description IntervalTimerSnapshot(IntervalTimerSupplier source)Create a snapshot of the given timer.IntervalTimerSnapshot(StatisticState state, long startTimeMillis, long endTimeMillis)Create a snapshot with the specified values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetEndTimeMillis()Returns the end time if finished, the current time if running, or an undefined value if never started.longgetStartTimeMillis()This will return the start time or an undefined value if never started.StatisticStategetState()Returns the current state of the supplier.IntervalTimerSnapshotsnapshot()Creates a snapshot of this timer.StringtoString()-
Methods inherited from class com.pervasive.datarush.monitoring.AbstractIntervalTimerSupplier
getTimeIntervalMillis
-
-
-
-
Field Detail
-
UNAVAILABLE
public static final IntervalTimerSnapshot UNAVAILABLE
Constant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLEstate.
-
-
Constructor Detail
-
IntervalTimerSnapshot
public IntervalTimerSnapshot(IntervalTimerSupplier source)
Create a snapshot of the given timer.- Parameters:
source- the timer
-
IntervalTimerSnapshot
public IntervalTimerSnapshot(StatisticState state, long startTimeMillis, long endTimeMillis)
Create a snapshot with the specified values- Parameters:
state- the state of the timerstartTimeMillis- the start time of the timerendTimeMillis- the end time of the timer
-
-
Method Detail
-
snapshot
public IntervalTimerSnapshot snapshot()
Description copied from interface:IntervalTimerSupplierCreates a snapshot of this timer. If the timer is in theStatisticState.ACTIVE- Specified by:
snapshotin interfaceIntervalTimerSupplier- Specified by:
snapshotin interfaceStatisticSupplier- Returns:
- a snapshot of this statistic.
-
getState
public StatisticState getState()
Description copied from interface:StatisticSupplierReturns the current state of the supplier.- Specified by:
getStatein interfaceStatisticSupplier- Returns:
- the state of the supplier
-
getStartTimeMillis
public long getStartTimeMillis()
Description copied from interface:IntervalTimerSupplierThis will return the start time or an undefined value if never started.- Specified by:
getStartTimeMillisin interfaceIntervalTimerSupplier- Returns:
- the start time or an undefined value if never started.
-
getEndTimeMillis
public long getEndTimeMillis()
Description copied from interface:IntervalTimerSupplierReturns the end time if finished, the current time if running, or an undefined value if never started. If this timer corresponds to a snapshot of a timer that is in theStatisticState.ACTIVEstate, then this value will reflect the time at which the snapshot was taken.- Specified by:
getEndTimeMillisin interfaceIntervalTimerSupplier- Returns:
- the end time if finished, the current time if running, or an undefined value if never started
-
-