Class BoundedHistogram


  • public class BoundedHistogram
    extends java.lang.Object
    A histogram that keeps a maximum number of buckets (entries). When the histogram is at the limit, it will reject new entries but keep updating the count of the existing entries. Therefore, the counts for the entries in the histogram are correct but if the histogram overflowed, it may be missing some entries.
    • Constructor Summary

      Constructors 
      Constructor Description
      BoundedHistogram​(java.lang.String name, int maxHistogramSize)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEntry​(java.lang.String key)  
      java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.util.concurrent.atomic.LongAdder> getMap()  
      boolean isOverflowed()  
      java.lang.String prettyPrint()  
      java.lang.String prettyPrintTopEntries​(int numEntries)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BoundedHistogram

        public BoundedHistogram​(java.lang.String name,
                                int maxHistogramSize)
    • Method Detail

      • addEntry

        public void addEntry​(java.lang.String key)
      • isOverflowed

        public boolean isOverflowed()
      • getMap

        public java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.util.concurrent.atomic.LongAdder> getMap()
      • prettyPrint

        public java.lang.String prettyPrint()
      • prettyPrintTopEntries

        public java.lang.String prettyPrintTopEntries​(int numEntries)