public class LatencyPercentile extends MapStatComponent<Long,LatencyPercentile>
This class was inspired by the somewhat different LatencyStat class.
| Constructor and Description |
|---|
LatencyPercentile(String name,
float percentile,
int maxTrackedLatencyMillis)
Creates an instance of this class
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(LatencyPercentile other) |
void |
add(long latencyMillis)
Records an operation that used the specified amount of time in
milliseconds.
|
void |
clear()
Resets the statistic to its initial state.
|
LatencyPercentile |
copy()
Narrow the return type to the component type.
|
Long |
get()
Calculates and returns the current value without clearing the existing
statistics.
|
protected String |
getFormattedValue(boolean useCommas)
Returns the value of the statistic as a formatted string, either using
or not using commas as requested.
|
boolean |
isNotSet()
Returns whether the statistic is in its initial state.
|
void |
negate() |
String |
toString() |
void |
updateInterval(LatencyPercentile other)
Updates the operation counts in this instance to represent the
difference between the values stored in this instance and the ones in
the argument.
|
getFormattedValuepublic LatencyPercentile(String name, float percentile, int maxTrackedLatencyMillis)
name - the name of the statisticpercentile - the percentile latency to report as a ratio between
0.0 and 1.0maxTrackedLatencyMillis - the maximum for tracking latency valuesIllegalArgumentException - if the percentile is less than 0.0 or
greater than 1.0, or if maxTrackedLatencyMillis is less than 0protected String getFormattedValue(boolean useCommas)
MapStatComponentgetFormattedValue in class MapStatComponent<Long,LatencyPercentile>useCommas - whether to use commaspublic LatencyPercentile copy()
MapStatComponentcopy in class MapStatComponent<Long,LatencyPercentile>public Long get()
public void clear()
BaseStatpublic boolean isNotSet()
BaseStatpublic void add(long latencyMillis)
public void add(LatencyPercentile other)
public void negate()
public void updateInterval(LatencyPercentile other)
Copyright © 2024. All rights reserved.