- 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 CounterSnapshot
UNAVAILABLE
Constant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLE
state.
-
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 boolean
equals(Object o)
long
getCount()
This will return the value of the counter or an undefined value if never started.StatisticState
getState()
Returns the current state of the supplier.int
hashCode()
CounterSnapshot
snapshot()
Returns a snapshot of this statistic.String
toString()
-
-
-
Field Detail
-
UNAVAILABLE
public static final CounterSnapshot UNAVAILABLE
Constant that corresponds to a snapshot of a counter in theStatisticState.UNAVAILABLE
state.
-
-
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:StatisticSupplier
Returns a snapshot of this statistic.- Specified by:
snapshot
in interfaceCounterSupplier
- 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
-
getCount
public long getCount()
Description copied from interface:CounterSupplier
This will return the value of the counter or an undefined value if never started.- Specified by:
getCount
in interfaceCounterSupplier
- Returns:
- the value of the counter or an undefined value if never started.
-
-