public final class ValueStats extends Object implements JmxRefreshableStats<ValueStats>, JmxStatsWithReset, JmxStatsWithSmoothingWindow
Class is supposed to work in single thread
| Modifier and Type | Field and Description |
|---|---|
static int[] |
POWERS_OF_TEN |
static int[] |
POWERS_OF_TEN_SEMI_LINEAR |
static int[] |
POWERS_OF_TEN_SEMI_LINEAR_1000 |
static int[] |
POWERS_OF_TEN_SHORTENED |
static int[] |
POWERS_OF_TWO |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ValueStats anotherStats) |
static ValueStats |
create(Duration smoothingWindow)
Creates new ValueStats with specified smoothing window
|
static ValueStats |
createAccumulator() |
String |
get() |
double |
getAbsoluteMax()
Returns maximum of all added values
|
double |
getAbsosuteMin()
Returns minimum of all added values
|
double |
getAverage() |
long |
getCount() |
List<String> |
getHistogram() |
double |
getLastValue()
Returns last added value
|
double |
getSmoothedAverage()
Returns smoothed average of added values
|
double |
getSmoothedMax()
Returns smoothed maximum of all added values
|
double |
getSmoothedMin()
Returns smoothed minimum of all added values
|
double |
getSmoothedRate() |
double |
getSmoothedStandardDeviation()
Returns smoothed standard deviation
|
Duration |
getSmoothingWindow() |
void |
recordValue(double value) |
void |
recordValue(int value)
Adds value
|
void |
refresh(long timestamp) |
void |
resetStats()
Resets stats and sets new parameters
|
void |
setHistogramLevels(int[] levels) |
void |
setSmoothingWindow(Duration smoothingWindow) |
String |
toString() |
ValueStats |
withAbsoluteValues(boolean value) |
ValueStats |
withAverageAndDeviation(boolean value) |
ValueStats |
withHistogram(int[] levels) |
ValueStats |
withLastValue(boolean value) |
ValueStats |
withMinMax(boolean value) |
ValueStats |
withPrecision(int precision) |
ValueStats |
withRate() |
ValueStats |
withRate(String rateUnit) |
ValueStats |
withScientificNotation() |
ValueStats |
withUnit(String unit) |
public static final int[] POWERS_OF_TWO
public static final int[] POWERS_OF_TEN
public static final int[] POWERS_OF_TEN_SHORTENED
public static final int[] POWERS_OF_TEN_SEMI_LINEAR
public static final int[] POWERS_OF_TEN_SEMI_LINEAR_1000
public static ValueStats createAccumulator()
public static ValueStats create(Duration smoothingWindow)
smoothingWindow - in secondspublic ValueStats withUnit(String unit)
public ValueStats withRate(String rateUnit)
public ValueStats withRate()
public ValueStats withHistogram(int[] levels)
public ValueStats withAbsoluteValues(boolean value)
public ValueStats withAverageAndDeviation(boolean value)
public ValueStats withMinMax(boolean value)
public ValueStats withLastValue(boolean value)
public ValueStats withPrecision(int precision)
public ValueStats withScientificNotation()
public void setHistogramLevels(int[] levels)
public void resetStats()
resetStats in interface JmxStatsWithResetpublic void recordValue(int value)
public void recordValue(double value)
public void refresh(long timestamp)
refresh in interface JmxRefreshablepublic void add(ValueStats anotherStats)
add in interface JmxStats<ValueStats>public double getLastValue()
public double getSmoothedAverage()
public double getSmoothedStandardDeviation()
public double getSmoothedMin()
public double getSmoothedMax()
public double getAbsosuteMin()
public double getAbsoluteMax()
public double getAverage()
public double getSmoothedRate()
public Duration getSmoothingWindow()
getSmoothingWindow in interface JmxStatsWithSmoothingWindowpublic void setSmoothingWindow(Duration smoothingWindow)
setSmoothingWindow in interface JmxStatsWithSmoothingWindowpublic long getCount()
public String get()
Copyright © 2019. All rights reserved.