fix(grpc-data): A4 review r1 — AdminUI helpers null-safe + doc comments restored; metric descriptions name both sides; docs: S1/S2/S3 behaviour, RefreshRequired only on a changed incomplete set, SourceName vs runtime status (S4), scripted Good = applied, A4-docs citations
This commit is contained in:
@@ -242,22 +242,22 @@ public static class OtOpcUaTelemetry
|
||||
/// <summary>A2: origin root-scoped condition items currently open (plan §6 metrics).</summary>
|
||||
public static readonly UpDownCounter<long> DataConnConditionItems =
|
||||
Meter.CreateUpDownCounter<long>("otopcua.dataconn.conditions.items", unit: "{item}",
|
||||
description: "Open root-scoped condition items on this origin.");
|
||||
description: "Open condition items (tag side: origin = root-scoped items served to peers; consumer = items its condition streams hold open).");
|
||||
|
||||
/// <summary>A2: condition-item re-snapshots after a hub reader reset (records evicted before the item read them).</summary>
|
||||
public static readonly Counter<long> DataConnConditionResyncs =
|
||||
Meter.CreateCounter<long>("otopcua.dataconn.conditions.resyncs", unit: "{resync}",
|
||||
description: "Root-scoped condition items re-snapshotted after a condition-state hub reader reset.");
|
||||
description: "Condition resyncs (tag side: origin = an item re-snapshotted after a condition-state hub reader reset; consumer = a condition stream that opened and ended).");
|
||||
|
||||
/// <summary>A2: root-scoped condition items whose listing exceeded the item's MaxConditions (total reported, no records).</summary>
|
||||
public static readonly Counter<long> DataConnConditionCapacityRejections =
|
||||
Meter.CreateCounter<long>("otopcua.dataconn.conditions.capacity_rejections", unit: "{item}",
|
||||
description: "Root-scoped condition items over their MaxConditions at snapshot begin.");
|
||||
description: "Condition capacity rejections (tag side: origin = an item over its MaxConditions at snapshot begin; consumer = a mapping reset to ConditionCapacity).");
|
||||
|
||||
/// <summary>A2b: remote condition method calls served by this origin, by method and outcome (plan §6 metrics; no ids).</summary>
|
||||
public static readonly Counter<long> DataConnConditionMethods =
|
||||
Meter.CreateCounter<long>("otopcua.dataconn.condition_methods", unit: "{call}",
|
||||
description: "Remote condition method calls served by this origin (tags: method, outcome).");
|
||||
description: "Remote condition method calls (tags: method, outcome, side: origin = served, consumer = forwarded).");
|
||||
|
||||
/// <summary>A1 (G3): deferred MarkConditionsKnown discarded because an alarm projection of the same source did not land.</summary>
|
||||
public static readonly Counter<long> DataConnConditionMarksDiscarded =
|
||||
|
||||
@@ -62,7 +62,6 @@ public static class DataConnectionDiagnostics
|
||||
{ } b => Bits((uint)(int)b, bit => Enum.IsDefined((DataOperations)(int)bit) ? DataOperationAuthoring.Label((DataOperations)(int)bit) : null),
|
||||
};
|
||||
|
||||
/// <summary>#919: true when the drop deserves the "node build is older than the authored feature" hint.</summary>
|
||||
/// <summary>A4 §6: a count against its limit is a warning at or above 80 % (the budget the plan sizes defaults by).</summary>
|
||||
public static bool NearLimit(long observed, long limit) => limit > 0 && observed * 10 >= limit * 8;
|
||||
|
||||
@@ -84,10 +83,12 @@ public static class DataConnectionDiagnostics
|
||||
/// <summary>A4: whether any part of the connection's condition evidence warrants the notice style.</summary>
|
||||
public static bool ConditionsNeedAttention(ConsumerConditionDiagnostics? c) => c is not null
|
||||
&& (NearLimit(c.ChargedConditions, c.HostConditionLimit)
|
||||
|| c.Mappings.Any(m => NearLimit(m.Observed, m.Limit) || m.Status is "Unavailable" or "ConditionCapacity"));
|
||||
|| (c.Mappings?.Any(m => m is not null && (NearLimit(m.Observed, m.Limit) || m.Status is "Unavailable" or "ConditionCapacity")) ?? false));
|
||||
|
||||
public static string MethodCounts(ConditionMethodCounts m) =>
|
||||
$"succeeded {m.Succeeded} · rejected {m.Rejected} · failed {m.Failed} · unknown {m.Unknown}";
|
||||
/// <summary>A4: method outcome classes; "unavailable" when a (partial) payload carries none (review r1 NIT: never throws).</summary>
|
||||
public static string MethodCounts(ConditionMethodCounts? m) => m is null
|
||||
? "unavailable"
|
||||
: $"succeeded {m.Succeeded} · rejected {m.Rejected} · failed {m.Failed} · unknown {m.Unknown}";
|
||||
|
||||
/// <summary>A4: the origin's served-conditions line.</summary>
|
||||
public static string OriginConditions(OriginConditionDiagnostics? o) => o is null
|
||||
@@ -99,6 +100,7 @@ public static class DataConnectionDiagnostics
|
||||
+ $" · state unknown (unsignalled) {(o.UnsignalledConditions is { } u ? u.ToString() : "unavailable")}"
|
||||
+ $" · methods served {MethodCounts(o.Methods)}";
|
||||
|
||||
/// <summary>#919: true when the drop deserves the "node build is older than the authored feature" hint.</summary>
|
||||
public static bool HasDrops(DataOperations? bits, int? mappings = null) => bits is { } b && b != DataOperations.None || mappings is > 0;
|
||||
|
||||
public static string Endpoint(string? value) => Uri.TryCreate(value, UriKind.Absolute, out var uri)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ namespace ZB.MOM.WW.OtOpcUa.Runtime.DataConnections;
|
||||
/// <item><c>otopcua.dataconn.conditions.items{side}</c> — open condition items: origin = root-scoped items served to peers;
|
||||
/// consumer = the items its condition streams hold open (one per acked mapping).</item>
|
||||
/// <item><c>otopcua.dataconn.conditions.resyncs{side}</c> — origin: an item re-snapshotted after a hub reader reset;
|
||||
/// consumer: a condition stream that ended (it re-snapshots on the next).</item>
|
||||
/// consumer: a condition stream that opened and ended (it re-snapshots on the next; a failed connect attempt is not counted).</item>
|
||||
/// <item><see cref="RefreshRequiredCounterName"/><c>{side=consumer}</c> — RefreshRequired requests the consumer runtime
|
||||
/// made (an incomplete barrier with a changed incomplete set, a capacity reset that removed nothing, each removal batch).</item>
|
||||
/// <item><c>otopcua.dataconn.conditions.capacity_rejections{side}</c> — origin: an item snapshot over its limit; consumer: a
|
||||
|
||||
Reference in New Issue
Block a user