feat(health): additive script-scheduler stats on ISiteHealthCollector + SiteHealthReport (S2/UA5)

This commit is contained in:
Joseph Doherty
2026-07-08 23:37:50 -04:00
parent 474ec8a221
commit 7d50555fd3
4 changed files with 85 additions and 2 deletions
@@ -141,6 +141,24 @@ public interface ISiteHealthCollector
// SiteHealthCollector overrides this with the Interlocked.Exchange store.
}
/// <summary>
/// Replace the latest script-execution-scheduler gauges (queue depth, busy
/// thread count, and age in seconds of the oldest in-flight script) used by
/// the next <see cref="CollectReport"/> call. Refreshed periodically by the
/// <c>ScriptSchedulerStatsReporter</c> hosted service. Point-in-time: the
/// values are NOT reset on <see cref="CollectReport"/>. S2/UA5 — surfaces a
/// saturated or stuck script-execution pool on the site health report.
/// Default interface implementation is a no-op so existing test fakes continue
/// to compile without per-fake updates.
/// </summary>
/// <param name="queueDepth">Script tasks waiting to run.</param>
/// <param name="busyThreads">Worker threads currently executing a script.</param>
/// <param name="oldestBusyAgeSeconds">Age (seconds) of the oldest in-flight script, or <c>null</c> when idle.</param>
void SetScriptSchedulerStats(int queueDepth, int busyThreads, double? oldestBusyAgeSeconds)
{
// Default no-op so test fakes do not need to be updated.
}
/// <summary>
/// Sets the hostname of this node.
/// </summary>