Skip to content

Instantly share code, notes, and snippets.

@adventureloop
Created November 28, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adventureloop/fb68d805696aeaf03c227f08cbe87947 to your computer and use it in GitHub Desktop.
Save adventureloop/fb68d805696aeaf03c227f08cbe87947 to your computer and use it in GitHub Desktop.
#!/bin/sh
hosts="137.50.17.13"
files="1m.data 1G.data"
files="1m.data"
files="1m.data 1m.data 1m.data 1m.data 1m.data 1m.data 1m.data 1m.data "
for host in $hosts
do
printf "host $host\n"
for file in $files
do
json=`cat $file | nc -M -N $host 2600 2>&1`
file_sz=`ls -l $file | awk '{print $5}'`
stat_gput=`echo $json | jq -r '.vois | .TCP_GPUT.stats.MAX.val'`
stat_txpb=`echo $json | jq -r '.vois | .TCP_TXPB.stats.SUM.val'`
stat_retr=`echo $json | jq -r '.vois | .TCP_RETXPB.stats.SUM.val'`
stat_rtt=`echo $json | jq -r '.vois | .TCP_RTT.stats.MAX.val'`
printf "\t${file}:\n"
printf "\t\t file size: $file_sz, transfer size: $stat_txpb (delta `qalc -t $file_sz - $stat_txpb`)\n"
printf "\t\t retransmitted $stat_retr\n"
# echo $json | jq -r '.vois | .TCP_RETXPB.stats'
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment