Class FastLongHistogram

java.lang.Object
org.apache.hadoop.hbase.metrics.impl.FastLongHistogram

@Private @Evolving public class FastLongHistogram extends Object
FastLongHistogram is a thread-safe class that estimate distribution of data and computes the quantiles.
  • Field Details

  • Constructor Details

    • FastLongHistogram

      Constructor.
    • FastLongHistogram

      public FastLongHistogram(int numOfBins)
      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

      public FastLongHistogram(int numOfBins, long min, long max)
      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

      public void add(long value, long count)
      Adds a value to the histogram.
    • getQuantiles

      public long[] getQuantiles(double[] quantiles)
      Computes the quantiles give the ratios.
    • getQuantiles

      public long[] getQuantiles()
    • getMin

      public long getMin()
    • getMax

      public long getMax()
    • getCount

      public long getCount()
    • getMean

      public long getMean()
    • getNumAtOrBelow

      public long getNumAtOrBelow(long value)
    • snapshotAndReset

      Resets the histogram for new counting.