feat(observability): make metrics collection optional and granular

Wrap metrics senders in Option and conditionally initialize the monitoring thread to support granular configuration and reduced overhead.
This commit is contained in:
Nils Andreas Svee committed 2026-04-13 15:22:15 +07:00
1 parent 671e3f2671
commit da3487e506
5 files changed
+76 -55

No files matched your search

+2 -2
View File
@@ -109,7 +109,7 @@ pub struct Ratecontroller {
state_dl: State,
state_ul: State,
up_direction: StatsDirection,
metrics_tx: SyncSender<Metric>,
metrics_tx: Option<SyncSender<Metric>>,
}
impl Ratecontroller {
@@ -248,7 +248,7 @@ impl Ratecontroller {
reselect_trigger: Sender<bool>,
down_direction: StatsDirection,
up_direction: StatsDirection,
metrics_tx: SyncSender<Metric>,
metrics_tx: Option<SyncSender<Metric>>,
) -> anyhow::Result<Self> {
let dl_qdisc = Netlink::qdisc_from_ifname(config.download_interface.as_str())?;
let dl_safe_rates =