feat(metrics): add real-time throughput sampling and byte-counting metrics
This commit is contained in:
@@ -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.'
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user