Table of Contents

Class ServerStatsReportService

Namespace
EchoHub.Server.Services.Stats
Assembly
EchoHub.Server.dll

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.

public sealed class ServerStatsReportService : BackgroundService, IDisposable
Inheritance
BackgroundService
ServerStatsReportService
Implements
Inherited Members

Constructors

ServerStatsReportService(IServiceScopeFactory, PresenceTracker, ServerStatsCollector, StatsOptions, ILogger<ServerStatsReportService>)

public ServerStatsReportService(IServiceScopeFactory scopeFactory, PresenceTracker presence, ServerStatsCollector collector, StatsOptions options, ILogger<ServerStatsReportService> logger)

Parameters

scopeFactory IServiceScopeFactory
presence PresenceTracker
collector ServerStatsCollector
options StatsOptions
logger ILogger<ServerStatsReportService>

Methods

ExecuteAsync(CancellationToken)

protected override Task ExecuteAsync(CancellationToken stoppingToken)

Parameters

stoppingToken CancellationToken

Returns

Task