Skip to main content

update_networkd_stats

Function update_networkd_stats 

Source
pub async fn update_networkd_stats(
    states_path: PathBuf,
    maybe_network_int_to_name: Option<HashMap<i32, String>>,
    sysfs_root: PathBuf,
    maybe_dbus: Option<(Arc<OnceCell<Connection>>, u64)>,
    locked_machine_stats: Arc<RwLock<MachineStats>>,
) -> Result<()>
Expand description

Async wrapper than can update networkd stats when passed a locked struct.

sysfs_root backs the sysfs ifindex map (normally /sys; container collection passes /proc/<leader>/root/sys). Takes the shared D-Bus cell rather than a connection: the sysfs map serves the file fallback without ever connecting, and the cell is resolved only when sysfs yields nothing usable — the same lazy pattern as update_boot_blame_stats.