Class CountStatAndMetric

  • All Implemented Interfaces:
    IMetric<Long>

    public class CountStatAndMetric
    extends Object
    implements IMetric<Long>
    Acts as a Count Metric, but also keeps track of approximate counts for the last 10 mins, 3 hours, 1 day, and all time.
    • Constructor Detail

      • CountStatAndMetric

        public CountStatAndMetric​(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 current 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()