add benchmark script

This commit is contained in:
Nico Schottelius 2019-08-15 12:16:27 +02:00
parent ac38268965
commit b354a2479b

37
bin/run-benchmark.sh Executable file
View file

@ -0,0 +1,37 @@
#!/bin/sh
set -x
if [ $# -ne 2 ]; then
echo "$0 host ip"
echo "host and ip of the iperf server"
fi
host=$1; shift
port=$1; shift
flags="-p $port -O 10 -t 190"
fbase="iperf-to-${host}"
if echo $host | grep -q ':'; then
flags="$flags -6"
fbase="${fbase}-from-v6"
else
flags="$flags -4"
fbase="${fbase}-from-v4"
fi
do_benchmark()
{
full_flags="$@"
iperf3_flags=$(echo $flags | sed 's/ //g')
filename="${fbase}-${iperf3_flags}"
iperf3 $flags -P$p | tee "${filename}"
}
for p in 1 10 20 50; do
do_benchmark $flags -P$p
do_benchmark $flags -P$p -u -b0
done