6 YESTERDAY=`date -d yesterday +%Y%m%d`
7 TMPDIRNAME=$HOME/__${TODAY}_crontab
8 TMPDIRNAMEOLD=$HOME/__${YESTERDAY}_crontab
9 SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/"
10 SHELLTIME2CENTSPHP=scripts/shell_time2cents.php
11 SHELLADDERPHP=scripts/shell_adder.php
12 COMMONPHP=scripts/public_html/common.php
13 MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita"
14 SQLQMARK="select distinct mark from bench where mark like '%s%%' order by mark;"
15 SQLQTIME="select SUM(timeuser) from bench where mark = '%s' group by mark;"
16 SQLQFAILCOUNT="select count(distinct test) from bench where mark = '%s' and result = 'fail';"
17 SQLQFAIL="select distinct test from bench where mark = '%s' and result = 'fail';"
18 URL="http://mowgli.cs.unibo.it/~tassi/bench.php"
26 svn co ${SVNROOT}helm/software/matita/scripts/ > LOG.svn 2>&1
29 scripts/profile_svn.sh 2> LOG
31 MARK=`printf "$SQLQMARK" "$TODAY" | $MYSQL | tail -n 1`
32 LASTMARK=`printf "$SQLQMARK" "$YESTERDAY" | $MYSQL | tail -n 1`
34 if [ -z "$MARK" ]; then
35 echo "No benchmark records for $TODAY"
39 if [ -z "$LASTMARK" ]; then
40 echo "No benchmark records for $YESTERDAY"
45 CUR_TIME=`printf "$SQLQTIME" "$MARK" | $MYSQL | tail -n 1`
46 OLD_TIME=`printf "$SQLQTIME" "$LASTMARK" | $MYSQL | tail -n 1`
48 if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then
51 Unable to calculate total time amounts:
53 `printf "$SQLQTIME" "$MARK"`
57 `printf "$SQLQTIME" "$LASTMARK"`
64 ((DELTA= $CUR_TIME - $OLD_TIME))
65 if [ "$DELTA" -lt 0 ]; then
68 PERC=`lua5.1 scripts/functions.lua proportion $DELTA x $OLD_TIME 100`
70 if [ "$PERC" -ge 5 ]; then
73 Performance loss detected (MARK $MARK vs MARK $LASTMARK)
75 Is: `lua5.1 scripts/functions.lua t2s $CUR_TIME`
76 Was: `lua5.1 scripts/functions.lua t2s $OLD_TIME`
82 #check for more broken tests
83 CUR_FAIL=`printf "$SQLQFAILCOUNT" "$MARK" | $MYSQL | tail -n 1`
84 OLD_FAIL=`printf "$SQLQFAILCOUNT" "$LASTMARK" | $MYSQL | tail -n 1`
86 if [ "$CUR_FAIL" -gt "$OLD_FAIL" ]; then
89 More broken tests detected (MARK $MARK vs MARK $LASTMARK)
94 `printf "$SQLQFAIL" "$MARK" | $MYSQL`
97 `printf "$SQLQFAIL" "$LASTMARK" | $MYSQL`