net.i2p.stat

## Class RateAverages

- java.lang.Object
- - net.i2p.stat.RateAverages

-     public class RateAverages
      extends Object

  Storage space for computations of various averages.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RateAverages()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getAverage()` Gets the weighted average.
    `double` | `getCurrent()` Gets the current average.
    `double` | `getLast()` Gets the last average.
    `static RateAverages` | `getTemp()` Gets a thread-local temp instance.
    `long` | `getTotalEventCount()` Gets the total event count.
    `double` | `getTotalValues()` Gets the total values.
    `(package private) void` | `reset()`
    `(package private) void` | `setAverage(double average)`
    `(package private) void` | `setCurrent(double current)`
    `(package private) void` | `setLast(double last)`
    `(package private) void` | `setTotalEventCount(long totalEventCount)`
    `(package private) void` | `setTotalValues(double totalValues)`

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

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

- - ### Constructor Detail

    - #### RateAverages

          public RateAverages()

  - ### Method Detail

    - #### getAverage

          public double getAverage()

      Gets the weighted average.
      Returns:
        one of several things: if there are any events (current or last) => weighted average otherwise if the useLifetime parameter to Rate.computeAverages was: true => the lifetime average value false => zero

    - #### getCurrent

          public double getCurrent()

      Gets the current average.
      Returns:
        the current average == current value / current event count

    - #### getLast

          public double getLast()

      Gets the last average.
      Returns:
        the last average == last value / last event count

    - #### getTemp

          public static RateAverages getTemp()

      Gets a thread-local temp instance.
      Returns:
        thread-local temp instance.

    - #### getTotalEventCount

          public long getTotalEventCount()

      Gets the total event count.
      Returns:
        the total event count == current + last event counts

    - #### getTotalValues

          public double getTotalValues()

      Gets the total values.
      Returns:
        the total values == current + last values

    - #### reset

          void reset()

    - #### setAverage

          void setAverage(double average)

    - #### setCurrent

          void setCurrent(double current)

    - #### setLast

          void setLast(double last)

    - #### setTotalEventCount

          void setTotalEventCount(long totalEventCount)

    - #### setTotalValues

          void setTotalValues(double totalValues)