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
This commit is contained in:
Sean Dague 2014-01-22 08:16:59 -05:00
parent ba2ed39385
commit 8bc515f251
2 changed files with 15 additions and 3 deletions

View File

@ -89,16 +89,26 @@ def main():
facets.detect_facets(results, facets.detect_facets(results,
["build_status", "timestamp", "build_uuid"]) ["build_status", "timestamp", "build_uuid"])
bug['fails24'] = 0
for status in facets.keys(): for status in facets.keys():
data = [] data = []
for ts in range(start, now, STEP): for ts in range(start, now, STEP):
if ts in facets[status]: 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: else:
data.append([ts, 0]) data.append([ts, 0])
bug["data"].append(dict(label=status, data=data)) 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 = open(args.output, 'w')
out.write(json.dumps(buglist)) out.write(json.dumps(buglist))

View File

@ -42,7 +42,9 @@ function update() {
div = $('<div/>', {'id': id, 'class': 'bug-container'}); div = $('<div/>', {'id': id, 'class': 'bug-container'});
div.appendTo($('#main-container')); div.appendTo($('#main-container'));
$('<h2/>', {text: 'Bug ' + bug['number'] + " - " + bug['bug_data']['name']}).appendTo(div); $('<h2/>', {text: 'Bug ' + bug['number'] + " - " + bug['bug_data']['name']}).appendTo(div);
$('<h3/>', {text: 'Projects: ' + bug['bug_data']['affects']}).appendTo(div); $('<h3/>', {
text: 'Last 24 hr hits: ' + bug['bug_data']['fails24'] + ' &nbsp; projects: ' + bug['bug_data']['affects']
}).appendTo(div);
$('<div/>', {'class': 'graph'}).appendTo(div); $('<div/>', {'class': 'graph'}).appendTo(div);
$('<a/>', { $('<a/>', {
href: 'http://logstash.openstack.org/#'+bug['logstash_query'], href: 'http://logstash.openstack.org/#'+bug['logstash_query'],