# Namespace EchoHub.Server.Services.Stats | EchoHub Documentation

# Namespace EchoHub.Server.Services.Stats

### Classes

ServerStatsCollector

  Thread-safe, in-memory accumulator for server-activity counters that have no natural database timestamp to query after the fact — session connects/disconnects, moderation actions, and peak concurrency. The periodic stats-report job snapshots and resets these once per reporting window. Registered as a singleton; every increment is lock-free so it is safe to call from hot paths (connect/disconnect).

ServerStatsReportService

  Background job that periodically snapshots server activity over a window, logs it as pretty-printed JSON (which also surfaces in the live server-logs room), and persists it to the database for historical trends. Interval and retention are configurable via the "Stats" section; the default cadence is every 6 hours.

### Structs

StatsCounters

  Immutable snapshot of the counters held by ServerStatsCollector.