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:
parent
ba2ed39385
commit
8bc515f251
@ -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))
|
||||
|
@ -42,7 +42,9 @@ function update() {
|
||||
div = $('<div/>', {'id': id, 'class': 'bug-container'});
|
||||
div.appendTo($('#main-container'));
|
||||
$('<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'] + ' projects: ' + bug['bug_data']['affects']
|
||||
}).appendTo(div);
|
||||
$('<div/>', {'class': 'graph'}).appendTo(div);
|
||||
$('<a/>', {
|
||||
href: 'http://logstash.openstack.org/#'+bug['logstash_query'],
|
||||
|
Loading…
Reference in New Issue
Block a user