perf(adminui): pooled DbContext factory; role-grants reads per-call, not per-circuit

This commit is contained in:
Joseph Doherty
2026-08-16 04:05:34 -04:00
parent 34f836e03c
commit 140bf0c131
11 changed files with 346 additions and 50 deletions
@@ -201,6 +201,10 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
Receive<ApplyScriptedAlarms>(OnApply);
Receive<AlarmsLoaded>(OnAlarmsLoaded);
Receive<VirtualTagActor.DependencyValueChanged>(OnDependencyChanged);
// The mux's batched delivery: one message carrying this host's whole matched slice of a driver
// burst. The engine upstream is fed per value, so push each item in order — the saving is the
// mailbox hop, not the push.
Receive<VirtualTagActor.DependencyValueBatch>(OnDependencyBatch);
Receive<EngineEmission>(OnEngineEmission);
// Cluster redundancy snapshots (published on the `redundancy-state` topic, subscribed in PreStart)
// cache this node's role so OnEngineEmission can gate the cluster-wide alerts publish to the Primary.
@@ -395,6 +399,17 @@ public sealed class ScriptedAlarmHostActor : ReceiveActor
new DataValueSnapshot(msg.Value, msg.StatusCode, msg.TimestampUtc, msg.TimestampUtc));
}
/// <summary>One batched mux delivery — every item already matched this host's registered interest.
/// Loops the per-value handler, preserving in-burst order.</summary>
private void OnDependencyBatch(VirtualTagActor.DependencyValueBatch msg)
{
var items = msg.Items;
for (var i = 0; i < items.Count; i++)
{
OnDependencyChanged(items[i]);
}
}
private void OnEngineEmission(EngineEmission msg)
{
var e = msg.Event;