mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-05 23:34:09 +02:00
feat: add periodic server stats reporting and logging
- Introduced ServerStatsReport and ServerStatsCollector for tracking server activity. - Implemented ServerStatsReportService to generate and persist stats reports periodically. - Added configuration options for stats reporting in appsettings and .env.example. - Enhanced logging in ChannelsController and ModerationController to include stats-related actions. - Updated database context and migrations to support new ServerStatsReport entity. - Adjusted logging levels in IrcGatewayService and ChatService for better performance.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
namespace EchoHub.Server.Config;
|
||||
|
||||
/// <summary>
|
||||
/// Periodic server-stats report settings, bound from the "Stats" config section (env override:
|
||||
/// <c>Stats__Enabled</c> etc.). When enabled, a background job periodically snapshots server
|
||||
/// activity, logs it as pretty-printed JSON, and persists it to the database.
|
||||
/// </summary>
|
||||
public sealed class StatsOptions
|
||||
{
|
||||
/// <summary>Master switch for the periodic stats report job.</summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>How often a report is generated, in hours. Default: every 6 hours.</summary>
|
||||
public double IntervalHours { get; set; } = 6;
|
||||
|
||||
/// <summary>
|
||||
/// How long persisted reports are kept before being pruned, in days. Set to 0 to keep
|
||||
/// reports indefinitely. Default: 90 days.
|
||||
/// </summary>
|
||||
public int RetentionDays { get; set; } = 90;
|
||||
}
|
||||
Reference in New Issue
Block a user