pub fn sample_network_rate(pid: i32) -> Option<(u64, u64)>Expand description
Sample RX/TX bytes per second for the process’s network namespace.
The sampling window is controlled by the PEEK_NET_SAMPLE_MS environment variable:
- If unset, a default of 1000ms (1s) is used.
- If set to
0, rate sampling is skipped andNoneis returned. - Otherwise, the value is interpreted as a window in milliseconds.
Returns (rx_bytes_per_sec, tx_bytes_per_sec).