881e171209f051aa70a2506e3e80cda20b02c69f
[pazpar2-moved-to-github.git] / perf / bash / par.sh
1 #!/bin/bash
2 DELAY=0.001
3 WAIT=5
4 NUMBER=5
5 ROUNDS=5
6 PORT=9004
7 SERVICE=perf_t
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 --outfile=$r.$i --prefix=http://localhost:${PORT}/search.pz2 --service=$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