...
 
Commits (2)
......@@ -127,7 +127,9 @@ def web_runner(runner):
@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():
......
......@@ -17,7 +17,8 @@ def process(request):
stages = data.get('builds')
build = Build.get_or_create_by_id(pipeline.get('id'))
build.build_status = pipeline.get('status')
build.build_duration = pipeline.get('duration')
if build.build_status == "success":
build.build_duration = pipeline.get('duration')
for variable in pipeline.get("variables"):
if variable.get('key') == "VERSION":
build.build_version = variable.get("value")
......
......@@ -5,6 +5,7 @@
{% 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">
......@@ -14,13 +15,15 @@
<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>
......@@ -34,14 +37,16 @@
<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 %}
......