- java.lang.Object
-
- com.pervasive.datarush.monitoring.GaugeSnapshot
-
- All Implemented Interfaces:
GaugeSupplier
,StatisticSupplier
,Serializable
public final class GaugeSnapshot extends Object implements GaugeSupplier, Serializable
A snapshot that reflects a point-in-time of aGaugeSupplier
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static GaugeSnapshot
UNAVAILABLE
Constant that corresponds to a snapshot of a counter whose value is unavailable
-
Constructor Summary
Constructors Constructor Description GaugeSnapshot(GaugeSupplier supplier)
Create a snapshot of the given gauge.GaugeSnapshot(StatisticState state, long currentValue, long minAllowedValue, long maxAllowedValue)
Create a snapshot with the specified values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCurrentValue()
Returns the current value of the gauge or an unspecified value if the gauge is unavailable.long
getMaxAllowedValue()
Returns the maximum allowed value for the gauge ofLong.MAX_VALUE
if there is no maximumlong
getMinAllowedValue()
Returns the minimum allowed value for the gauge orLong.MIN_VALUE
if there is no minimum.StatisticState
getState()
Returns the current state of the supplier.GaugeSupplier
snapshot()
Returns a snapshot of this statistic.
-
-
-
Field Detail
-
UNAVAILABLE
public static final GaugeSnapshot UNAVAILABLE
Constant that corresponds to a snapshot of a counter whose value is unavailable
-
-
Constructor Detail
-
GaugeSnapshot
public GaugeSnapshot(GaugeSupplier supplier)
Create a snapshot of the given gauge.- Parameters:
supplier
- the gauge
-
GaugeSnapshot
public GaugeSnapshot(StatisticState state, long currentValue, long minAllowedValue, long maxAllowedValue)
Create a snapshot with the specified values- Parameters:
state
- the state of the gaugecurrentValue
- the current value of the gaugeminAllowedValue
- the minimum allowed value of the gaugemaxAllowedValue
- the maximum allowed value of the gauge
-
-
Method Detail
-
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
-
getCurrentValue
public long getCurrentValue()
Description copied from interface:GaugeSupplier
Returns the current value of the gauge or an unspecified value if the gauge is unavailable.- Specified by:
getCurrentValue
in interfaceGaugeSupplier
- Returns:
- the current value of the gauge
-
getMinAllowedValue
public long getMinAllowedValue()
Description copied from interface:GaugeSupplier
Returns the minimum allowed value for the gauge orLong.MIN_VALUE
if there is no minimum.- Specified by:
getMinAllowedValue
in interfaceGaugeSupplier
- Returns:
- the minimum allowed value for the gauge
-
getMaxAllowedValue
public long getMaxAllowedValue()
Description copied from interface:GaugeSupplier
Returns the maximum allowed value for the gauge ofLong.MAX_VALUE
if there is no maximum- Specified by:
getMaxAllowedValue
in interfaceGaugeSupplier
- Returns:
- the maximum allowed value for the gauge
-
snapshot
public GaugeSupplier snapshot()
Description copied from interface:StatisticSupplier
Returns a snapshot of this statistic.- Specified by:
snapshot
in interfaceGaugeSupplier
- Specified by:
snapshot
in interfaceStatisticSupplier
- Returns:
- a snapshot of this statistic.
-
-