- java.lang.Object
-
- com.pervasive.datarush.monitoring.CounterSnapshot
-
- All Implemented Interfaces:
CounterSupplier,StatisticSupplier,Serializable
public final class CounterSnapshot extends Object implements CounterSupplier, Serializable
A snapshot that reflects a point-in-time of aCounterSupplier.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static CounterSnapshotUNAVAILABLEConstant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLEstate.
-
Constructor Summary
Constructors Constructor Description CounterSnapshot(CounterSupplier source)Create a snapshot of the given counter.CounterSnapshot(StatisticState state, long count)Create a snapshot with the specified values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetCount()This will return the value of the counter or an undefined value if never started.StatisticStategetState()Returns the current state of the supplier.inthashCode()CounterSnapshotsnapshot()Returns a snapshot of this statistic.StringtoString()
-
-
-
Field Detail
-
UNAVAILABLE
public static final CounterSnapshot UNAVAILABLE
Constant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLEstate.
-
-
Constructor Detail
-
CounterSnapshot
public CounterSnapshot(CounterSupplier source)
Create a snapshot of the given counter.- Parameters:
source- the counter
-
CounterSnapshot
public CounterSnapshot(StatisticState state, long count)
Create a snapshot with the specified values- Parameters:
state- the state of the countercount- the count of the counter
-
-
Method Detail
-
snapshot
public CounterSnapshot snapshot()
Description copied from interface:StatisticSupplierReturns a snapshot of this statistic.- Specified by:
snapshotin interfaceCounterSupplier- 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
-
getCount
public long getCount()
Description copied from interface:CounterSupplierThis will return the value of the counter or an undefined value if never started.- Specified by:
getCountin interfaceCounterSupplier- Returns:
- the value of the counter or an undefined value if never started.
-
-