fix(monitoring): stop allocating route metrics to domains when no request data exists

This commit is contained in:
2026-04-13 19:15:46 +00:00
parent 835537f789
commit cdc77305e5
4 changed files with 9 additions and 16 deletions

View File

@@ -1,5 +1,11 @@
# Changelog # Changelog
## 2026-04-13 - 13.17.1 - fix(monitoring)
stop allocating route metrics to domains when no request data exists
- Removes the equal-split fallback for shared routes in MetricsManager.
- Sets the proportional share to zero when a route has no recorded requests, avoiding inflated per-domain connection and throughput totals.
## 2026-04-13 - 13.17.0 - feat(monitoring,network-ui,routes) ## 2026-04-13 - 13.17.0 - feat(monitoring,network-ui,routes)
add request-based domain activity metrics and split routes into user and system views add request-based domain activity metrics and split routes into user and system views

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/dcrouter', name: '@serve.zone/dcrouter',
version: '13.17.0', version: '13.17.1',
description: 'A multifaceted routing service handling mail and SMS delivery functions.' description: 'A multifaceted routing service handling mail and SMS delivery functions.'
} }

View File

@@ -806,20 +806,7 @@ export class MetricsManager {
const tp = throughputByRoute.get(routeName) || { in: 0, out: 0 }; const tp = throughputByRoute.get(routeName) || { in: 0, out: 0 };
const routeTotal = routeTotalRequests.get(routeName) || 0; const routeTotal = routeTotalRequests.get(routeName) || 0;
// Proportional share based on actual request counts const share = routeTotal > 0 ? domainReqs / routeTotal : 0;
// Fall back to equal split only when no request data exists
let share: number;
if (routeTotal > 0 && domainReqs > 0) {
share = domainReqs / routeTotal;
} else {
// Count how many resolved domains share this route
let domainsInRoute = 0;
for (const [, routes] of domainToRoutes) {
if (routes.includes(routeName)) domainsInRoute++;
}
share = 1 / Math.max(domainsInRoute, 1);
}
totalConns += conns * share; totalConns += conns * share;
totalIn += tp.in * share; totalIn += tp.in * share;
totalOut += tp.out * share; totalOut += tp.out * share;

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/dcrouter', name: '@serve.zone/dcrouter',
version: '13.17.0', version: '13.17.1',
description: 'A multifaceted routing service handling mail and SMS delivery functions.' description: 'A multifaceted routing service handling mail and SMS delivery functions.'
} }