perf(ui): shared KPI cache, live-cache-backed alarm summary, coalesced debug renders
This commit is contained in:
@@ -64,6 +64,14 @@ public class HealthPageTests : BunitContext
|
||||
_comms.SetSiteCallAudit(siteCallAudit);
|
||||
Services.AddSingleton(_comms);
|
||||
|
||||
// arch-review WP2.4 — the page no longer queries CommunicationService /
|
||||
// IAuditLogQueryService per circuit; it reads the process-level memoized
|
||||
// KPI cache. The real cache is registered here (not a substitute) so the
|
||||
// scripted-actor seam above is still what actually answers.
|
||||
Services.AddSingleton<IKpiSnapshotCache>(sp => new KpiSnapshotCache(
|
||||
sp.GetRequiredService<CommunicationService>(),
|
||||
sp.GetRequiredService<IServiceScopeFactory>()));
|
||||
|
||||
var aggregator = Substitute.For<ICentralHealthAggregator>();
|
||||
aggregator.GetAllSiteStates()
|
||||
.Returns(new Dictionary<string, SiteHealthState>());
|
||||
|
||||
@@ -71,6 +71,13 @@ public class NotificationKpisPageTests : BunitContext
|
||||
|
||||
Services.AddSingleton(_comms);
|
||||
|
||||
// arch-review WP2.4 — the page reads the process-level memoized KPI cache
|
||||
// rather than querying CommunicationService per circuit. The real cache is
|
||||
// registered so the scripted-actor seam above still answers the queries.
|
||||
Services.AddSingleton<IKpiSnapshotCache>(sp => new KpiSnapshotCache(
|
||||
sp.GetRequiredService<CommunicationService>(),
|
||||
sp.GetRequiredService<IServiceScopeFactory>()));
|
||||
|
||||
var siteRepo = Substitute.For<ISiteRepository>();
|
||||
siteRepo.GetAllSitesAsync(Arg.Any<CancellationToken>())
|
||||
.Returns(Task.FromResult<IReadOnlyList<Site>>(new List<Site>
|
||||
|
||||
Reference in New Issue
Block a user