| Nuno Lopes 2006-12-19, 10:00 pm |
| 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-g...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 w ly 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 $sq
lgroup(build_datetime)";
$stmt = $mysqlconn->prepare($sql);
$stmt->execute(array($graph_days, $version_id));
}
|