From ed3fad106d07e4b829091dfd383945079e0387d4 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 3 Jul 2014 08:22:43 -0400 Subject: [PATCH] make ER only go back 10 days Our Elastic Search index is down to 10 days, but ER looks at 14, which makes people think bugs are showing up for the first time 10 days ago. Match the duration for ES. Change-Id: I4e47ece38e68d4ee19ee61b9a107bba9f12abf8c --- elastic_recheck/cmd/graph.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/elastic_recheck/cmd/graph.py b/elastic_recheck/cmd/graph.py index 290e9463..689fa37a 100755 --- a/elastic_recheck/cmd/graph.py +++ b/elastic_recheck/cmd/graph.py @@ -62,7 +62,13 @@ def main(): ts = datetime(ts.year, ts.month, ts.day, ts.hour) # ms since epoch now = int(((ts - epoch).total_seconds()) * 1000) - start = now - (14 * 24 * STEP) + # number of days to match to, this should be the same as we are + # indexing in logstash + days = 10 + # How far back to start in the graphs + start = now - (days * 24 * STEP) + # ER timeframe for search + timeframe = days * 24 * STEP / 1000 for query in classifier.queries: if args.queue: @@ -73,7 +79,7 @@ def main(): urlq = dict(search=query['query'], fields=[], offset=0, - timeframe="604800", + timeframe=str(timeframe), graphmode="count") logstash_query = base64.urlsafe_b64encode(json.dumps(urlq)) bug_data = get_launchpad_bug(query['bug'])