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 | awk '{print $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 | awk '{print $2}'`
+CUR_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_adder.php -- public_html/common.php "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 - shell_adder.php -- public_html/common.php "select mark, SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$LASTMARK\" group by mark;"`
if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then
echo "No benchamks records for $MARK"
exit 1
fi
-((DELTA=$CUR_TIME - $OLD_TIME))
+((DELTA=`/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_time2cents.php -- public_html/common.php $CUR_TIME` - `/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_time2cents.php -- public_html/common.php $OLD_TIME`))
if [ $DELTA -lt 0 ]; then
PERC=0
else
((PERC=100 * $DELTA))
- ((PERC=$PERC / $OLD_TIME))
+ ((PERC=$PERC / `/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_time2cents.php -- public_html/common.php $OLD_TIME`))
fi
if [ $PERC -ge 5 ]; then
cat <<EOT
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`
+CUR_FAIL=`/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_adder.php -- public_html/common.php "select count(distinct test) from bench where mark = \"$MARK\" and result = 'fail';"`
+OLD_FAIL=`/usr/bin/php4 -c /etc/php4/apache/php.ini - shell_adder.php -- public_html/common.php "select count(distinct test) from bench where mark = \"$LASTMARK\" and result = 'fail';"`
if [ $CUR_FAIL -gt $OLD_FAIL ]; then
cat <<EOT
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`
+ `echo "select distinct test from bench where mark = \"$LASTMARK\" and result = 'fail';" | mysql -u helm -h mowgli.cs.unibo.it matita`
EOT
}
}
+function time_2_cents($t) {
+ $matches = array();
+ $rex = "/^(\d+)m(\d{2})\.(\d{2})s$/";
+ $m = preg_match($rex,$t,$matches);
+ if ( $m == 0 ) exit 1;
+ $t_minutes = $matches[1];
+ $t_secs = $matches[2];
+ $t_cents = $matches[3];
+ return ((int) $t_cents) + ((int) $t_secs) * 100 + ((int)$t_minutes) * 6000 ;
+}
+
function sum_time($t1, $t2) {
$matches1 = array();
$matches2 = array();