cvs: php-gcov-web /cron cron.php graph.php /cron/sql sample.sql tables.sql
| From: | Nuno Lopes | Date: | Tue, 19 Dec 2006 16:45:07 +0000 |
| Subject: | cvs: php-gcov-web /cron cron.php graph.php /cron/sql sample.sql tables.sql | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-33557@lists.php.net to get a copy of this message | ||
nlopess Tue Dec 19 16:45:07 2006 UTC
Modified files:
/php-gcov-web/cron graph.php cron.php
/php-gcov-web/cron/sql sample.sql tables.sql
Log:
remove the build_date as it is highly redundant
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/graph.php?r1=1.2&r2=1.3&diff_format=u
Index: php-gcov-web/cron/graph.php
diff -u php-gcov-web/cron/graph.php:1.2 php-gcov-web/cron/graph.php:1.3
--- php-gcov-web/cron/graph.php:1.2 Tue Dec 19 15:52:09 2006
+++ php-gcov-web/cron/graph.php Tue Dec 19 16:45:07 2006
@@ -17,16 +17,19 @@
+----------------------------------------------------------------------+
*/
-/* $Id: graph.php,v 1.2 2006/12/19 15:52:09 nlopess Exp $ */
+/* $Id: graph.php,v 1.3 2006/12/19 16:45:07 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.
+* 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.
-* 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.
+* 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.
*/
@@ -66,7 +69,7 @@
try
{
- $sql = 'SELECT build_date, max( build_percent_code_coverage ) , max( build_numwarnings ) ,
max( build_numfailures ) , max( build_numleaks ) FROM local_builds WHERE DATE_SUB( CURDATE( ) ,
INTERVAL ? DAY ) <= build_date AND version_id=? GROUP BY build_date';
+ $sql = 'SELECT DATE(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
DATE(build_datetime)';
$stmt = $mysqlconn->prepare($sql);
$stmt->execute(array($graph_days, $version_id));
}
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.php?r1=1.2&r2=1.3&diff_format=u
Index: php-gcov-web/cron/cron.php
diff -u php-gcov-web/cron/cron.php:1.2 php-gcov-web/cron/cron.php:1.3
--- php-gcov-web/cron/cron.php:1.2 Tue Dec 19 15:52:09 2006
+++ php-gcov-web/cron/cron.php Tue Dec 19 16:45:07 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cron.php,v 1.2 2006/12/19 15:52:09 nlopess Exp $ */
+/* $Id: cron.php,v 1.3 2006/12/19 16:45:07 nlopess Exp $ */
if ($argc != 7)
@@ -130,17 +130,15 @@
if($version_id > 0)
{
// Add new build to the build tables
- $build_date = date('Y-m-d');
$build_datetime = date('Y-m-d H-i-s');
// This data is used mainly for the graph generation
$stmt = null;
- $sql = 'INSERT INTO local_builds (build_id, version_id, build_date, build_datetime,
build_numerrors, build_numwarnings, build_numfailures, build_numleaks, build_percent_code_coverage,
build_os_info, build_compiler_info) '.
- 'VALUES (NULL, :version_id, :build_date, :build_datetime, :build_numerrors,
:build_numwarnings, :build_numfailures, :build_numleaks, :build_percent_code_coverage,
:build_os_info, :build_compiler_info) ';
+ $sql = 'INSERT INTO local_builds (build_id, version_id, build_datetime, build_numerrors,
build_numwarnings, build_numfailures, build_numleaks, build_percent_code_coverage, build_os_info,
build_compiler_info) '.
+ 'VALUES (NULL, :version_id, :build_datetime, :build_numerrors, :build_numwarnings,
:build_numfailures, :build_numleaks, :build_percent_code_coverage, :build_os_info,
:build_compiler_info) ';
$stmt = $mysqlconn->prepare($sql);
$stmt->bindParam(':version_id', $version_id);
- $stmt->bindParam(':build_date', $build_date);
$stmt->bindParam(':build_datetime', $build_datetime);
$stmt->bindParam(':build_numerrors', $totalnumerrors);
$stmt->bindParam(':build_numwarnings', $totalnumwarnings);
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/sql/sample.sql?r1=1.2&r2=1.3&diff_format=u
Index: php-gcov-web/cron/sql/sample.sql
diff -u php-gcov-web/cron/sql/sample.sql:1.2 php-gcov-web/cron/sql/sample.sql:1.3
--- php-gcov-web/cron/sql/sample.sql:1.2 Tue Dec 19 15:52:13 2006
+++ php-gcov-web/cron/sql/sample.sql Tue Dec 19 16:45:07 2006
@@ -16,7 +16,6 @@
CREATE TABLE
local_builds (
build_id int(11) NOT NULL auto_increment,
version_id int(11) NOT NULL,
-build_date date NOT NULL default '2000-01-01',
build_datetime datetime NOT NULL default '2000-01-01 12:00:00',
build_numerrors int(11) NOT NULL,
build_numwarnings int(11) NOT NULL,
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/sql/tables.sql?r1=1.2&r2=1.3&diff_format=u
Index: php-gcov-web/cron/sql/tables.sql
diff -u php-gcov-web/cron/sql/tables.sql:1.2 php-gcov-web/cron/sql/tables.sql:1.3
--- php-gcov-web/cron/sql/tables.sql:1.2 Tue Dec 19 15:52:13 2006
+++ php-gcov-web/cron/sql/tables.sql Tue Dec 19 16:45:07 2006
@@ -16,7 +16,6 @@
CREATE TABLE local_builds (
build_id int(11) NOT NULL auto_increment,
version_id int(11) NOT NULL,
-build_date date NOT NULL default '2000-01-01',
build_datetime datetime NOT NULL default '2000-01-01 12:00:00',
build_numerrors int(11) NOT NULL,
build_numwarnings int(11) NOT NULL,