0544ae26d0879dc9f3bd26798d6f3428b948f83a
[idzebra-moved-to-github.git] / test / dmoz / update.sh
1 #!/bin/sh
2 # $Id: update.sh,v 1.8 2002-06-20 08:03: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         echo " ---------- $i ----- " >> stat-$t.log
22         ../../index/zebraidx -l zebraidx-$t.log -c zebra-$t.cfg stat >>stat-$t.log 
23         i=`expr $i + 1`
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