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'],