summaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-04 16:07:11 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-04 16:07:11 +0000
commit36289712d53e9a600ded996510fdd8f0a0f971d3 (patch)
treef5692206672c94b9cef15e2672df8160c8ee6036 /lib.php
parentaec63d96ab5ea8dee9946f3f98130406981fed28 (diff)
downloadpkgsubmit-36289712d53e9a600ded996510fdd8f0a0f971d3.tar
pkgsubmit-36289712d53e9a600ded996510fdd8f0a0f971d3.tar.gz
pkgsubmit-36289712d53e9a600ded996510fdd8f0a0f971d3.tar.bz2
pkgsubmit-36289712d53e9a600ded996510fdd8f0a0f971d3.tar.xz
pkgsubmit-36289712d53e9a600ded996510fdd8f0a0f971d3.zip
sort grouped build durations
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib.php b/lib.php
index 6e29e9e..20d1a76 100644
--- a/lib.php
+++ b/lib.php
@@ -301,21 +301,26 @@ S;
$newdata = array();
foreach ($data as $duration => $count) {
if (false !== strpos($duration, 'hour')) {
- $newdata['> 1 hour'] += $count;
+ $newdata['60 minutes'] += $count;
} else {
$d = explode(' ', $duration);
- if ($d[0] > 15) {
- $newdata['> 15 minutes'] += $count;
+ if ($d[0] > 20) {
+ $newdata['21 minutes'] += $count;
} else {
$newdata[$duration] = $count;
}
}
}
+ uksort($newdata, "timesort");
$rows = array("['Duration', 'Builds']");
foreach ($newdata as $duration => $count) {
if ($duration == '0 second')
$duration = '< 1 minute';
+ elseif ($duration == '21 minutes')
+ $duration = '> 20 minutes';
+ elseif ($duration == '60 minutes')
+ $duration = '> 1 hour';
$rows[] = sprintf("['%s', %d]", $duration, $count);
}