fix(monitoring,remoteingress,web): Prune old metrics buckets periodically, clear metrics caches on shutdown, simplify edge disconnect handling, and optimize network view data updates

This commit is contained in:
2026-02-21 18:56:44 +00:00
parent 15da996e70
commit 82ce17a941
6 changed files with 34 additions and 25 deletions

View File

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

View File

@@ -110,6 +110,9 @@ export class MetricsManager {
this.securityMetrics.incidents = [];
this.securityMetrics.lastResetDate = currentDate;
}
// Prune old time-series buckets every minute (don't wait for lazy query)
this.pruneOldBuckets();
}, 60000); // Check every minute
logger.log('info', 'MetricsManager started');
@@ -123,6 +126,12 @@ export class MetricsManager {
}
this.smartMetrics.stop();
// Clear caches and time-series buckets on shutdown
this.metricsCache.clear();
this.emailMinuteBuckets.clear();
this.dnsMinuteBuckets.clear();
logger.log('info', 'MetricsManager stopped');
}

View File

@@ -35,11 +35,7 @@ export class TunnelManager {
});
this.hub.on('edgeDisconnected', (data: { edgeId: string }) => {
const existing = this.edgeStatuses.get(data.edgeId);
if (existing) {
existing.connected = false;
existing.activeTunnels = 0;
}
this.edgeStatuses.delete(data.edgeId);
});
this.hub.on('streamOpened', (data: { edgeId: string; streamId: number }) => {