]> matita.cs.unibo.it Git - helm.git/commitdiff
more detailed but less verbose and annoying report
authorEnrico Tassi <enrico.tassi@inria.fr>
Mon, 27 Jun 2005 09:15:21 +0000 (09:15 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Mon, 27 Jun 2005 09:15:21 +0000 (09:15 +0000)
helm/matita/scripts/crontab.sh

index 03ce5ce9541c5f3d3a3ad8ac63b88e97467345cf..926a9750c8ff510a9e5dc61b471b608ea476ffc6 100644 (file)
@@ -1,4 +1,5 @@
 MARK=`date +%Y%m%d`
+LASTMARK=`date -d yesterday +%Y%m%d`
 TMPDIRNAME=.__${MARK}_crontab
 CVSROOT=":ext:$USER@marcello.cs.unibo.it:/home/faculty/PROJECTS/cvs/helm"
 
@@ -6,24 +7,48 @@ OLD=$PWD
 rm -rf $TMPDIRNAME 
 mkdir $TMPDIRNAME
 cd $TMPDIRNAME
-cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null
-helm/matita/scripts/profile_cvs.sh 2> LOG
+#cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null
+#helm/matita/scripts/profile_cvs.sh 2> LOG
+
+CUR_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$MARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | cut -f 2`
+OLD_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$LASTMARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | cut -f 2`
+((DELTA=$CUR_TIME - $OLD_TIME))
+if [ $DELTA -lt 0 ]; then
+  ((DELTA=$DELTA * -1))
+fi
+((PERC=100 * $DELTA))
+((PERC=$PERC / $OLD_TIME))
+
+if [ $PERC -ge 5 ]; then
+  cat <<EOT
+  REPORT FOR `date`
+  http://mowgli.cs.unibo.it/tassi/bench.php
+
+  PREFORMANCE LOSS DETECTED
+  is $CUR_TIME sec 
+  was $OLD_TIME sec
 
-cat <<EOT
-REPORT FOR `date`
-http://mowgli.cs.unibo.it/tassi/bench.php
-
-DAILY BENCHMARK REPORT
-`echo "select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$MARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita`
-
-
-DAILY BENCHMARK REPORT (DETAILED)
-`echo "select * from bench where mark = \"$MARK\";" | mysql -u helm -h mowgli.cs.unibo.it matita`
+EOT
+fi
+
+CUR_FAIL=`echo "select count(distinct test) from bench where mark = \"$MARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1`
+OLD_FAIL=`echo "select count(distinct test) from bench where mark = \"$LASTMARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1`
+
+if [ $CUR_FAIL -gt $OLD_FAIL ]; then
+  cat <<EOT
+  REPORT FOR `date`
+  http://mowgli.cs.unibo.it/tassi/bench.php
+
+  MORE BROKEN TESTS DETECTED
+  now broken:
+  `echo "select distinct test from bench where mark = \"$MARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita`
+  were broken:
+  `echo "select distinct test from bench where mark = \"$OLDMARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita`
+  
+EOT
 
-COMPILATION OUTPUT
-`cat LOG`
+fi
 
-EOT
 cd $OLD
 rm -rf $TMPDIRNAME