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