Class RichGauge
- java.lang.Object
- org.springframework.boot.actuate.metrics.rich.RichGauge
public final class RichGauge extends Object
A gauge which stores the maximum, minimum and average in addition to the current value.The value of the average will depend on whether a weight ('alpha') is set for the gauge. If it is unset, the average will contain a simple arithmetic mean. If a weight is set, an exponential moving average will be calculated as defined in this NIST document.
Field Summary
Fields Modifier and Type Field Description static String
ALPHA
The suffix for alpha gauges.static String
AVG
The suffix for average value gauges.static String
COUNT
The suffix for count gauges.static String
MAX
The suffix for max gauges.static String
MIN
The suffix for min gauges.static String
VAL
The suffix for value gauges.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
double
getAlpha()
Return the smoothing constant value.double
getAverage()
Return either an exponential weighted moving average or a simple mean, respectively, depending on whether the weight 'alpha' has been set for this gauge.long
getCount()
Return the number of times the value has been set.double
getMax()
Return the maximum value of the gauge.double
getMin()
Return the minimum value of the gauge.String
getName()
Return the name of the gauge.double
getValue()
Return the current value of the gauge.int
hashCode()
RichGauge
setAlpha(double alpha)
String
toString()
Field Detail
COUNT
public static final String COUNT
The suffix for count gauges.- See Also:
- Constant Field Values
MAX
public static final String MAX
The suffix for max gauges.- See Also:
- Constant Field Values
MIN
public static final String MIN
The suffix for min gauges.- See Also:
- Constant Field Values
AVG
public static final String AVG
The suffix for average value gauges.- See Also:
- Constant Field Values
ALPHA
public static final String ALPHA
The suffix for alpha gauges.- See Also:
- Constant Field Values
VAL
public static final String VAL
The suffix for value gauges.- See Also:
- Constant Field Values
Method Detail
getValue
public double getValue()
Return the current value of the gauge.- Returns:
- the value
getAverage
public double getAverage()
Return either an exponential weighted moving average or a simple mean, respectively, depending on whether the weight 'alpha' has been set for this gauge.- Returns:
- The average over all the accumulated values
getMax
public double getMax()
Return the maximum value of the gauge.- Returns:
- the maximum value
getMin
public double getMin()
Return the minimum value of the gauge.- Returns:
- the minimum value
getCount
public long getCount()
Return the number of times the value has been set.- Returns:
- the value set count
getAlpha
public double getAlpha()
Return the smoothing constant value.- Returns:
- the alpha smoothing value