Class Counter


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

      • 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 Detail

      • 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
      • equals

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

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