net.i2p.router.tasks

## Class CoalesceStatsEvent

- java.lang.Object
- - net.i2p.router.tasks.CoalesceStatsEvent

- All Implemented Interfaces:
    SimpleTimer.TimedEvent

      public class CoalesceStatsEvent
      extends Object
      implements SimpleTimer.TimedEvent

  Periodic statistics collection and aggregation system. This event runs every minute to collect, aggregate, and coalesce router performance statistics. It gathers metrics from all major router components and updates the statistics framework for monitoring and analysis. Statistics Collected:
  - Network metrics - peer counts, bandwidth usage
  - System resources - memory usage, CPU load, thread count
  - Tunnel performance - build success rates, participation
  - Router health - job queue lag, processing times
  - Communication system - send/receive rates, error counts
  Features:
  - Automatic cache clearing when memory is low
  - Rate calculation and rolling averages
  - Performance trend monitoring
  - Data available via /stats.jsp and /graphs.jsp
  This data is essential for router performance monitoring, troubleshooting, and capacity planning. The statistics are used by the router console to display real-time performance graphs and historical trends.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CoalesceStatsEvent(RouterContext ctx)` Create a new stats coalescence event.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `timeReached()` Collect and coalesce router statistics.

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

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

- - ### Constructor Detail

    - #### CoalesceStatsEvent

          public CoalesceStatsEvent(RouterContext ctx)

      Create a new stats coalescence event. Initializes all required rate statistics for monitoring router performance.
      Parameters:
        `ctx` - the router context for accessing statistics manager

  - ### Method Detail

    - #### timeReached

          public void timeReached()

      Collect and coalesce router statistics. This method is called periodically to gather various router metrics including network statistics, peer counts, memory usage, and tunnel performance. The collected data is used for monitoring and performance analysis. Statistics collected include:
      - Peer counts (known, active, fast, high capacity, etc.)
      - Bandwidth usage (send/receive rates)
      - Memory usage and CPU load
      - Tunnel performance metrics
      - Thread counts and system resources
      Specified by:
        `timeReached` in interface `SimpleTimer.TimedEvent`