@app.route('/stats')
def web_stats():
- return render_template('stats.html', stats=stats())
+ stats_ = stats()
+ runners = ['all'] + [x for x in sorted(stats_['builds'].keys()) if x != 'all']
+ return render_template('stats.html', stats=stats_, runners=runners)
@app.route("/runners/")
def web_runners():
{% from "bootstrap/pagination.html" import render_pagination %}
{% block content %}
{% set statuses = stats['builds']['all'].keys() | sort %}
+
<div class="container">
Status
<table class="table table-striped">
<th>{{status | title}}</th>
{% endfor %}
</tr>
- {% for runner in stats['builds'].keys() | sort %}
+ {% for runner in runners %}
+ {% if runner in stats['builds'] %}
<tr>
<td>{% if runner != 'all' %}<a href="/runners/{{runner}}">{{runner}}</a>{% else %}{{runner}}{% endif %}</td>
{% for status in statuses %}
<td>{{stats['builds'].get(runner).get(status, 0)}}</td>
{% endfor %}
</tr>
+ {% endif %}
{% endfor %}
</table>
<th>Maximum</th>
<th>Total</th>
</tr>
- {% for runner in stats['builds'].keys() | sort %}
+ {% for runner in runners %}
+ {% if runner in stats['times'] and version in stats['times'][runner] %}
<tr>
- <td>{% if runner != 'all' %}<a href="/runners/{runner}">{{runner}}</a>{% else %}{{runner}}{% endif %}</td>
+ <td>{% if runner != 'all' %}<a href="/runners/{{runner}}">{{runner}}</a>{% else %}{{runner}}{% endif %}</td>
<td>{{(stats['times'][runner][version]['avg'] / 60) | round(2)}} minutes</td>
<td>{{(stats['times'][runner][version]['min'] / 60) | round(2)}} minutes</td>
<td>{{(stats['times'][runner][version]['max'] / 60) | round(2)}} minutes</td>
<td>{{(stats['times'][runner][version]['sum'] / 60 / 60 / 24) | round(2)}} days </td>
</tr>
+ {% endif %}
{% endfor %}
</table>
{% endfor %}