public class LatencyPercentileStat extends StatWithValueType<Long>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_TRACKED_LATENCY_MILLIS
The default maximum value for tracking latency values.
|
definition| Constructor and Description |
|---|
LatencyPercentileStat(StatGroup group,
StatDefinition definition,
float percentile)
Creates an instance of this class using the default maximum for tracking
latency values of 1000.
|
LatencyPercentileStat(StatGroup group,
StatDefinition definition,
float percentile,
int maxTrackedLatencyMillis)
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(long latencyMillis)
Record a single operation that the specified amount of time in
milliseconds.
|
void |
add(Stat<Long> other)
Add the value of "other" to this stat.
|
void |
clear()
Resets the statistic to its initial state.
|
LatencyPercentileStat |
computeInterval(Stat<Long> base)
Compute interval value with respect to the base value.
|
LatencyPercentileStat |
copy()
Returns a copy of this statistic.
|
Long |
get()
Returns the value of the statistic.
|
String |
getFormattedValue()
Returns the value of the statistic as a formatted string.
|
Class<Long> |
getValueType()
Returns the type of the value returned by the
BaseStat.get() method. |
boolean |
isNotSet()
Returns whether the statistic is in its initial state.
|
void |
negate()
Negate the value.
|
void |
set(Long newValue)
Set the stat value.
|
getForTypecopyAndAdd, copyAndClear, getDefinition, toString, toStringVerbosepublic static final int DEFAULT_MAX_TRACKED_LATENCY_MILLIS
public LatencyPercentileStat(StatGroup group, StatDefinition definition, float percentile)
percentile - the percentile latency to report as a ratio between
0.0 and 1.0IllegalArgumentException - if the stat definition type is not
INCREMENTAL, the percentile is less than 0.0 or greater than 1.0, or
maxTrackedLatencyMillis is less than 0public LatencyPercentileStat(StatGroup group, StatDefinition definition, float percentile, int maxTrackedLatencyMillis)
percentile - the percentile latency to report as a ratio between
0.0 and 1.0maxTrackedLatencyMillis - the maximum for tracking latency valuesIllegalArgumentException - if the stat definition type is not
INCREMENTAL, the percentile is less than 0.0 or greater than 1.0, or
maxTrackedLatencyMillis is less than 0public void add(long latencyMillis)
public Class<Long> getValueType()
StatWithValueTypeBaseStat.get() method.getValueType in class StatWithValueType<Long>public void set(Long newValue)
set in class Stat<Long>UnsupportedOperationException - alwayspublic void add(Stat<Long> other)
add in class Stat<Long>IllegalArgumentException - if argument is not a
LatencyPercentileStat or if it has a different maximum latencypublic LatencyPercentileStat computeInterval(Stat<Long> base)
computeInterval in class Stat<Long>IllegalArgumentException - if argument is not a
LatencyPercentileStat or if it has a different maximum latencypublic void negate()
Statpublic void clear()
BaseStatpublic LatencyPercentileStat copy()
BaseStatpublic String getFormattedValue()
BaseStatgetFormattedValue in class BaseStat<Long>Copyright © 2024. All rights reserved.