diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-04 16:07:11 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-04 16:07:11 +0000 |
commit | 36289712d53e9a600ded996510fdd8f0a0f971d3 (patch) | |
tree | f5692206672c94b9cef15e2672df8160c8ee6036 /lib.php | |
parent | aec63d96ab5ea8dee9946f3f98130406981fed28 (diff) | |
download | pkgsubmit-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.php | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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); } |