Class CountMetric

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

    public class CountMetric
    extends java.lang.Object
    implements org.xbib.metrics.api.Metric, org.xbib.metrics.api.Count
    An incrementing and decrementing counter metric.
    • Constructor Summary

      Constructors 
      Constructor Description
      CountMetric()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dec()
      Decrement the counter by one.
      void dec​(long n)
      Decrement the counter by n.
      void dec​(java.lang.String index, java.lang.String type, java.lang.String id)  
      long getCount()
      Returns the counter's current value.
      java.lang.String getDecChecksum​(java.lang.String index, java.lang.String type)  
      java.lang.String getIncChecksum​(java.lang.String index, java.lang.String type)  
      void inc()
      Increment the counter by one.
      void inc​(long n)
      Increment the counter by n.
      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

      • CountMetric

        public CountMetric()
    • Method Detail

      • inc

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

        public void inc​(long n)
        Increment the counter by n.
        Specified by:
        inc in interface org.xbib.metrics.api.Count
        Parameters:
        n - the amount by which the counter will be increased
      • 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()
        Decrement the counter by one.
        Specified by:
        dec in interface org.xbib.metrics.api.Count
      • dec

        public void dec​(long n)
        Decrement the counter by n.
        Specified by:
        dec in interface org.xbib.metrics.api.Count
        Parameters:
        n - the amount by which the counter will be decreased
      • 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 counter's current value.
        Specified by:
        getCount in interface org.xbib.metrics.api.Count
        Returns:
        the counter's current value
      • 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