feat(site-runtime): periodic scheduler-stats reporter feeding site health (S2/UA5)

This commit is contained in:
Joseph Doherty
2026-07-08 23:43:09 -04:00
parent d44b6a0e52
commit dddafc025e
3 changed files with 147 additions and 0 deletions
@@ -70,6 +70,15 @@ public static class ServiceCollectionExtensions
c.Timeout = TimeSpan.FromSeconds(
sp.GetRequiredService<IOptions<SiteRuntimeOptions>>().Value.ConfigFetchTimeoutSeconds));
// S2/UA5: periodically lift the shared script-execution scheduler gauges
// (queue depth, busy threads, oldest-busy age) onto the site health report.
// Registered via factory-lambda so ISiteHealthCollector (registered by the
// Host's AddSiteHealthMonitoring) is resolved lazily at host start.
services.AddHostedService(sp => new ScriptSchedulerStatsReporter(
sp.GetRequiredService<HealthMonitoring.ISiteHealthCollector>(),
sp.GetRequiredService<IOptions<SiteRuntimeOptions>>().Value,
sp.GetRequiredService<ILogger<ScriptSchedulerStatsReporter>>()));
return services;
}