fix(review): calc ReadOne reports an inputs-Bad publish; VT inputs-bad counter ticks only on a real report

This commit is contained in:
Joseph Doherty
2026-08-20 11:48:41 -04:00
parent 74794f4365
commit 886082fec7
6 changed files with 152 additions and 6 deletions
@@ -328,11 +328,14 @@ public sealed class VirtualTagActor : ReceiveActor
/// <param name="timestampUtc">The triggering change's timestamp, stamped on the result.</param>
private void OnInputsBad(uint worstInputStatus, DateTime timestampUtc)
{
OtOpcUaTelemetry.VirtualTagEval.Add(1, new KeyValuePair<string, object?>("outcome", "inputs-bad"));
if (!AllDependenciesArrived()) return;
if (_hasPublished && _lastPublishedStatus == worstInputStatus) return;
// Metered BELOW both guards, so the counter measures tags that actually REPORT Bad inputs. Above
// them it also counted every warm-up trigger — a dependency that has simply not arrived yet — which
// is ordinary cold start, and burying the real signal in it is how a counter stops being trusted.
OtOpcUaTelemetry.VirtualTagEval.Add(1, new KeyValuePair<string, object?>("outcome", "inputs-bad"));
_hasPublished = true;
_lastPublishedStatus = worstInputStatus;
Context.Parent.Tell(new EvaluationResult(