Class 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.
public sealed class ServerStatsReportService : BackgroundService, IDisposable
- Inheritance
-
BackgroundServiceServerStatsReportService
- 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
scopeFactoryIServiceScopeFactorypresencePresenceTrackercollectorServerStatsCollectoroptionsStatsOptionsloggerILogger<ServerStatsReportService>
Methods
ExecuteAsync(CancellationToken)
protected override Task ExecuteAsync(CancellationToken stoppingToken)
Parameters
stoppingTokenCancellationToken
Returns
- Task