public class BarSplittingBiasedHistogram extends Object implements Histogram
This class is *not thread-safe*, safe consumption in a multi-threaded environment will require some form of external locking.
Histogram.Bucket| Constructor and Description |
|---|
BarSplittingBiasedHistogram(double maxCoefficient,
double phi,
int expansionFactor,
int bucketCount,
double barEpsilon,
long window)
Create a histogram maintained over a sliding time window.
|
BarSplittingBiasedHistogram(double phi,
int bucketCount,
long window)
Create a histogram maintained over a sliding time window.
|
BarSplittingBiasedHistogram(int bucketCount,
long window)
Create a histogram maintained over a sliding time window.
|
| Modifier and Type | Method and Description |
|---|---|
void |
event(double value,
long time)
Record an event of the given
value occuring at he given time |
void |
expire(long time)
Expire old events from all buckets.
|
List<Histogram.Bucket> |
getBuckets()
Returns the histograms buckets
|
double |
getMaximum()
The maximum value.
|
double |
getMinimum()
The minimum value.
|
double[] |
getQuantileBounds(double quantile)
Returns the bounds
[minimum, maximum) on the given quantile. |
protected static double |
nextUpIfEqual(double test,
double value) |
long |
size() |
String |
toString() |
public BarSplittingBiasedHistogram(double maxCoefficient,
double phi,
int expansionFactor,
int bucketCount,
double barEpsilon,
long window)
The constructed histogram is:
window sliding windowbucketCount bucketsb1.size() ~= b0.size * phiexpansionFactor barsbarEpsilonmaxCoefficient of their target sizemaxCoefficient - relative split thresholdphi - histogram bucket bias factorexpansionFactor - number of bars per bucketbucketCount - number of bucketsbarEpsilon - bar count relative errorwindow - sliding window sizepublic BarSplittingBiasedHistogram(int bucketCount,
long window)
The constructed histogram is:
window sliding windowbucketCount bucketsb1.size() ~= b0.size * 0.7bucketCount - number of bucketswindow - sliding window sizepublic BarSplittingBiasedHistogram(double phi,
int bucketCount,
long window)
The constructed histogram is:
window sliding windowbucketCount bucketsb1.size() ~= b0.size * phiphi - histogram bucket bias factorbucketCount - number of bucketswindow - sliding window sizepublic void event(double value,
long time)
value occuring at he given timepublic void expire(long time)
public List<Histogram.Bucket> getBuckets()
HistogramgetBuckets in interface Histogramprotected static double nextUpIfEqual(double test,
double value)
public double getMinimum()
HistogramThis is equal to the inclusive lower bound of the zeroth (0.0) quantile.
getMinimum in interface Histogrampublic double getMaximum()
HistogramThis is equal to highest double value strictly less than the exclusive upper bound of the last (1.0) quantile.
getMaximum in interface Histogrampublic double[] getQuantileBounds(double quantile)
Histogram[minimum, maximum) on the given quantile.getQuantileBounds in interface Histogramquantile - desired quantileCopyright © 2018. All rights reserved.