cvs: php-gcov-web /cron graph.php

From: Date: Tue, 19 Dec 2006 19:20:06 +0000
Subject: cvs: php-gcov-web /cron graph.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-33563@lists.php.net to get a copy of this message
nlopess Tue Dec 19 19:20:06 2006 UTC Modified files: /php-gcov-web/cron graph.php Log: use the average instead of the max value when plotting the graphs http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/graph.php?r1=1.4&r2=1.5&diff_format=u Index: php-gcov-web/cron/graph.php diff -u php-gcov-web/cron/graph.php:1.4 php-gcov-web/cron/graph.php:1.5 --- php-gcov-web/cron/graph.php:1.4 Tue Dec 19 18:42:06 2006 +++ php-gcov-web/cron/graph.php Tue Dec 19 19:20:05 2006 @@ -18,16 +18,16 @@ +----------------------------------------------------------------------+ */ -/* $Id: graph.php,v 1.4 2006/12/19 18:42:06 nlopess Exp $ */ +/* $Id: graph.php,v 1.5 2006/12/19 19:20:05 nlopess Exp $ */ // File to generate graphs for a weekly or monthly basis /* Inportant Notes: -* For the sake of simplicity, the SQL selects the highest number of each of the four -* criteria with the limitation of one data point allowed per day. This also keeps the graph -* from becoming too messy with too many data points. +* We select the average number of each of the four criteria with the limitation of one data point +* allowed per period (day/month), excluding the coverage, where we select the max value (mainly +* because of possible -1 values) * Graphs can only be generated for the period of time if at least more than one data point exist * during that time frame. Otherwise an error would occur when starting the graph creation process. @@ -75,7 +75,7 @@ try { - $sql = "SELECT $sqlgroup(build_datetime), max( build_percent_code_coverage ) , max( build_numwarnings ) , max( build_numfailures ) , max( build_numleaks ) FROM local_builds WHERE DATE_SUB( CURDATE( ) , INTERVAL ? DAY ) <= build_datetime AND version_id=? GROUP BY $sqlgroup(build_datetime)"; + $sql = "SELECT $sqlgroup(build_datetime), max(build_percent_code_coverage), avg(build_numwarnings), avg(build_numfailures), avg(build_numleaks) FROM local_builds WHERE DATE_SUB(CURDATE() , INTERVAL ? DAY) <= build_datetime AND version_id=? GROUP BY $sqlgroup(build_datetime)"; $stmt = $mysqlconn->prepare($sql); $stmt->execute(array($graph_days, $version_id)); }

« previous php.mirrors (#33563) next »