diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-05 15:07:32 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-05 15:07:32 +0000 |
commit | ce2b60721754a1b1f2c3a08cdf08c20312ba6253 (patch) | |
tree | a4e523c19289da80a6a2f74a7c67a7e3da14e2b7 /lib.php | |
parent | 4f4061ca4e3cb4eed76b6ecfcb6d3a0a2d609bb7 (diff) | |
download | pkgsubmit-ce2b60721754a1b1f2c3a08cdf08c20312ba6253.tar pkgsubmit-ce2b60721754a1b1f2c3a08cdf08c20312ba6253.tar.gz pkgsubmit-ce2b60721754a1b1f2c3a08cdf08c20312ba6253.tar.bz2 pkgsubmit-ce2b60721754a1b1f2c3a08cdf08c20312ba6253.tar.xz pkgsubmit-ce2b60721754a1b1f2c3a08cdf08c20312ba6253.zip |
move buildtime_* computations outside of publish_stats_headers()
Diffstat (limited to 'lib.php')
-rw-r--r-- | lib.php | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -281,7 +281,7 @@ function timesort($a, $b) * * @return void */ -function publish_stats_headers($stats, $buildtime_total, $build_count, $last_package = null) +function publish_stats_headers($stats, $buildtime_total, $buildtime_avg, $build_count, $last_package = null) { foreach ($stats as $k => $v) { header("X-BS-Queue-$k: $v"); @@ -298,13 +298,8 @@ function publish_stats_headers($stats, $buildtime_total, $build_count, $last_pac header("X-BS-Package-Status: ".$last_package['type']); } - $buildtime_total = $buildtime_total / 60; - header(sprintf('X-BS-Buildtime: %d', round($buildtime_total))); - - $buildtime_avg = ($build_count == 0) ? - 0 : - round($buildtime_total / $build_count, 2); + header(sprintf('X-BS-Buildtime: %d', round($buildtime_total))); header(sprintf('X-BS-Buildtime-Average: %5.2f', $buildtime_avg)); } |