public class DefaultLatencyHistogramStatistic extends Object implements LatencyHistogramStatistic, ChainedEventObserver
| Constructor and Description |
|---|
DefaultLatencyHistogramStatistic(double phi,
int bucketCount,
Duration window) |
DefaultLatencyHistogramStatistic(double phi,
int bucketCount,
Duration window,
LongSupplier timeSupplier)
Create a histogram maintained over a sliding time window.
|
| Modifier and Type | Method and Description |
|---|---|
List<Histogram.Bucket> |
buckets() |
long |
count() |
void |
event(long time,
long latency)
Called to indicate an event happened.
|
Long |
maximum() |
Long |
minimum() |
Long |
percentile(double percent) |
long[] |
percentileBounds(double percent) |
<T> T |
query(Function<LatencyHistogramQuery,T> fn)
Enables to query the histogram several times within a synchronized state so that every calls are consistent
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmaximumStatistic, medianStatistic, minimumStatistic, percentileStatisticmedianpublic DefaultLatencyHistogramStatistic(double phi,
int bucketCount,
Duration window,
LongSupplier timeSupplier)
The constructed histogram is:
window sliding windowbucketCount bucketsb1.size() ~= b0.size * phiphi - histogram bucket bias factorbucketCount - number of bucketswindow - sliding window size, in nstimeSupplier - the supplier of time, which must be in the same unit as the time passed to the {event(long, long)} method.public DefaultLatencyHistogramStatistic(double phi,
int bucketCount,
Duration window)
public List<Histogram.Bucket> buckets()
buckets in interface LatencyHistogramQuerypublic long count()
count in interface LatencyHistogramQuerypublic Long minimum()
minimum in interface LatencyHistogramQuerypublic Long maximum()
maximum in interface LatencyHistogramQuerypublic Long percentile(double percent)
percentile in interface LatencyHistogramQuerypercent - the percentage (0.0-1.0)public long[] percentileBounds(double percent)
percentileBounds in interface LatencyHistogramQuerypercent - the percentage (0.0-1.0)public void event(long time,
long latency)
ChainedEventObserverevent in interface ChainedEventObservertime - the clock at event completion in nslatency - the event latency in nspublic <T> T query(Function<LatencyHistogramQuery,T> fn)
LatencyHistogramStatisticquery in interface LatencyHistogramStatisticCopyright © 2018. All rights reserved.