- 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 IntervalTimerSnapshot
UNAVAILABLE
Constant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLE
state.
-
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 long
getEndTimeMillis()
Returns the end time if finished, the current time if running, or an undefined value if never started.long
getStartTimeMillis()
This will return the start time or an undefined value if never started.StatisticState
getState()
Returns the current state of the supplier.IntervalTimerSnapshot
snapshot()
Creates a snapshot of this timer.String
toString()
-
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.UNAVAILABLE
state.
-
-
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:IntervalTimerSupplier
Creates a snapshot of this timer. If the timer is in theStatisticState.ACTIVE
- Specified by:
snapshot
in interfaceIntervalTimerSupplier
- Specified by:
snapshot
in interfaceStatisticSupplier
- Returns:
- a snapshot of this statistic.
-
getState
public StatisticState getState()
Description copied from interface:StatisticSupplier
Returns the current state of the supplier.- Specified by:
getState
in interfaceStatisticSupplier
- Returns:
- the state of the supplier
-
getStartTimeMillis
public long getStartTimeMillis()
Description copied from interface:IntervalTimerSupplier
This will return the start time or an undefined value if never started.- Specified by:
getStartTimeMillis
in interfaceIntervalTimerSupplier
- Returns:
- the start time or an undefined value if never started.
-
getEndTimeMillis
public long getEndTimeMillis()
Description copied from interface:IntervalTimerSupplier
Returns 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.ACTIVE
state, then this value will reflect the time at which the snapshot was taken.- Specified by:
getEndTimeMillis
in interfaceIntervalTimerSupplier
- Returns:
- the end time if finished, the current time if running, or an undefined value if never started
-
-