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:
Nils Andreas Svee committed 2026-04-13 15:22:24 +07:00
1 parent da3487e506
commit d1ea0d0238
1 file changed
+12
+12
View File
@@ -409,6 +409,18 @@ impl Ratecontroller {
self.state_ul.current_rate as u64 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 Some(ref mut fd) = stats_fd {
if let Err(e) = fd.write_all( if let Err(e) = fd.write_all(
format!( format!(