summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-04-19 12:09:23 +0000
committerRomain d'Alverny <rda@mageia.org>2011-04-19 12:09:23 +0000
commit23055ad4e1fa2aa5106dad518a41388cff03c1b9 (patch)
treeca1141e1181c9d50651420a347da68a86f3d2fa4
parentab0218742fc540ac90e6e5ecd6c8dae8f7d0d8a4 (diff)
downloadpkgsubmit-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.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.php b/index.php
index d70c514..2d88a3f 100644
--- a/index.php
+++ b/index.php
@@ -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,