Created
December 13, 2025 17:33
-
-
Save slashtechno/db4a0085e33b7bdb1dc9f61901e24632 to your computer and use it in GitHub Desktop.
View Docker/Podman container network IO in mbps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while sleep 1; do | |
| docker stats --no-stream --format "{{.Name}} {{.NetIO}}" \ | |
| | awk ' | |
| { | |
| split($2,rx,"/"); | |
| split($3,tx," "); | |
| gsub(/MB|GB/,"",rx[1]); gsub(/MB|GB/,"",tx[1]); | |
| rx_mbps = (rx[1]-prev_rx[$1])*8; | |
| tx_mbps = (tx[1]-prev_tx[$1])*8; | |
| printf "%-25s RX: %6.2f Mbps TX: %6.2f Mbps\n", $1, rx_mbps, tx_mbps; | |
| prev_rx[$1]=rx[1]; | |
| prev_tx[$1]=tx[1]; | |
| }' | |
| echo | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment