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
@@ -38,6 +38,25 @@ public class SiteHealthCollectorTests
Assert.Equal(2, report.AlarmEvaluationErrorCount);
}
[Fact]
public void CollectReport_CarriesScriptSchedulerStats()
{
_collector.SetScriptSchedulerStats(queueDepth: 7, busyThreads: 3, oldestBusyAgeSeconds: 42.5);
var report = _collector.CollectReport("site-1");
Assert.Equal(7, report.ScriptQueueDepth);
Assert.Equal(3, report.ScriptBusyThreads);
Assert.Equal(42.5, report.ScriptOldestBusyAgeSeconds);
}
[Fact]
public void CollectReport_ScriptSchedulerStats_DefaultToZeroAndNull()
{
var report = _collector.CollectReport("site-1");
Assert.Equal(0, report.ScriptQueueDepth);
Assert.Equal(0, report.ScriptBusyThreads);
Assert.Null(report.ScriptOldestBusyAgeSeconds);
}
[Fact]
public void IncrementDeadLetter_AccumulatesBetweenReports()
{