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
@@ -54,7 +54,26 @@ public record SiteHealthReport(
// signal surfaces a forgotten site's stale backlog (count alone hides age).
// Additive-only trailing member — defaults to null for producers / tests that
// don't populate it.
double? OldestParkedMessageAgeSeconds = null);
double? OldestParkedMessageAgeSeconds = null)
{
// Script-execution-scheduler gauges (S2/UA5), surfaced additively as init
// properties (rather than positional parameters) so the constructor signature
// is untouched. Point-in-time, refreshed on the site by ScriptSchedulerStatsReporter;
// safe defaults for producers / tests that don't populate them.
/// <summary>Script tasks waiting to run on the dedicated script-execution scheduler.</summary>
public int ScriptQueueDepth { get; init; }
/// <summary>Script-execution worker threads currently running a script body.</summary>
public int ScriptBusyThreads { get; init; }
/// <summary>
/// Age (seconds) of the oldest in-flight script across the scheduler's worker
/// threads, or null when the pool is idle. A large value with all threads busy
/// indicates a stuck/blocked script holding a dedicated thread.
/// </summary>
public double? ScriptOldestBusyAgeSeconds { get; init; }
}
/// <summary>
/// Broadcast wrapper used between central nodes to keep per-node