diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-04-19 13:13:33 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-04-19 13:13:33 +0000 |
commit | f252b619fc883f6a647b0ef25ea0e983d4b90968 (patch) | |
tree | ad2de2917a90116cb33efb0da15198384365d153 /index.php | |
parent | 23055ad4e1fa2aa5106dad518a41388cff03c1b9 (diff) | |
download | pkgsubmit-f252b619fc883f6a647b0ef25ea0e983d4b90968.tar pkgsubmit-f252b619fc883f6a647b0ef25ea0e983d4b90968.tar.gz pkgsubmit-f252b619fc883f6a647b0ef25ea0e983d4b90968.tar.bz2 pkgsubmit-f252b619fc883f6a647b0ef25ea0e983d4b90968.tar.xz pkgsubmit-f252b619fc883f6a647b0ef25ea0e983d4b90968.zip |
show usage time diagram (sort of)
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -133,6 +133,7 @@ $r = preg_match_all($re, $pkgs = array(); $buildtime_total = array(); +$buid_dates = array(); foreach ($matches as $val) { @@ -171,10 +172,14 @@ foreach ($matches as $val) { // parse build bot from $data $pkgs[$key]['status']['build'] = 1; } else if ($ext == '.done') { + // beware! this block is called twice for a given $key + $pkgs[$key]['buildtime']['start'] = key2timestamp($val[6]); $pkgs[$key]['buildtime']['end'] = round($val[12]); $pkgs[$key]['buildtime']['diff'] = $pkgs[$key]['buildtime']['end'] - $pkgs[$key]['buildtime']['start']; + @$build_dates[date('H', $pkgs[$key]['buildtime']['start'])] += 1; + // keep obviously dubious values out of there // 12 hours is be an acceptable threshold given current BS global perfs // as of April 2011 @@ -185,6 +190,7 @@ foreach ($matches as $val) { } // sort by key in reverse order to have more recent pkgs first krsort($pkgs); +ksort($build_dates); $build_count = count($buildtime_total); $buildtime_total = array_sum($buildtime_total); @@ -412,6 +418,13 @@ if ($total > 0) { $s .= $bts; $s .= '</table><span style="font-size: 85%;">Does not take<br />build failures<br />into account.</span>'; + $s .= '<table style="width:100%;"><caption>Build times</caption>'; + $max = max($build_dates2); + foreach ($build_dates2 as $time => $count) + $s .= sprintf('<tr><td>%d</td><td><span style="width: %dpx; height: 10px; background: #aaa;" title="%d"></span></td></tr>', + $time, round($count / $max * 100), $count); + $s .= '</table>'; + $s .= '</div>'; echo $s; |