[opcuaclient] OpcUaClient — Diagnostics counters #334
Reference in New Issue
Block a user
Delete Branch "auto/opcuaclient/4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Per-driver diagnostics counters for the OpcUaClient driver, surfaced via the established
DriverHealth.Diagnosticsshape so the existingdriver-diagnosticsRPC pattern (Modbus task #154) can consume them without per-driver wiring.Core.Abstractions/DriverHealth.cs— optional 4th parameterIReadOnlyDictionary<string,double>? Diagnostics(defaultnull). Back-compat with the seven existing driver constructors. NewDiagnosticsOrEmptyaccessor.OpcUaClientDiagnostics.cs(new) — lock-free counter helper:PublishRequestCount,NotificationCount,MissingPublishRequestCount,DroppedNotificationCount,SessionResetCount,LastReconnectUtcTicksviaInterlockedNotificationsPerSecond— 5-second half-life EWMAOpcUaClientDriver.cs— wiresISession.Notification+ISession.PublishErroron connect, unwires on shutdown, rewires (and records a session-reset) onOnReconnectComplete.GetHealth()snapshots the counters into theDiagnosticsdictionary on every poll.Test plan
dotnet build Core.Abstractions + Driver.OpcUaClient + tests project— clean (0 / 0)dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Tests— 115 / 115 passed (11 new inOpcUaClientDiagnosticsTests: counter increments, EWMA decay/sample, session-reset on reconnect, snapshot dictionary keys, hot-path lock-free)🤖 Auto-generated by the Mode-B execution loop. Closes #276.
Closes #276