# Package net.i2p.stat

Statistical collection and analysis framework used throughout the I2P router for adaptive operation, performance monitoring, and debugging.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  RateSummaryListener | Receive the state of the rate when its coalesced

- Class Summary
  Class | Description
  --- | ---
  Frequency | Manage the calculation of a moving average event frequency over a certain period.
  FrequencyStat | coordinate an event frequency over various periods
  PersistenceHelper | Output rate data.
  Rate | Simple rate calculator for periodically sampled data points - determining an average value over a period, the number of events in that period, the maximum number of events (using the interval between events), and lifetime data.
  RateAverages | Storage space for computations of various averages.
  RateConstants | Centralized rate period constants for memory-optimized statistics collection.
  RateStat | coordinate a moving rate over various periods
  StatManager | Coordinate the management of various frequencies and rates within I2P components, both allowing central update and retrieval, as well as distributed creation and use.

## Package net.i2p.stat Description

Statistical collection and analysis framework used throughout the I2P router for adaptive operation, performance monitoring, and debugging.

This package provides a comprehensive statistics system that enables the router to:

- Monitor Performance: Track bandwidth usage, message rates, and processing times
- Adaptive Behavior: Dynamically adjust routing and tunnel management based on observed patterns
- Debugging Support: Provide detailed metrics for troubleshooting and analysis
- Health Monitoring: Track router and network health indicators
- Rate Limiting: Implement adaptive rate controls based on current load

Key Components:

- RateStat: Core rate statistics collection and averaging
- Rate: Individual rate measurements with configurable averaging periods
- Frequency: Event frequency tracking and analysis
- StatManager: Central coordinator for all statistics operations

The statistics system is designed to be lightweight and efficient, providing valuable insights into router operation without significantly impacting performance. Statistics are used both internally for adaptive routing decisions and externally for monitoring and debugging purposes.