public final class GaugeSnapshot extends Object implements GaugeSupplier, Serializable
GaugeSupplier
.Modifier and Type | Field and Description |
---|---|
static GaugeSnapshot |
UNAVAILABLE
Constant that corresponds to a snapshot of a counter
whose value is unavailable
|
Constructor and 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
|
Modifier and Type | Method and 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 of
Long.MAX_VALUE if there is no maximum |
long |
getMinAllowedValue()
Returns the minimum allowed value for the gauge or
Long.MIN_VALUE if there is no minimum. |
StatisticState |
getState()
Returns the current state of the supplier.
|
GaugeSupplier |
snapshot()
Returns a snapshot of this statistic.
|
public static final GaugeSnapshot UNAVAILABLE
public GaugeSnapshot(GaugeSupplier supplier)
supplier
- the gaugepublic GaugeSnapshot(StatisticState state, long currentValue, long minAllowedValue, long maxAllowedValue)
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 gaugepublic StatisticState getState()
StatisticSupplier
getState
in interface StatisticSupplier
public long getCurrentValue()
GaugeSupplier
getCurrentValue
in interface GaugeSupplier
public long getMinAllowedValue()
GaugeSupplier
Long.MIN_VALUE
if there is no minimum.getMinAllowedValue
in interface GaugeSupplier
public long getMaxAllowedValue()
GaugeSupplier
Long.MAX_VALUE
if there is no maximumgetMaxAllowedValue
in interface GaugeSupplier
public GaugeSupplier snapshot()
StatisticSupplier
snapshot
in interface GaugeSupplier
snapshot
in interface StatisticSupplier
Copyright © 2021 Actian Corporation. All rights reserved.