perf(ui): shared KPI cache, live-cache-backed alarm summary, coalesced debug renders
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user