(_redundancyConfig.ServerUris)
};
}
///
- /// Generates the operator-facing HTML dashboard for the current bridge status.
+ /// Generates the operator-facing HTML dashboard for the current bridge status.
///
/// An HTML document containing the latest dashboard snapshot.
public string GenerateHtml()
@@ -146,16 +151,20 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
sb.AppendLine("");
sb.AppendLine("LmxOpcUa Status Dashboard
");
// Connection panel
- var connColor = data.Connection.State == "Connected" ? "green" : data.Connection.State == "Connecting" ? "yellow" : "red";
+ var connColor = data.Connection.State == "Connected" ? "green" :
+ data.Connection.State == "Connecting" ? "yellow" : "red";
sb.AppendLine($"Connection
");
- sb.AppendLine($"
State: {data.Connection.State} | Reconnects: {data.Connection.ReconnectCount} | Sessions: {data.Connection.ActiveSessions}
");
+ sb.AppendLine(
+ $"
State: {data.Connection.State} | Reconnects: {data.Connection.ReconnectCount} | Sessions: {data.Connection.ActiveSessions}
");
sb.AppendLine("
");
// Health panel
@@ -168,7 +177,8 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
{
var roleColor = data.Redundancy.Role == "Primary" ? "green" : "yellow";
sb.AppendLine($"Redundancy
");
- sb.AppendLine($"
Mode: {data.Redundancy.Mode} | Role: {data.Redundancy.Role} | Service Level: {data.Redundancy.ServiceLevel}
");
+ sb.AppendLine(
+ $"
Mode: {data.Redundancy.Mode} | Role: {data.Redundancy.Role} | Service Level: {data.Redundancy.ServiceLevel}
");
sb.AppendLine($"
Application URI: {data.Redundancy.ApplicationUri}
");
sb.AppendLine($"
Redundant Set: {string.Join(", ", data.Redundancy.ServerUris)}
");
sb.AppendLine("
");
@@ -181,25 +191,30 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
// Data Change Dispatch panel
sb.AppendLine("Data Change Dispatch
");
- sb.AppendLine($"
Events/sec: {data.DataChange.EventsPerSecond:F1} | Avg Batch Size: {data.DataChange.AvgBatchSize:F1} | Pending: {data.DataChange.PendingItems} | Total Events: {data.DataChange.TotalEvents:N0}
");
+ sb.AppendLine(
+ $"
Events/sec: {data.DataChange.EventsPerSecond:F1} | Avg Batch Size: {data.DataChange.AvgBatchSize:F1} | Pending: {data.DataChange.PendingItems} | Total Events: {data.DataChange.TotalEvents:N0}
");
sb.AppendLine("
");
// Galaxy Info panel
sb.AppendLine("Galaxy Info
");
- sb.AppendLine($"
Galaxy: {data.Galaxy.GalaxyName} | DB: {(data.Galaxy.DbConnected ? "Connected" : "Disconnected")}
");
- sb.AppendLine($"
Last Deploy: {data.Galaxy.LastDeployTime:O} | Objects: {data.Galaxy.ObjectCount} | Attributes: {data.Galaxy.AttributeCount}
");
+ sb.AppendLine(
+ $"
Galaxy: {data.Galaxy.GalaxyName} | DB: {(data.Galaxy.DbConnected ? "Connected" : "Disconnected")}
");
+ sb.AppendLine(
+ $"
Last Deploy: {data.Galaxy.LastDeployTime:O} | Objects: {data.Galaxy.ObjectCount} | Attributes: {data.Galaxy.AttributeCount}
");
sb.AppendLine($"
Last Rebuild: {data.Galaxy.LastRebuildTime:O}
");
sb.AppendLine("
");
// Operations table
sb.AppendLine("Operations
");
- sb.AppendLine("
| Operation | Count | Success Rate | Avg (ms) | Min (ms) | Max (ms) | P95 (ms) |
");
+ sb.AppendLine(
+ "| Operation | Count | Success Rate | Avg (ms) | Min (ms) | Max (ms) | P95 (ms) |
");
foreach (var kvp in data.Operations)
{
var s = kvp.Value;
sb.AppendLine($"| {kvp.Key} | {s.TotalCount} | {s.SuccessRate:P1} | " +
- $"{s.AverageMilliseconds:F1} | {s.MinMilliseconds:F1} | {s.MaxMilliseconds:F1} | {s.Percentile95Milliseconds:F1} |
");
+ $"{s.AverageMilliseconds:F1} | {s.MinMilliseconds:F1} | {s.MaxMilliseconds:F1} | {s.Percentile95Milliseconds:F1} | ");
}
+
sb.AppendLine("
");
// Footer
@@ -212,7 +227,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
}
///
- /// Generates an indented JSON status payload for API consumers.
+ /// Generates an indented JSON status payload for API consumers.
///
/// A JSON representation of the current dashboard snapshot.
public string GenerateJson()
@@ -222,9 +237,9 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
}
///
- /// Determines whether the bridge should currently be considered healthy for the dashboard health endpoint.
+ /// Determines whether the bridge should currently be considered healthy for the dashboard health endpoint.
///
- /// when the bridge meets the health policy; otherwise, .
+ /// when the bridge meets the health policy; otherwise, .
public bool IsHealthy()
{
var state = _mxAccessClient?.State ?? ConnectionState.Disconnected;
@@ -232,7 +247,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
}
///
- /// Builds the rich health endpoint data including component health, ServiceLevel, and redundancy state.
+ /// Builds the rich health endpoint data including component health, ServiceLevel, and redundancy state.
///
public HealthEndpointData GetHealthData()
{
@@ -250,7 +265,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
{
MxAccess = connectionState.ToString(),
Database = dbConnected ? "Connected" : "Disconnected",
- OpcUaServer = (_serverHost?.IsRunning ?? false) ? "Running" : "Stopped"
+ OpcUaServer = _serverHost?.IsRunning ?? false ? "Running" : "Stopped"
},
Uptime = FormatUptime(uptime),
Timestamp = DateTime.UtcNow
@@ -278,7 +293,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
}
///
- /// Generates the JSON payload for the /api/health endpoint.
+ /// Generates the JSON payload for the /api/health endpoint.
///
public string GenerateHealthJson()
{
@@ -287,7 +302,7 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
}
///
- /// Generates a focused health status HTML page for operators and monitoring dashboards.
+ /// Generates a focused health status HTML page for operators and monitoring dashboards.
///
public string GenerateHealthHtml()
{
@@ -304,13 +319,17 @@ namespace ZB.MOM.WW.LmxOpcUa.Host.Status
sb.AppendLine($"");
sb.AppendLine("LmxOpcUa Health");
sb.AppendLine("