new timed client script
[pazpar2-moved-to-github.git] / perf / bash / client_timed.sh
1 #!/bin/bash
2 OF=$1
3 if test -z "$OF"; then
4         OF=1
5 fi
6
7 PORT=$2
8 if test -z "$PORT"; then
9         PORT=9004
10 fi
11
12 QUERY=100
13 SERVICE=perf_t
14
15 H="http://localhost:${PORT}/search.pz2"
16
17 /usr/bin/time --format "$OF, init, %e" wget -q -O $OF.init.xml "$H/?command=init&service=${SERVICE}&extra=$OF" 2> $OF.init.time
18 S=`xsltproc get_session.xsl $OF.init.xml`
19 /usr/bin/time --format "$OF, search, %e" wget -q -O $OF.search.xml "$H?command=search&query=${QUERY}&session=$S" 2> $OF.search.time
20 sleep 1
21 # First show
22 /usr/bin/time --format "$OF, show, %e" wget -q -O $OF.show.xml "$H?command=show&session=$S" 2> $OF.show.time
23 AC=`xsltproc get_activeclients.xsl ${OF}.show.xml`
24 echo "Active clients: $AC " 
25 if [ "${AC}" != "0" ] ; then
26     echo "Active clients: ${AC}" 
27     /usr/bin/time --format "$OF, show2, %e" wget -q -O $OF.show.xml "$H?command=show&session=$S" 2>> $OF.show.time
28     AC=`xsltproc get_session.xsl $OF.show.xml`
29 fi