net.i2p.stat

## Class FrequencyStat

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

-     public class FrequencyStat
      extends Object

  coordinate an event frequency over various periods

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FrequencyStat(String name, String description, String group, long[] periods)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `coalesceStats()` coalesce all the stats
    `boolean` | `equals(Object obj)`
    `void` | `eventOccurred()` update all of the frequencies for the various periods
    `String` | `getDescription()`
    `long` | `getEventCount()` Gets the lifetime event count.
    `long` | `getFrequency()` Gets the lifetime average frequency.
    `Frequency` | `getFrequency(long period)`
    `String` | `getGroupName()`
    `String` | `getName()`
    `long[]` | `getPeriods()`
    `int` | `hashCode()`
    `void` | `store(OutputStream out, String prefix)` Serializes this FrequencyStat to the provided OutputStream

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

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

- - ### Constructor Detail

    - #### FrequencyStat

          public FrequencyStat(String name,
                               String description,
                               String group,
                               long[] periods)

  - ### Method Detail

    - #### coalesceStats

          public void coalesceStats()

      coalesce all the stats

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### eventOccurred

          public void eventOccurred()

      update all of the frequencies for the various periods

    - #### getDescription

          public String getDescription()

    - #### getEventCount

          public long getEventCount()

      Gets the lifetime event count.
      Returns:
        lifetime event count

    - #### getFrequency

          public long getFrequency()

      Gets the lifetime average frequency.
      Returns:
        lifetime average frequency in millisedonds, i.e. the average time between events, or Long.MAX_VALUE if no events ever

    - #### getFrequency

          public Frequency getFrequency(long period)

    - #### getGroupName

          public String getGroupName()

    - #### getName

          public String getName()

    - #### getPeriods

          public long[] getPeriods()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### store

          public void store(OutputStream out,
                            String prefix)
                     throws IOException

      Serializes this FrequencyStat to the provided OutputStream
      Parameters:
        `out` - to write to
        `prefix` - to prepend to the stat
      Throws:
        `IOException` - if something goes wrong