From ce2b60721754a1b1f2c3a08cdf08c20312ba6253 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 5 Sep 2012 15:07:32 +0000 Subject: move buildtime_* computations outside of publish_stats_headers() --- lib.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib.php') diff --git a/lib.php b/lib.php index 94186a7..daf8b9a 100644 --- a/lib.php +++ b/lib.php @@ -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)); } -- cgit v1.2.1