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

View File

@@ -242,10 +242,20 @@ namespace ZB.MOM.WW.LmxProxy.Host.Subscriptions
/// <summary>Returns subscription statistics.</summary>
public SubscriptionStats GetStats()
{
long totalDelivered = 0;
long totalDropped = 0;
foreach (var kvp in _clientSubscriptions)
{
totalDelivered += kvp.Value.DeliveredCount;
totalDropped += kvp.Value.DroppedCount;
}
return new SubscriptionStats(
_clientSubscriptions.Count,
_tagSubscriptions.Count,
_clientSubscriptions.Values.Sum(c => c.Addresses.Count));
_clientSubscriptions.Values.Sum(c => c.Addresses.Count),
totalDelivered,
totalDropped);
}
public void Dispose()