org.springframework.boot.actuate.metrics.rich

## Class 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.

Author:
Luke Taylor
• ### Field Summary

Fields
Modifier and Type Field and 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.
• ### Constructor Summary

Constructors
Constructor and Description
`RichGauge(String name)`
Creates an "empty" gauge.
```RichGauge(String name, double value)```
```RichGauge(String name, double value, double alpha, double mean, double max, double min, long count)```
• ### Method Summary

All Methods
Modifier and Type Method and 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()`
• ### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`
• ### 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
• ### Constructor Detail

• #### RichGauge

`public RichGauge(String name)`
Creates an "empty" gauge. The average, max and min will be zero, but this initial value will not be included after the first value has been set on the gauge.
Parameters:
`name` - the name under which the gauge will be stored.
• #### RichGauge

```public RichGauge(String name,
double value)```
• #### RichGauge

```public RichGauge(String name,
double value,
double alpha,
double mean,
double max,
double min,
long count)```
• ### Method Detail

• #### getName

`public String getName()`
Return the name of the gauge.
Returns:
the name
• #### 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
• #### setAlpha

`public RichGauge setAlpha(double alpha)`
• #### equals

`public boolean equals(Object o)`
Overrides:
`equals` in class `Object`
• #### hashCode

`public int hashCode()`
Overrides:
`hashCode` in class `Object`
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`

Copyright © 2016 Pivotal Software, Inc.. All rights reserved.