feat(metrics): add real-time throughput sampling and byte-counting metrics

This commit is contained in:
2026-02-13 23:18:22 +00:00
parent 37372353d7
commit 1f95d2b6c4
17 changed files with 1109 additions and 228 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartproxy',
version: '25.0.0',
version: '25.1.0',
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
}

View File

@@ -89,7 +89,10 @@ export class RustMetricsAdapter implements IMetrics {
};
},
recent: (): IThroughputData => {
return this.throughput.instant();
return {
in: this.cache?.throughputRecentInBytesPerSec ?? 0,
out: this.cache?.throughputRecentOutBytesPerSec ?? 0,
};
},
average: (): IThroughputData => {
return this.throughput.instant();

View File

@@ -396,6 +396,7 @@ export class SmartProxy extends plugins.EventEmitter {
extendedKeepAliveLifetime: this.settings.extendedKeepAliveLifetime,
acceptProxyProtocol: this.settings.acceptProxyProtocol,
sendProxyProtocol: this.settings.sendProxyProtocol,
metrics: this.settings.metrics,
};
}