Minor fixes for dmoz script
[idzebra-moved-to-github.git] / test / dmoz / update.sh
1 #!/bin/sh
2 # $Id: update.sh,v 1.10 2002-07-15 11:48:21 adam Exp $
3 t=$1
4 test -n "$t" || exit 1
5 test -d reg-$t && rm -fr reg-$t
6 mkdir reg-$t
7
8 rm -f *.mf *.LCK *.tmp
9 ../../index/zebraidx -l zebraidx-$t.log init 
10 i=0
11 rm -f times-$t.log stat-$t.log
12 while test -f dmoz.$i.xml; do
13         echo -n "$i " >>times-$1.log
14         rm -f zebraidx-$t.log
15         ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg -f 10 update dmoz.$i.xml 
16
17         grep ' zebraidx times:' zebraidx-$t.log | sed 's/.*zebraidx times://g' >>times-$t.log
18
19         i=`expr $i + 1`
20         mod=`expr $i % 50`
21         if test $mod -eq 0; then
22                 echo "run $i" >> stat-$t.log
23                 ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg stat >>stat-$t.log 
24         fi
25         if test $i = 30; then
26                 break
27         fi
28 done
29
30 title="ISAM-$t `date`"
31
32 cat >plot.dem <<ENDOFMESSAGE
33 set output "times-$t.ps"
34 set terminal postscript
35 set title "$title"
36 set xlabel "runs"
37 set ylabel "seconds"
38 plot [0:] [0:] \
39         'times-$t.log' using 2 title 'real' with linespoints, \
40         'times-$t.log' using 3 title 'user' with linespoints, \
41         'times-$t.log' using 4 title 'sys' with linespoints
42 ENDOFMESSAGE
43
44 gnuplot plot.dem
45
46