| Nuno Lopes 2006-10-20, 6:59 pm |
| nlopess Fri Oct 20 22:10:27 2006 UTC
Modified files: (Branch: SOC06)
/php-gcov-web/www index.php
Log:
build time estimated completion time (part #1).
Based on a patch by Daniel Pronych
http://cvs.php.net/viewvc.cgi/php-g...4&diff_format=u
Index: php-gcov-web/www/index.php
diff -u php-gcov-web/www/index.php:1.1.2.13 php-gcov-web/www/index.php:1.1.2.14
--- php-gcov-web/www/index.php:1.1.2.13 Sat Oct 7 18:08:05 2006
+++ php-gcov-web/www/index.php Fri Oct 20 22:10:27 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: index.php,v 1.1.2.13 2006/10/07 18:08:05 nlopess Exp $ */
+/* $Id: index.php,v 1.1.2.14 2006/10/20 22:10:27 nlopess Exp $ */
// Include the site API
include 'site.api.php';
@@ -61,6 +61,7 @@
<th>Last Attempted<br />Build Date</th>
<th>Last Successful<br />Build Date</th>
<th>Last Build <br /> Time</th>
+<th>Build Completion<br /> Estimate</th>
</tr>
<?php
@@ -74,7 +75,35 @@
echo '<td>'.$version_last_attempted_build_date.'</td>'."\n";
echo '<td>'.$version_last_successful_build_date.'</td>'."\n";
echo '<td>'.time_diff($version_last_build_time).'</td>'."\n";
-
+
+ echo '<td>';
+
+ $pidfile = "./$version_name/build.pid";
+
+ if(@file_exists($pidfile) && posix_kill((int)@file_get_contents($pidf
ile), 0)) {
+
+ if($version_last_build_time > 0) {
+ // Obtain last modified date and time of the process id file
+ $estimate_time = filemtime($pidfile) + $version_last_build_time - time();
+
+ if($estimate_time <= 0) {
+ echo 'any time soon';
+ } else {
+ echo time_diff($estimate_time);
+ } // End check for a positive time estimation
+
+ // this is the first time the build is running
+ } else {
+ echo 'Unknown';
+ }
+
+ } else {
+ @unlink($pidfile);
+ echo 'Not running';
+ } // End check for a running php build process id
+
+ echo "</td>\n";
+
// End additions
echo "</tr>\n";
}
|