Class RateStatistic


  • @Deprecated(since="2021-05-27")
    public class RateStatistic
    extends java.lang.Object
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.

    Statistics on a time sequence rate.

    Calculates the rate at which the record() method is called over the configured period, retaining also the total count and maximum rate achieved.

    The implementation keeps a Deque of timestamps for all records for the last time period, so this method is not suitable for large rates unless a small time period is used.

    • Constructor Summary

      Constructors 
      Constructor Description
      RateStatistic​(long period, java.util.concurrent.TimeUnit units)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String dump()
      Deprecated.
       
      java.lang.String dump​(java.util.concurrent.TimeUnit units)
      Deprecated.
       
      long getCount()
      Deprecated.
       
      long getMax()
      Deprecated.
       
      long getOldest​(java.util.concurrent.TimeUnit units)
      Deprecated.
       
      long getPeriod()
      Deprecated.
       
      int getRate()
      Deprecated.
       
      java.util.concurrent.TimeUnit getUnits()
      Deprecated.
       
      int record()
      Deprecated.
      Records a sample value.
      void reset()
      Deprecated.
      Resets the statistics.
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RateStatistic

        public RateStatistic​(long period,
                             java.util.concurrent.TimeUnit units)
        Deprecated.
    • Method Detail

      • getPeriod

        public long getPeriod()
        Deprecated.
      • getUnits

        public java.util.concurrent.TimeUnit getUnits()
        Deprecated.
      • reset

        public void reset()
        Deprecated.
        Resets the statistics.
      • record

        public int record()
        Deprecated.
        Records a sample value.
        Returns:
        the number of records in the current period.
      • getRate

        public int getRate()
        Deprecated.
        Returns:
        the number of records in the current period
      • getMax

        public long getMax()
        Deprecated.
        Returns:
        the max number of samples per period.
      • getOldest

        public long getOldest​(java.util.concurrent.TimeUnit units)
        Deprecated.
        Parameters:
        units - the units of the return
        Returns:
        the age of the oldest sample in the requested units
      • getCount

        public long getCount()
        Deprecated.
        Returns:
        the number of samples recorded
      • dump

        public java.lang.String dump()
        Deprecated.
      • dump

        public java.lang.String dump​(java.util.concurrent.TimeUnit units)
        Deprecated.
      • toString

        public java.lang.String toString()
        Deprecated.
        Overrides:
        toString in class java.lang.Object