min_age takes an absolute timestamp.
[build-farm.git] / buildfarm / web / __init__.py
index b1f0fb4096c3ba9411ae0a08f837bc639fb3ed60..b66ffce0a08a25ddd222ab9e57bb1ea378cafb79 100755 (executable)
@@ -727,16 +727,15 @@ class ViewSummaryPage(BuildFarmPage):
         # output when we want
         broken_table = ""
 
-        builds = self.buildfarm.get_last_builds()
+        builds = self.buildfarm.get_summary_builds(min_age=time.time() - (7 * 24 * 60 * 60))
 
-        for build in builds:
-            host_count[build.tree]+=1
-            status = build.status()
+        for tree, status in builds:
+            host_count[tree]+=1
 
             if status.failed:
-                broken_count[build.tree]+=1
+                broken_count[tree]+=1
                 if "panic" in status.other_failures:
-                    panic_count[build.tree]+=1
+                    panic_count[tree]+=1
         return (host_count, broken_count, panic_count)
 
     def render_text(self, myself):