Class Histogram

  • All Implemented Interfaces:
    org.xbib.metrics.api.Count, org.xbib.metrics.api.Metric, org.xbib.metrics.api.Sampling

    public class Histogram
    extends java.lang.Object
    implements org.xbib.metrics.api.Metric, org.xbib.metrics.api.Sampling, org.xbib.metrics.api.Count
    A metric which calculates the distribution of a value.
    See Also:
    Accurately computing running variance
    • Constructor Summary

      Constructors 
      Constructor Description
      Histogram​(org.xbib.metrics.api.Reservoir reservoir)
      Creates a new Histogram with the given reservoir.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dec()  
      void dec​(long n)  
      void dec​(java.lang.String index, java.lang.String type, java.lang.String id)  
      long getCount()
      Returns the number of values recorded.
      java.lang.String getDecChecksum​(java.lang.String index, java.lang.String type)  
      java.lang.String getIncChecksum​(java.lang.String index, java.lang.String type)  
      org.xbib.metrics.api.Snapshot getSnapshot()  
      void inc()  
      void inc​(long value)
      Adds a recorded value.
      void inc​(java.lang.String index, java.lang.String type, java.lang.String id)  
      • Methods inherited from class java.lang.Object

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

      • Histogram

        public Histogram​(org.xbib.metrics.api.Reservoir reservoir)
        Creates a new Histogram with the given reservoir.
        Parameters:
        reservoir - the reservoir to create a histogram from
    • Method Detail

      • inc

        public void inc()
        Specified by:
        inc in interface org.xbib.metrics.api.Count
      • inc

        public void inc​(long value)
        Adds a recorded value.
        Specified by:
        inc in interface org.xbib.metrics.api.Count
        Parameters:
        value - the length of the value
      • inc

        public void inc​(java.lang.String index,
                        java.lang.String type,
                        java.lang.String id)
        Specified by:
        inc in interface org.xbib.metrics.api.Count
      • dec

        public void dec()
        Specified by:
        dec in interface org.xbib.metrics.api.Count
      • dec

        public void dec​(long n)
        Specified by:
        dec in interface org.xbib.metrics.api.Count
      • dec

        public void dec​(java.lang.String index,
                        java.lang.String type,
                        java.lang.String id)
        Specified by:
        dec in interface org.xbib.metrics.api.Count
      • getCount

        public long getCount()
        Returns the number of values recorded.
        Specified by:
        getCount in interface org.xbib.metrics.api.Count
        Returns:
        the number of values recorded
      • getIncChecksum

        public java.lang.String getIncChecksum​(java.lang.String index,
                                               java.lang.String type)
        Specified by:
        getIncChecksum in interface org.xbib.metrics.api.Count
      • getDecChecksum

        public java.lang.String getDecChecksum​(java.lang.String index,
                                               java.lang.String type)
        Specified by:
        getDecChecksum in interface org.xbib.metrics.api.Count
      • getSnapshot

        public org.xbib.metrics.api.Snapshot getSnapshot()
        Specified by:
        getSnapshot in interface org.xbib.metrics.api.Sampling