perf(ui): shared KPI cache, live-cache-backed alarm summary, coalesced debug renders

This commit is contained in:
Joseph Doherty
2026-08-14 20:53:38 -04:00
parent ee193cd2bb
commit 8c0b36b2fa
19 changed files with 1554 additions and 64 deletions
@@ -128,7 +128,20 @@ public sealed class AlarmSummaryService : IAlarmSummaryService
}
/// <inheritdoc/>
public AlarmSummaryResult BuildFromLiveAlarms(IReadOnlyList<AlarmStateChanged> alarms)
public AlarmSummaryResult BuildFromLiveAlarms(IReadOnlyList<AlarmStateChanged> alarms) =>
BuildFromLiveAlarmsCore(alarms);
/// <inheritdoc/>
public AlarmRollup ComputeRollup(IReadOnlyList<AlarmSummaryRow> rows) => ComputeRollupCore(rows);
/// <summary>
/// Pure flattening of a live-cache snapshot into summary rows. Shared with
/// <see cref="SharedAlarmSummaryService"/>, which memoizes the fan-out but must produce
/// byte-identical rows on the live path — one implementation, no drift.
/// </summary>
/// <param name="alarms">The live-cache alarm snapshot.</param>
/// <returns>The flattened, deterministically ordered rows (never any not-reporting names).</returns>
internal static AlarmSummaryResult BuildFromLiveAlarmsCore(IReadOnlyList<AlarmStateChanged> alarms)
{
ArgumentNullException.ThrowIfNull(alarms);
@@ -147,8 +160,14 @@ public sealed class AlarmSummaryService : IAlarmSummaryService
return new AlarmSummaryResult(orderedRows, Array.Empty<string>());
}
/// <inheritdoc/>
public AlarmRollup ComputeRollup(IReadOnlyList<AlarmSummaryRow> rows)
/// <summary>
/// Pure roll-up over already-flattened rows. Shared with
/// <see cref="SharedAlarmSummaryService"/> for the same one-implementation reason as
/// <see cref="BuildFromLiveAlarmsCore"/>.
/// </summary>
/// <param name="rows">The rows to roll up.</param>
/// <returns>The active/worst-severity/unacked/by-kind roll-up.</returns>
internal static AlarmRollup ComputeRollupCore(IReadOnlyList<AlarmSummaryRow> rows)
{
ArgumentNullException.ThrowIfNull(rows);