add benchmark script
This commit is contained in:
parent
ac38268965
commit
b354a2479b
1 changed files with 37 additions and 0 deletions
37
bin/run-benchmark.sh
Executable file
37
bin/run-benchmark.sh
Executable 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
|
Loading…
Reference in a new issue