Skip to main content

Module net

Module net 

Source

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.