Class MeasuredRate


  • public class MeasuredRate
    extends java.lang.Object
    Utility class for getting a count in last X milliseconds.
    • Constructor Summary

      Constructors 
      Constructor Description
      MeasuredRate​(long sampleInterval)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCount()
      Returns the count in the last sample interval.
      void increment()
      Increments the count in the current sample interval.
      void start()  
      void stop()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MeasuredRate

        public MeasuredRate​(long sampleInterval)
        Parameters:
        sampleInterval - in milliseconds
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • getCount

        public long getCount()
        Returns the count in the last sample interval.
      • increment

        public void increment()
        Increments the count in the current sample interval.