From 8bc515f251eb5dcc4ed280ab285f260755436f5f Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 22 Jan 2014 08:16:59 -0500 Subject: [PATCH] update web ui for better sorting this adds a fails 24 piece of data, and sorts by that, so we can more easily see the current hot issues. Change-Id: I8c6f26b451cac7d9dacd87edb9c81c9f0e770951 --- elastic_recheck/cmd/graph.py | 14 ++++++++++++-- web/share/elastic-recheck.js | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/elastic_recheck/cmd/graph.py b/elastic_recheck/cmd/graph.py index 8d57888c..add4d8d8 100755 --- a/elastic_recheck/cmd/graph.py +++ b/elastic_recheck/cmd/graph.py @@ -89,16 +89,26 @@ def main(): facets.detect_facets(results, ["build_status", "timestamp", "build_uuid"]) + bug['fails24'] = 0 for status in facets.keys(): data = [] for ts in range(start, now, STEP): if ts in facets[status]: - data.append([ts, len(facets[status][ts])]) + fails = len(facets[status][ts]) + data.append([ts, fails]) + # get the last 24 hr count as well, can't wait to have + # the pandas code and able to do it that way + if ts > (now - (24 * STEP)): + bug['fails24'] += fails else: data.append([ts, 0]) bug["data"].append(dict(label=status, data=data)) - buglist = sorted(buglist, key=lambda bug: -bug['fails']) + # the sort order is a little odd, but basically sort by failures in + # the last 24 hours, then with all failures for ones that we haven't + # seen in the last 24 hours. + buglist = sorted(buglist, + key=lambda bug: -(bug['fails24'] * 100000 + bug['fails'])) out = open(args.output, 'w') out.write(json.dumps(buglist)) diff --git a/web/share/elastic-recheck.js b/web/share/elastic-recheck.js index bcc32518..998d17c4 100644 --- a/web/share/elastic-recheck.js +++ b/web/share/elastic-recheck.js @@ -42,7 +42,9 @@ function update() { div = $('
', {'id': id, 'class': 'bug-container'}); div.appendTo($('#main-container')); $('

', {text: 'Bug ' + bug['number'] + " - " + bug['bug_data']['name']}).appendTo(div); - $('

', {text: 'Projects: ' + bug['bug_data']['affects']}).appendTo(div); + $('

', { + text: 'Last 24 hr hits: ' + bug['bug_data']['fails24'] + '   projects: ' + bug['bug_data']['affects'] + }).appendTo(div); $('
', {'class': 'graph'}).appendTo(div); $('', { href: 'http://logstash.openstack.org/#'+bug['logstash_query'],