5 YESTERDAY=`date -d yesterday +%Y%m%d`
6 TMPDIRNAME=$HOME/__${TODAY}_crontab
7 TMPDIRNAMEOLD=$HOME/__${YESTERDAY}_crontab
8 SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/"
9 SHELLTIME2CENTSPHP=scripts/shell_time2cents.php
10 SHELLADDERPHP=scripts/shell_adder.php
11 COMMONPHP=scripts/public_html/common.php
12 MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita"
13 SQLQMARK="select distinct mark from bench where mark like '"
14 SQLQORD="' order by mark;"
15 SQLQTIME="select SUM(timeuser) from bench where mark = \""
16 SQLQGRMARK="\" group by mark;"
17 SQLQFAIL="select count(distinct test) from bench where mark = \""
18 SQLQFAIL1="select distinct test from bench where mark = \""
19 SQLQFAIL2="\" and result = 'fail';"
20 URL="http://mowgli.cs.unibo.it/~tassi/bench.php"
28 svn co ${SVNROOT}helm/software/matita/scripts/ > LOG.svn 2>&1
31 scripts/profile_svn.sh 2> LOG
33 MARK=`echo $SQLQMARK$TODAY%$SQLQORD | $MYSQL | tail -n 1`
34 LASTMARK=`echo $SQLQMARK$YESTERDAY%$SQLQORD | $MYSQL | tail -n 1`
36 if [ -z "$MARK" ]; then
37 echo "No benchmark records for $TODAY"
41 if [ -z "$LASTMARK" ]; then
42 echo "No benchmark records for $YESTERDAY"
47 CUR_TIME=`echo $SQLQTIME$MARK$SQLQGRMARK | $MYSQL`
48 OLD_TIME=`echo $SQLQTIME$LASTMARK$SQLQGRMARK | $MYSQL`
50 if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then
53 Unable to calculate total time amounts:
55 $SQLQTIME$MARK$SQLQGRMARK
59 $SQLQTIME$LASTMARK$SQLQGRMARK
66 ((DELTA= $CUR_TIME - $OLD_TIME))
67 if [ "$DELTA" -lt 0 ]; then
70 PREC=`scripts/functions.lua proportion $DELTA x $OLD_CENTS 100`
72 if [ "$PERC" -ge 5 ]; then
75 PERFORMANCE LOSS DETECTED (MARK $MARK vs MARK $LASTMARK)
77 Is `scripts/functions.lua t2s $CUR_TIME`
79 Was `scripts/functions.lua t2s $OLD_TIME`
85 #check for more broken tests
86 CUR_FAIL=`echo $SQLQFAIL$MARK$SQLQFAIL2 | $MYSQL`
87 OLD_FAIL=`echo $SQLQFAIL$LASTMARK$SQLQFAIL2 | $MYSQL`
89 if [ "$CUR_FAIL" -gt "$OLD_FAIL" ]; then
92 MORE BROKEN TESTS DETECTED (MARK $MARK vs MARK $LASTMARK)
95 `echo $SQLQFAIL1$MARK$SQLQFAIL2 | $MYSQL`
98 `echo $SQLQFAIL1$LASTMARK$SQLQFAIL2 | $MYSQL`