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
Nested ClassesModifier and TypeClassDescriptionprivate static classBins is a class containing a list of buckets(or bins) for estimation histogram of some data. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FastLongHistogram.Binsstatic final intDefault number of bins.static final double[] -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.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 TypeMethodDescriptionvoidadd(long value, long count) Adds a value to the histogram.longgetCount()longgetMax()longgetMean()longgetMin()longgetNumAtOrBelow(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.
-