fix(monitoring): exclude unconfigured routes from domain activity aggregation
This commit is contained in:
@@ -792,7 +792,6 @@ export class MetricsManager {
|
||||
routeCount: number;
|
||||
requestCount: number;
|
||||
}>();
|
||||
const accountedRoutes = new Set<string>();
|
||||
|
||||
for (const [domain, routeNames] of domainToRoutes) {
|
||||
const domainReqs = domainRequestTotals.get(domain) || 0;
|
||||
@@ -801,7 +800,6 @@ export class MetricsManager {
|
||||
let totalOut = 0;
|
||||
|
||||
for (const routeName of routeNames) {
|
||||
accountedRoutes.add(routeName);
|
||||
const conns = connectionsByRoute.get(routeName) || 0;
|
||||
const tp = throughputByRoute.get(routeName) || { in: 0, out: 0 };
|
||||
const routeTotal = routeTotalRequests.get(routeName) || 0;
|
||||
@@ -821,29 +819,6 @@ export class MetricsManager {
|
||||
});
|
||||
}
|
||||
|
||||
// Include routes with no domain config (fallback: use route name)
|
||||
for (const [routeName, activeConns] of connectionsByRoute) {
|
||||
if (accountedRoutes.has(routeName)) continue;
|
||||
if (routeDomains.has(routeName)) continue;
|
||||
const tp = throughputByRoute.get(routeName) || { in: 0, out: 0 };
|
||||
if (activeConns === 0 && tp.in === 0 && tp.out === 0) continue;
|
||||
const existing = domainAgg.get(routeName);
|
||||
if (existing) {
|
||||
existing.activeConnections += activeConns;
|
||||
existing.bytesInPerSec += tp.in;
|
||||
existing.bytesOutPerSec += tp.out;
|
||||
existing.routeCount++;
|
||||
} else {
|
||||
domainAgg.set(routeName, {
|
||||
activeConnections: activeConns,
|
||||
bytesInPerSec: tp.in,
|
||||
bytesOutPerSec: tp.out,
|
||||
routeCount: 1,
|
||||
requestCount: 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const domainActivity = Array.from(domainAgg.entries())
|
||||
.map(([domain, data]) => ({
|
||||
domain,
|
||||
|
||||
Reference in New Issue
Block a user