Class FastLongHistogram
java.lang.Object
org.apache.hadoop.hbase.metrics.impl.FastLongHistogram
FastLongHistogram is a thread-safe class that estimate distribution of data and computes the
quantiles.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
Bins is a class containing a list of buckets(or bins) for estimation histogram of some data. -
Field Summary
Modifier and TypeFieldDescriptionprivate FastLongHistogram.Bins
static final int
Default number of bins.static final double[]
-
Constructor Summary
ConstructorDescriptionConstructor.FastLongHistogram
(int numOfBins) Constructor.FastLongHistogram
(int numOfBins, long min, long max) Constructor setting the bins assuming a uniform distribution within a range. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long value, long count) Adds a value to the histogram.long
getCount()
long
getMax()
long
getMean()
long
getMin()
long
getNumAtOrBelow
(long value) long[]
long[]
getQuantiles
(double[] quantiles) Computes the quantiles give the ratios.Resets the histogram for new counting.
-
Field Details
-
DEFAULT_NBINS
Default number of bins.- See Also:
-
DEFAULT_QUANTILES
-
bins
-
-
Constructor Details
-
FastLongHistogram
public FastLongHistogram()Constructor. -
FastLongHistogram
Constructor.- Parameters:
numOfBins
- the number of bins for the histogram. A larger value results in more precise results but with lower efficiency, and vice versus.
-
FastLongHistogram
Constructor setting the bins assuming a uniform distribution within a range.- Parameters:
numOfBins
- the number of bins for the histogram. A larger value results in more precise results but with lower efficiency, and vice versus.min
- lower bound of the region, inclusive.max
- higher bound of the region, inclusive.
-
-
Method Details
-
add
Adds a value to the histogram. -
getQuantiles
Computes the quantiles give the ratios. -
getQuantiles
-
getMin
-
getMax
-
getCount
-
getMean
-
getNumAtOrBelow
-
snapshotAndReset
Resets the histogram for new counting.
-