public final class RichGauge extends Object
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.
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 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) |
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() |
public static final String COUNT
public static final String MAX
public static final String MIN
public static final String AVG
public static final String ALPHA
public static final String VAL
public RichGauge(String name)
name
- the name under which the gauge will be stored.public RichGauge(String name, double value)
public RichGauge(String name, double value, double alpha, double mean, double max, double min, long count)
public String getName()
public double getValue()
public double getAverage()
public double getMax()
public double getMin()
public long getCount()
public double getAlpha()
public RichGauge setAlpha(double alpha)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.