Class Counters


  • public class Counters
    extends java.lang.Object
    Set of related counters.
    • Constructor Summary

      Constructors 
      Constructor Description
      Counters()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Counters forReading()  
      long get​(java.lang.String name)  
      void inc​(java.lang.String name)
      Increase the metric with the given name by one.
      void inc​(java.lang.String name, long delta)
      Increase the metric with the given name by the given amount.
      void reset()
      Reset all metrics to zero.
      void set​(java.lang.String name, long value)
      Set the metric with the given name to the given value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Counters

        public Counters()
    • Method Detail

      • get

        public long get​(java.lang.String name)
      • inc

        public void inc​(java.lang.String name)
        Increase the metric with the given name by one.
        Parameters:
        name - The name of the metric
      • inc

        public void inc​(java.lang.String name,
                        long delta)
        Increase the metric with the given name by the given amount.
        Parameters:
        name - The name of the metric
        delta - The amount to increase the metric with
      • set

        public void set​(java.lang.String name,
                        long value)
        Set the metric with the given name to the given value.
        Parameters:
        name - The name of the metric
        value - The value to set the metric to
      • reset

        public void reset()
        Reset all metrics to zero.
      • forReading

        public Counters forReading()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object