Functions§
- read_
net_ dev - Total RX and TX bytes across all interfaces from
/proc/net/dev. Returns (rx_bytes, tx_bytes). Use with two samples and a time delta for rate. - read_
net_ dev_ for_ pid - Total RX and TX bytes for the process’s network namespace from
/proc/<pid>/net/dev. Same format as global; useful for per-process (actually per-namespace) traffic rate. - sample_
network_ rate - Sample RX/TX bytes per second for the process’s network namespace.