Surface historian plugin and alarm-tracking health in the status dashboard so operators can detect misconfiguration and runtime degradation that previously showed as fully healthy
Wraps the 4 HistoryRead overrides and OnAlarmAcknowledge with PerformanceMetrics.BeginOperation, adds alarm counters to LmxNodeManager, publishes a structured HistorianPluginOutcome from HistorianPluginLoader, and extends HealthCheckService with plugin-load, history-read, and alarm-ack-failure degradation rules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,9 +108,65 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Status
|
||||
json.ShouldContain("Subscriptions");
|
||||
json.ShouldContain("Galaxy");
|
||||
json.ShouldContain("Operations");
|
||||
json.ShouldContain("Historian");
|
||||
json.ShouldContain("Alarms");
|
||||
json.ShouldContain("Footer");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The dashboard JSON exposes the historian plugin status so operators can distinguish
|
||||
/// "disabled by config" from "plugin crashed on load."
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GenerateJson_Historian_IncludesPluginStatus()
|
||||
{
|
||||
var sut = CreateService();
|
||||
var json = sut.GenerateJson();
|
||||
|
||||
json.ShouldContain("PluginStatus");
|
||||
json.ShouldContain("PluginPath");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The dashboard JSON exposes alarm counters so operators can see transition/ack activity.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GenerateJson_Alarms_IncludesCounters()
|
||||
{
|
||||
var sut = CreateService();
|
||||
var json = sut.GenerateJson();
|
||||
|
||||
json.ShouldContain("TrackingEnabled");
|
||||
json.ShouldContain("TransitionCount");
|
||||
json.ShouldContain("AckWriteFailures");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Historian and Alarms panels render in the HTML dashboard.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GenerateHtml_IncludesHistorianAndAlarmPanels()
|
||||
{
|
||||
var sut = CreateService();
|
||||
var html = sut.GenerateHtml();
|
||||
|
||||
html.ShouldContain("<h2>Historian</h2>");
|
||||
html.ShouldContain("<h2>Alarms</h2>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The /api/health payload exposes Historian and Alarms component status.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetHealthData_Components_IncludeHistorianAndAlarms()
|
||||
{
|
||||
var sut = CreateService();
|
||||
var data = sut.GetHealthData();
|
||||
|
||||
data.Components.Historian.ShouldNotBeNullOrEmpty();
|
||||
data.Components.Alarms.ShouldNotBeNullOrEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the report service reports healthy when the runtime connection is up.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user