08add2734f1b9e6fbed8ed66a7f5d50317bdf7f6
[pazpar2-moved-to-github.git] / perf / bash / par.sh
1 #!/bin/bash
2 DELAY=0.001
3 WAIT=5
4 NUMBER=10
5 ROUNDS=5
6 PORT=9004
7 SERVICE=perf
8 SHUTDOWN=1
9 if test -n "$1"; then
10         . $1
11 fi
12 let r=0
13 while test $r -lt $ROUNDS; do
14         echo "$r"
15         let i=0
16         while test $i -lt $NUMBER; do
17                 ./client.sh $r.$i $PORT $SERVICE >$r.$i.log 2>&1 &
18                 sleep $DELAY
19                 let i=$i+1
20         done
21         sleep $WAIT
22         let r=$r+1
23 done
24 wait
25 if [ "$SHUTDOWN" == "1" ] ; then 
26     wget -O x "http://localhost:${PORT}/search.pz2?command=exit"
27 fi