3 YESTERDAY=`date -d yesterday +%Y%m%d`
4 TMPDIRNAME=$HOME/__${TODAY}_crontab
5 TMPDIRNAMEOLD=$HOME/__${YESTERDAY}_crontab
6 SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/"
7 SHELLTIME2CENTSPHP=scripts/shell_time2cents.php
8 SHELLADDERPHP=scripts/shell_adder.php
9 COMMONPHP=scripts/public_html/common.php
17 svn co ${SVNROOT}helm/matita/scripts/ > LOG.svn 2>&1
18 scripts/profile_svn.sh 2> LOG
20 MARK=`echo "select distinct mark from bench where mark like '$TODAY%' order by mark" | mysql -u helm matita | tail -n 1`
21 LASTMARK=`echo "select distinct mark from bench where mark like '$YESTERDAY%' order by mark" | mysql -u helm matita | tail -n 1`
23 if [ -z "$MARK" ]; then
24 echo "No benchmark records for $TODAY"
28 if [ -z "$LASTMARK" ]; then
29 echo "No benchmark records for $YESTERDAY"
33 CUR_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$MARK\" group by mark;"`
34 OLD_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$LASTMARK\" group by mark;"`
36 CUR_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $CUR_TIME`
37 OLD_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $OLD_TIME`
39 ((DELTA=$CUR_CENTS-$OLD_CENTS))
40 if [ $DELTA -lt 0 ]; then
44 ((PERC=$PERC / $OLD_CENTS))
46 if [ $PERC -ge 5 ]; then
49 http://mowgli.cs.unibo.it/~tassi/bench.php
51 PERFORMANCE LOSS DETECTED (MARK $MARK vs MARK $LASTMARK)
58 CUR_FAIL=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select count(distinct test) from bench where mark = \"$MARK\" and result = 'fail';"`
59 OLD_FAIL=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select count(distinct test) from bench where mark = \"$LASTMARK\" and result = 'fail';"`
61 if [ $CUR_FAIL -gt $OLD_FAIL ]; then
64 http://mowgli.cs.unibo.it/~tassi/bench.php
66 MORE BROKEN TESTS DETECTED (MARK $MARK vs MARK $LASTMARK)
68 `echo "select distinct test from bench where mark = \"$MARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita`
70 `echo "select distinct test from bench where mark = \"$LASTMARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita`