From bf8a6aa5782c9b539ac6cf11ee68f20b7d2c83a6 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 16 Mar 2006 14:00:40 +0000 Subject: [PATCH] removed php-shell scripts --- matita/scripts/crontab.sh | 63 +++++++++++++++++------------ matita/scripts/functions.lua | 38 +++++++++++++++-- matita/scripts/profile_svn.sh | 32 ++++++++++----- matita/scripts/shell_adder.php | 6 --- matita/scripts/shell_time2cents.php | 4 -- 5 files changed, 94 insertions(+), 49 deletions(-) delete mode 100755 matita/scripts/shell_adder.php delete mode 100755 matita/scripts/shell_time2cents.php diff --git a/matita/scripts/crontab.sh b/matita/scripts/crontab.sh index 65578a87c..99b4a13a6 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/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,45 @@ 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;"` - -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` +#check for slowdown +CUR_TIME=`echo $SQLQTIME$MARK$SQLQGRMARK | $MYSQL` +OLD_TIME=`echo $SQLQTIME$LASTMARK$SQLQGRMARK | $MYSQL` ((DELTA=$CUR_CENTS-$OLD_CENTS)) if [ $DELTA -lt 0 ]; then PERC=0 else - ((PERC=100 * $DELTA)) - ((PERC=$PERC / $OLD_CENTS)) + PREC=`scripts/functions.lua proportion $DELTA x $OLD_CENTS 100` fi if [ $PERC -ge 5 ]; then cat < $SVNLOG 2>&1 cd trunk svn update -N helm >> $SVNLOG 2>&1 @@ -60,9 +64,15 @@ compile $PWD/helm/software/ #run run_tests $PWD/helm/software/matita > LOG 2>LOG.run_tests.err -cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | awk -f $PWD/helm/software/matita/scripts/insert.awk > INSERT.sql -cat INSERT.sql | mysql -u helm -h mowgli.cs.unibo.it matita -SVNREVISION=`cat $SVNLOG | grep revision | tail -n 1 | sed "s/.*revision \(\w\+\)./\1/"` -echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | mysql -u helm -h mowgli.cs.unibo.it matita +#insert the db +cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | \ + $PWD/helm/software/matita/scripts/functions.lua log2sql - > INSERT.sql +cat INSERT.sql | $MYSQL + +#save the revision +SVNREVISION=`svn info $PWD/helm/software/ | grep "^Revision:" | cut -d : -f 2` +echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | $MYSQL cd $OLD #rm -rf $TMPDIRNAME + +#eof diff --git a/matita/scripts/shell_adder.php b/matita/scripts/shell_adder.php deleted file mode 100755 index a13005e55..000000000 --- a/matita/scripts/shell_adder.php +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/matita/scripts/shell_time2cents.php b/matita/scripts/shell_time2cents.php deleted file mode 100755 index 4914fc24f..000000000 --- a/matita/scripts/shell_time2cents.php +++ /dev/null @@ -1,4 +0,0 @@ - -- 2.39.2