X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fscripts%2Fcrontab.sh;h=64708ba77e3916d53917fb9453301a0682177163;hb=a5d5a70aaeaa34345bde25bef012a0189a3fe7e9;hp=5ad50de5ee47ea77bb1a997c1fb067a5752ba4e8;hpb=7f2444c2670cadafddd8785b687ef312158376b0;p=helm.git diff --git a/matita/scripts/crontab.sh b/matita/scripts/crontab.sh index 5ad50de5e..64708ba77 100644 --- a/matita/scripts/crontab.sh +++ b/matita/scripts/crontab.sh @@ -1,4 +1,6 @@ #!/bin/bash + +#configuration TODAY=`date +%Y%m%d` YESTERDAY=`date -d yesterday +%Y%m%d` TMPDIRNAME=$HOME/__${TODAY}_crontab @@ -7,18 +9,29 @@ SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/" SHELLTIME2CENTSPHP=scripts/shell_time2cents.php SHELLADDERPHP=scripts/shell_adder.php COMMONPHP=scripts/public_html/common.php - - +MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita" +SQLQMARK="select distinct mark from bench where mark like '" +SQLQORD="' order by mark;" +SQLQTIME="select SUM(timeuser) from bench where mark = \"" +SQLQGRMARK="\" group by mark;" +SQLQFAIL="select count(distinct test) from bench where mark = \"" +SQLQFAIL1="select distinct test from bench where mark = \"" +SQLQFAIL2="\" and result = 'fail';" +URL="http://mowgli.cs.unibo.it/~tassi/bench.php" + +#initialization OLD=$PWD mkdir -p $TMPDIRNAME rm -rf $TMPDIRNAMEOLD cd $TMPDIRNAME rm -rf helm -svn co ${SVNROOT}helm/matita/scripts/ > LOG.svn 2>&1 +svn co ${SVNROOT}helm/software/matita/scripts/ > LOG.svn 2>&1 + +#run tests scripts/profile_svn.sh 2> LOG -MARK=`echo "select distinct mark from bench where mark like '$TODAY%' order by mark" | mysql -u helm matita | tail -n 1` -LASTMARK=`echo "select distinct mark from bench where mark like '$YESTERDAY%' order by mark" | mysql -u helm matita | tail -n 1` +MARK=`echo $SQLQMARK$TODAY%$SQLQORD | $MYSQL | tail -n 1` +LASTMARK=`echo $SQLQMARK$YESTERDAY%$SQLQORD | $MYSQL | tail -n 1` if [ -z "$MARK" ]; then echo "No benchmark records for $TODAY" @@ -30,45 +43,61 @@ if [ -z "$LASTMARK" ]; then exit 1 fi -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;"` -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;"` +#check for slowdown +CUR_TIME=`echo $SQLQTIME$MARK$SQLQGRMARK | $MYSQL` +OLD_TIME=`echo $SQLQTIME$LASTMARK$SQLQGRMARK | $MYSQL` -CUR_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $CUR_TIME` -OLD_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $OLD_TIME` +if [ -z "$CUR_TIME" -o -z "$OLD_TIME"]; then + cat <