Files
lmxopcua/src/Core/ZB.MOM.WW.OtOpcUa.Commons/Interfaces/DataConnectionDiagnosticsSnapshot.cs
T
Joseph Doherty 005720bd02 fix(grpc-data): H4 review 2 — a fresh origin reports 'no peer traffic yet', not 'unavailable'
The origin services are composed on the first peer call (they need the driver host actor), so
CaptureOrigin returned null until then and a fresh H4 origin read like a pre-H4 build. The DI
singleton now probes the same deferred history port for backend availability and reports zeros
with PeerServicesStarted=false; the page says 'no peer has called since start'.
2026-11-24 08:37:38 -05:00

66 lines
3.4 KiB
C#

using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.Commons.Interfaces;
/// <summary>Bounded, secret-free evidence from one node's applied data connection.</summary>
/// <remarks>Nullable measures mean that evidence is unavailable, rather than zero activity.</remarks>
public sealed record DataConnectionDiagnosticsSnapshot(
string ConnectionId,
long Revision,
string State,
string? SelectedEndpoint,
ServingIdentity? Serving,
int ActiveStreams,
int ActiveCalls,
long ScopeVersion,
string ArtifactRevision,
DateTime AsOfUtc,
DateTime? LastSampleAtUtc = null,
DateTime? MetadataLeaseExpiresAtUtc = null,
int? SourceCount = null,
int? RegistrationCount = null,
long? ResetCount = null,
long? OverflowCount = null,
long? WriteSucceededCount = null,
long? WriteRejectedCount = null,
long? WriteUnknownCount = null,
int? ProtocolMajor = null,
int? ProtocolMinor = null,
DateTime? LastVerifiedAtUtc = null,
long? WriteFailedCount = null,
long? WriteUnconfirmedCount = null,
TimeSpan? SampleAgeUpperBound = null,
long? CoalescedCount = null,
long? CompactFrameCount = null,
long? FallbackFrameCount = null,
long? SerializedValueFrameBytes = null,
string? AccountingInstanceId = null,
// X0 tolerant reader: operation bits this connection row was authored with that this node does not implement and
// dropped (None = nothing dropped; null = from an older sender), and how many of its mappings had bits dropped.
DataOperations? DroppedUnknownOperations = null,
int? MappingsWithDroppedOperations = null,
// H4 consumer-side history evidence: the features the last capability handshake negotiated (None = v1 behaviour), the
// history variants and aggregate count the origin advertised to this caller, projected HistoryRead results by status
// class (per node, as answered to local OPC UA clients) and the remote continuations held in local sessions.
DataFeatures? NegotiatedFeatures = null,
IReadOnlyList<string>? HistoryVariants = null,
int? HistoryAggregateCount = null,
long? HistoryReadsGood = null,
long? HistoryReadsUncertain = null,
long? HistoryReadsBad = null,
int? OpenRemoteContinuations = null);
/// <summary>H4 origin-side remote-history evidence for one node (what it serves to peers over data connections).</summary>
/// <param name="Available">The node has a historian backend and can serve remote history.</param>
/// <param name="Sessions">Live peer history sessions.</param>
/// <param name="OpenContinuations">Origin continuations (page cursors and chunk remainders) held for peers.</param>
/// <param name="ReadsGood">Remote history items answered Good since process start.</param>
/// <param name="ReadsUncertain">Remote history items answered Uncertain since process start.</param>
/// <param name="ReadsBad">Remote history items answered Bad (including refusals) since process start.</param>
/// <param name="PeerServicesStarted">
/// False while no peer has called this node since start: the origin data services are created on the first peer call, so
/// the zeros are "no peer traffic yet", not missing evidence. True once they run (and from a sender that predates the flag).
/// </param>
public sealed record OriginHistoryDiagnostics(bool Available, int Sessions, int OpenContinuations, long ReadsGood,
long ReadsUncertain, long ReadsBad, bool PeerServicesStarted = true);