diff options
author | Romain d'Alverny <rda@mageia.org> | 2011-04-19 12:09:23 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2011-04-19 12:09:23 +0000 |
commit | 23055ad4e1fa2aa5106dad518a41388cff03c1b9 (patch) | |
tree | ca1141e1181c9d50651420a347da68a86f3d2fa4 | |
parent | ab0218742fc540ac90e6e5ecd6c8dae8f7d0d8a4 (diff) | |
download | pkgsubmit-23055ad4e1fa2aa5106dad518a41388cff03c1b9.tar pkgsubmit-23055ad4e1fa2aa5106dad518a41388cff03c1b9.tar.gz pkgsubmit-23055ad4e1fa2aa5106dad518a41388cff03c1b9.tar.bz2 pkgsubmit-23055ad4e1fa2aa5106dad518a41388cff03c1b9.tar.xz pkgsubmit-23055ad4e1fa2aa5106dad518a41388cff03c1b9.zip |
count only once time for a given package
-rw-r--r-- | index.php | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -132,8 +132,7 @@ $r = preg_match_all($re, $pkgs = array(); -$buildtime_total = 0; -$build_count = 0; +$buildtime_total = array(); foreach ($matches as $val) { @@ -180,14 +179,16 @@ foreach ($matches as $val) { // 12 hours is be an acceptable threshold given current BS global perfs // as of April 2011 if ($pkgs[$key]['buildtime']['diff'] < 43200) { - $buildtime_total += $pkgs[$key]['buildtime']['diff']; - $build_count += 1; + $buildtime_total[$key] = $pkgs[$key]['buildtime']['diff']; } } } // sort by key in reverse order to have more recent pkgs first krsort($pkgs); +$build_count = count($buildtime_total); +$buildtime_total = array_sum($buildtime_total); + // count all packages statuses $stats = array( 'uploaded' => 0, |