Connected: {statusData.Connection.IsConnected}
"); + sb.AppendLine($"State: {statusData.Connection.State}
"); + if (!string.IsNullOrEmpty(statusData.Connection.NodeName)) + sb.AppendLine($"Node: {statusData.Connection.NodeName}
"); + if (!string.IsNullOrEmpty(statusData.Connection.GalaxyName)) + sb.AppendLine($"Galaxy: {statusData.Connection.GalaxyName}
"); + sb.AppendLine("{statusData.Health.Status}
"); + sb.AppendLine($"{statusData.Health.Description}
"); + sb.AppendLine("Clients: {statusData.Subscriptions.TotalClients}
"); + sb.AppendLine($"Tags: {statusData.Subscriptions.TotalTags}
"); + sb.AppendLine($"Active: {statusData.Subscriptions.ActiveSubscriptions}
"); + sb.AppendLine("| Operation | Count | Success Rate | Avg (ms) | Min (ms) | Max (ms) | P95 (ms) |
|---|---|---|---|---|---|---|
| {op.Key} | " + + $"{op.Value.TotalCount} | " + + $"{op.Value.SuccessRate:P1} | " + + $"{op.Value.AverageMilliseconds:F1} | " + + $"{op.Value.MinMilliseconds:F1} | " + + $"{op.Value.MaxMilliseconds:F1} | " + + $"{op.Value.Percentile95Milliseconds:F1} | " + + $"
{statusData.DetailedHealth.Status}
"); + sb.AppendLine($"{statusData.DetailedHealth.Description}
"); + sb.AppendLine("{ex.Message}
"); + sb.AppendLine(""); + return sb.ToString(); + } + } +} diff --git a/lmxproxy/src/ZB.MOM.WW.LmxProxy.Host/Status/StatusWebServer.cs b/lmxproxy/src/ZB.MOM.WW.LmxProxy.Host/Status/StatusWebServer.cs new file mode 100644 index 0000000..a3b44f7 --- /dev/null +++ b/lmxproxy/src/ZB.MOM.WW.LmxProxy.Host/Status/StatusWebServer.cs @@ -0,0 +1,215 @@ +using System; +using System.Net; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Serilog; +using ZB.MOM.WW.LmxProxy.Host.Configuration; + +namespace ZB.MOM.WW.LmxProxy.Host.Status +{ + ///