[benchmark] Do three runs

This commit is contained in:
Nico Schottelius 2019-08-15 12:26:49 +02:00
parent 7ecf78aa6c
commit 574c060de0
1 changed files with 8 additions and 6 deletions

View File

@ -2,16 +2,17 @@
set -x set -x
if [ $# -ne 2 ]; then if [ $# -ne 3 ]; then
echo "$0 host ip" echo "$0 prefix host ip"
echo "host and ip of the iperf server" echo "host and ip of the iperf server"
fi fi
prefix=$1; shift
host=$1; shift host=$1; shift
port=$1; shift port=$1; shift
flags="-c ${host} -p $port -O 10 -t 190" flags="-c ${host} -p $port -O 10 -t 190"
fbase="iperf" fbase="iperf-${prefix}"
if echo $host | grep -q ':'; then if echo $host | grep -q ':'; then
flags="$flags -6" flags="$flags -6"
@ -25,10 +26,11 @@ do_benchmark()
{ {
full_flags="$@" full_flags="$@"
iperf3_flags=$(echo $full_flags | sed 's/ //g') iperf3_flags=$(echo $full_flags | sed 's/ //g')
filename="${fbase}-${iperf3_flags}"
iperf3 $full_flags | tee "${filename}"
for run in 1 2 3; do
filename="${fbase}${iperf3_flags}-run${run}"
iperf3 $full_flags | tee "${filename}"
done
} }
for p in 1 10 20 50; do for p in 1 10 20 50; do