org.apache.storm.metric.internal

## Class CountStat

- java.lang.Object
- - org.apache.storm.metric.internal.CountStat

-     public class CountStat
      extends Object

  Keeps track of approximate counts for the last 10 mins, 3 hours, 1 day, and all time.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CountStat(int numBuckets)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Map<String,Long>` | `getTimeCounts()` Get time counts.
    `void` | `incBy(long count)` Increase the count by the given value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CountStat

          public CountStat(int numBuckets)

      Constructor.

      Parameters:
        `numBuckets` - the number of buckets to divide the time periods into.

  - ### Method Detail

    - #### incBy

          public void incBy(long count)

      Increase the count by the given value.

      Parameters:
        `count` - number to count

    - #### getTimeCounts

          public Map<String,Long> getTimeCounts()

      Get time counts.

      Returns:
        a map of time window to count. Keys are “600” for last 10 mins “10800” for the last 3 hours “86400” for the last day “:all-time” for all time

    - #### close

          public void close()

Copyright © 2021 The Apache Software Foundation. All rights reserved.