Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: infra/tools/cq_stats/cq_stats.py

Issue 1158723003: cq_stats: only take into account attempts within current date range (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: infra/tools/cq_stats/cq_stats.py
diff --git a/infra/tools/cq_stats/cq_stats.py b/infra/tools/cq_stats/cq_stats.py
index 7e6966d141d58dedc95861aa0be9652e40bb2112..7b6c7713c14872bf6a5ee00b14c18c48df220174 100755
--- a/infra/tools/cq_stats/cq_stats.py
+++ b/infra/tools/cq_stats/cq_stats.py
@@ -615,7 +615,7 @@ def derive_stats(args, begin_date, init_stats=None):
patch_stats = {}
# Fetch and process each patchset log
def get_patch_stats(patch_id):
- return derive_patch_stats(end_date, patch_id)
+ return derive_patch_stats(begin_date, end_date, patch_id)
if args.seq or not args.thread_pool:
iterable = map(get_patch_stats, patches)
@@ -668,9 +668,9 @@ def parse_failing_tryjobs(message):
return builders
-def derive_patch_stats(end_date, patch_id):
+def derive_patch_stats(begin_date, end_date, patch_id):
"""``patch_id`` is a tuple (issue, patchset)."""
- results = fetch_cq_logs(end_date=end_date, filters=[
+ results = fetch_cq_logs(start_date=begin_date, end_date=end_date, filters=[
'issue=%s' % patch_id[0], 'patchset=%s' % patch_id[1]])
# The results should already ordered, but sort it again just to be sure.
results = sorted(results, key=lambda r: r['timestamp'], reverse=True)
« no previous file with comments | « no previous file | infra/tools/cq_stats/test/cq_stats_test.py » ('j') | infra/tools/cq_stats/test/cq_stats_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698