Package com.yahoo.statistics
Class Counter
java.lang.Object
com.yahoo.statistics.Handle
com.yahoo.statistics.Counter
Deprecated.
A single integer value which can be incremented.
- Author:
- Steinar Knutsen
-
Constructor Summary
ConstructorDescriptionCounter
(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 TypeMethodDescriptionboolean
Deprecated.long
get()
Deprecated.boolean
Deprecated.The reset counter is true if this is counter is reset to 0 between each logging interval.int
hashCode()
Deprecated.void
Deprecated.Increment by 1.void
increment
(long n) Deprecated.Increment by n.void
reset()
Deprecated.If this counter should be set to 0 between each logging interval, do that.void
Deprecated.Log current state and reset.toString()
Deprecated.Methods inherited from class com.yahoo.statistics.Handle
cancel, isCancelled, run, runCallback
-
Constructor Details
-
Counter
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 injectionfetchParametersFromConfig
- 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 injectionfetchParametersFromConfig
- Whether or not this counter should be initialized from config.callback
- will be invoked each time this counter is written to the logresetCounter
- 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. -
toString
Deprecated. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated.
-