feat(observability): export rate and load metrics from rate controller
Send rates, load statistics, and delay deltas via the metrics channel to enable real-time monitoring of network performance.
This commit is contained in:
1 file changed
+12
@@ -409,6 +409,18 @@ impl Ratecontroller {
|
||||
self.state_ul.current_rate as u64
|
||||
);
|
||||
|
||||
if let Some(ref tx) = self.metrics_tx {
|
||||
let _ = tx.try_send(Metric::Rate {
|
||||
dl_rate: self.state_dl.current_rate,
|
||||
ul_rate: self.state_ul.current_rate,
|
||||
rx_load: self.state_dl.load,
|
||||
tx_load: self.state_ul.load,
|
||||
delta_delay_down: self.state_dl.delta_stat,
|
||||
delta_delay_up: self.state_ul.delta_stat,
|
||||
timestamp_ns: stats_time.as_nanos(),
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(ref mut fd) = stats_fd {
|
||||
if let Err(e) = fd.write_all(
|
||||
format!(
|
||||
|
||||
Reference in new issue
Block a user