Skip to content

Instantly share code, notes, and snippets.

@slashtechno
Created December 13, 2025 17:33
Show Gist options
  • Select an option

  • Save slashtechno/db4a0085e33b7bdb1dc9f61901e24632 to your computer and use it in GitHub Desktop.

Select an option

Save slashtechno/db4a0085e33b7bdb1dc9f61901e24632 to your computer and use it in GitHub Desktop.
View Docker/Podman container network IO in mbps
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