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