Class Counter

java.lang.Object
io.deephaven.base.stats.Value
io.deephaven.base.stats.Counter

public class Counter extends Value
A statistic where each value represents a additive quantity, and thus the sum of the values does have meaning. Examples include event counts and processing duration. If the sum of the values does not have a useful interpretation, use State instead.
  • Value.increment(long) updates the counter, recording a single value. This is the most common usage. (Value.sample(long) does exactly the same thing but is a poor verb to use with a Counter.)
  • incrementFromSample(long) updates the counter, recording a value that is the difference between this sample and the last sample. (The first call just sets the "last" sample and does not record a value.) For example, this can be used to CPU usage rate when only a running total is available by periodically sampling the running total.
  • Field Details

  • Constructor Details

    • Counter

      public Counter(long now)
  • Method Details

    • incrementFromSample

      public void incrementFromSample(long n)
    • getTypeTag

      public char getTypeTag()
      Specified by:
      getTypeTag in class Value