fix(metrics): fix metrics

This commit is contained in:
Juergen Kunz
2025-06-23 13:19:39 +00:00
parent 7bf15e72f9
commit 82ca0381e9
3 changed files with 71 additions and 122 deletions

View File

@ -49,8 +49,8 @@ export interface IMetrics {
average(): IThroughputData; // Last 60 seconds
custom(seconds: number): IThroughputData;
history(seconds: number): Array<IThroughputHistoryPoint>;
byRoute(windowSeconds?: number): Map<string, IThroughputData>;
byIP(windowSeconds?: number): Map<string, IThroughputData>;
byRoute(windowSeconds?: number): Map<string, IThroughputData>; // Default: 1 second
byIP(windowSeconds?: number): Map<string, IThroughputData>; // Default: 1 second
};
// Request metrics
@ -109,10 +109,4 @@ export interface IByteTracker {
bytesOut: number;
startTime: number;
lastUpdate: number;
// Track bytes at window boundaries for rate calculation
windowSnapshots?: Array<{
timestamp: number;
bytesIn: number;
bytesOut: number;
}>;
}