feat(lmxproxy): add delivered/dropped message counts to subscription stats

Subscription metrics (totalDelivered, totalDropped) now visible in
/api/status JSON and HTML dashboard. Card turns yellow if drops > 0.
Aggregated from per-client counters in SubscriptionManager.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-23 00:07:58 -04:00
parent 59d143e4c8
commit 7f74b660b3
4 changed files with 29 additions and 4 deletions
@@ -96,7 +96,9 @@ namespace ZB.MOM.WW.LmxProxy.Host.Status
{
TotalClients = subStats.TotalClients,
TotalTags = subStats.TotalTags,
ActiveSubscriptions = subStats.ActiveSubscriptions
ActiveSubscriptions = subStats.ActiveSubscriptions,
TotalDelivered = subStats.TotalDelivered,
TotalDropped = subStats.TotalDropped
};
// Performance stats
@@ -216,11 +218,17 @@ namespace ZB.MOM.WW.LmxProxy.Host.Status
sb.AppendLine(" </div></div>");
// Subscriptions card
sb.AppendLine(" <div class=\"grid-item\"><div class=\"card card-green\">");
var subCardCss = statusData.Subscriptions.TotalDropped > 0 ? "card-yellow" : "card-green";
sb.AppendLine($" <div class=\"grid-item\"><div class=\"card {subCardCss}\">");
sb.AppendLine(" <h3>Subscriptions</h3>");
sb.AppendLine($" <p><strong>Clients:</strong> {statusData.Subscriptions.TotalClients}</p>");
sb.AppendLine($" <p><strong>Tags:</strong> {statusData.Subscriptions.TotalTags}</p>");
sb.AppendLine($" <p><strong>Active:</strong> {statusData.Subscriptions.ActiveSubscriptions}</p>");
sb.AppendLine($" <p><strong>Delivered:</strong> {statusData.Subscriptions.TotalDelivered:N0}</p>");
if (statusData.Subscriptions.TotalDropped > 0)
{
sb.AppendLine($" <p style=\"color:red\"><strong>Dropped:</strong> {statusData.Subscriptions.TotalDropped:N0}</p>");
}
sb.AppendLine(" </div></div>");
sb.AppendLine(" </div>");