feat(runtime): HistorianAdapter + PeerOpcUaProbe + DbHealthProbe actors (engine wiring tracked as F11/F12)

This commit is contained in:
Joseph Doherty
2026-05-26 05:09:06 -04:00
parent e115f13104
commit 28639cb14d
4 changed files with 194 additions and 0 deletions
@@ -0,0 +1,32 @@
using Akka.Actor;
using Akka.Event;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Historian;
/// <summary>
/// Wraps the named-pipe IPC to the Wonderware historian sidecar with a store-and-forward
/// SQLite buffer for pipe outages. Engine wiring (named-pipe client + <c>SqliteStoreAndForwardSink</c>)
/// is staged for follow-up F11.
/// </summary>
public sealed class HistorianAdapterActor : ReceiveActor
{
public sealed record HistoryRow(string Source, string AttributeId, object? Value, DateTime TimestampUtc);
private readonly ILoggingAdapter _log = Context.GetLogger();
private int _buffered;
public int BufferedCount => _buffered;
public static Props Props() => Akka.Actor.Props.Create(() => new HistorianAdapterActor());
public HistorianAdapterActor()
{
Receive<HistoryRow>(row =>
{
// F11: dispatch to named-pipe sink; on disconnect → buffer in SQLite.
Interlocked.Increment(ref _buffered);
_log.Debug("Historian: buffered row for {Source}/{Attr} (sink wiring staged for F11)",
row.Source, row.AttributeId);
});
}
}