Skip to main content

Module bandwidth

Module bandwidth 

Source
Expand description

System-wide bandwidth estimation.

Reads network interface byte counters and computes RX/TX rates.

  • Linux: parses /proc/net/dev
  • macOS: parses netstat -ib

The first sample has no delta, so the rate is None.

Structs§

BandwidthRate
Bandwidth measurement: bytes per second for RX and TX.
BandwidthTracker
Tracks bandwidth by sampling byte counters.

Functions§

format_rate
Format bytes/sec as human-readable string (e.g. “1.2 MB/s”).