diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-04 13:42:14 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-04 13:42:14 +0000 |
commit | ed760b3ef9ed44d2346e4c9358e530af74dbe3ae (patch) | |
tree | 9c6bf97baefd1321d81c0bea02d3790a067e7c0f /test_index.php | |
parent | 02b2daa157454c04a10bbf244cb673f71b9f80a4 (diff) | |
download | pkgsubmit-ed760b3ef9ed44d2346e4c9358e530af74dbe3ae.tar pkgsubmit-ed760b3ef9ed44d2346e4c9358e530af74dbe3ae.tar.gz pkgsubmit-ed760b3ef9ed44d2346e4c9358e530af74dbe3ae.tar.bz2 pkgsubmit-ed760b3ef9ed44d2346e4c9358e530af74dbe3ae.tar.xz pkgsubmit-ed760b3ef9ed44d2346e4c9358e530af74dbe3ae.zip |
new publish_stats_headers() function
Diffstat (limited to 'test_index.php')
-rw-r--r-- | test_index.php | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/test_index.php b/test_index.php index 61ddb79..fa83a4e 100644 --- a/test_index.php +++ b/test_index.php @@ -180,31 +180,9 @@ if (file_exists('/var/lib/schedbot/tmp/upload')) { } } -// publish stats as headers +$last_pkg = ($_GET['last'] && $total > 0) ? reset($pkgs) : null +publish_stats_headers($stats, $last_pkg); -foreach ($stats as $k => $v) { - Header("X-BS-Queue-$k: $v"); -} - -$w = $stats['todo'] - 10; -if($w < 0) { - $w = 0; -} -$w = $w * 60; -Header("X-BS-Throttle: $w"); - -if (isset($_GET['last']) && $total > 0) { - reset($pkgs); - $last = current($pkgs); - Header("X-BS-Package-Status: ".$last['type']); -} - -$buildtime_total = $buildtime_total / 60; -header(sprintf('X-BS-Buildtime: %d', round($buildtime_total))); - -$build_count = $build_count == 0 ? 1 : $build_count; -$buildtime_avg = round($buildtime_total / $build_count, 2); -header(sprintf('X-BS-Buildtime-Average: %5.2f', $buildtime_avg)); ?> <!DOCTYPE html> <html lang="en" dir="ltr"> |