Class Counter

java.lang.Object
com.yahoo.statistics.Handle
com.yahoo.statistics.Counter

@Deprecated public class Counter extends Handle
Deprecated.
A single integer value which can be incremented.
Author:
Steinar Knutsen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Counter(String name, Statistics manager, boolean fetchParametersFromConfig)
    Deprecated.
    A monotonically increasing 64 bit integer value.
    Counter(String name, Statistics manager, boolean fetchParametersFromConfig, Callback callback, boolean resetCounter)
    Deprecated.
    A monotonically increasing 64 bit integer value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Deprecated.
     
    long
    get()
    Deprecated.
     
    boolean
    Deprecated.
    The reset counter is true if this is counter is reset to 0 between each logging interval.
    int
    Deprecated.
     
    void
    Deprecated.
    Increment by 1.
    void
    increment(long n)
    Deprecated.
    Increment by n.
    void
    Deprecated.
    If this counter should be set to 0 between each logging interval, do that.
    void
    Deprecated.
    Log current state and reset.
    Deprecated.
     

    Methods inherited from class com.yahoo.statistics.Handle

    cancel, isCancelled, run, runCallback

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Counter

      public Counter(String name, Statistics manager, boolean fetchParametersFromConfig)
      Deprecated.
      A monotonically increasing 64 bit integer value.
      Parameters:
      name - The name of this counter, for use in logging.
      manager - the statistics manager acquired by injection
      fetchParametersFromConfig - Whether or not this counter should be initialized from config.
    • Counter

      public Counter(String name, Statistics manager, boolean fetchParametersFromConfig, Callback callback, boolean resetCounter)
      Deprecated.
      A monotonically increasing 64 bit integer value.
      Parameters:
      name - The name of this counter, for use in logging.
      manager - the statistics manager acquired by injection
      fetchParametersFromConfig - Whether or not this counter should be initialized from config.
      callback - will be invoked each time this counter is written to the log
      resetCounter - Control for if this Counter should be reset between each logging interval.
  • Method Details

    • increment

      public void increment()
      Deprecated.
      Increment by 1.
    • increment

      public void increment(long n)
      Deprecated.
      Increment by n.
    • get

      public long get()
      Deprecated.
      Returns:
      current value of this counter
    • getResetCounter

      public boolean getResetCounter()
      Deprecated.
      The reset counter is true if this is counter is reset to 0 between each logging interval.
      Returns:
      whether this counter is reset between each logging interval.
    • reset

      public void reset()
      Deprecated.
      If this counter should be set to 0 between each logging interval, do that.
    • runHandle

      public void runHandle()
      Deprecated.
      Log current state and reset.
      Specified by:
      runHandle in class Handle
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Deprecated.
      Specified by:
      equals in class Handle
    • hashCode

      public int hashCode()
      Deprecated.
      Specified by:
      hashCode in class Handle