2021-04-23 19:08:48 +00:00
{% extends 'oscar/base.html' %}
2021-07-18 13:38:52 +00:00
{% from '__common__/new_issue.html' import new_issue with context %}
2021-04-14 16:11:35 +00:00
2021-04-23 19:08:48 +00:00
{% block title %}{{ _('stats') }} - {% if selected_engine_name %} {{ selected_engine_name }} - {% endif %}{% endblock %}
2021-04-22 15:47:53 +00:00
{%- macro th_sort(column_order, column_name) -%}
2021-04-23 19:08:48 +00:00
{%- if selected_engine_name -%}
{{ column_name }}
{%- elif column_order==sort_order -%}
{{ column_name }} {{ icon('arrow-dropdown') }}
{%- else -%}
< a href = "{{ url_for('stats', sort=column_order) }}" > {{ column_name }}< / a >
{%- endif -%}
2021-04-22 15:47:53 +00:00
{%- endmacro -%}
2014-09-22 20:42:29 +00:00
{% block content %}
< div class = "container-fluid" >
2021-04-23 19:08:48 +00:00
< h1 > {{ _('Engine stats') }}{% if selected_engine_name %} - {{ selected_engine_name }}{% endif %}< / h1 >
2014-09-22 20:42:29 +00:00
< div class = "row" >
2021-04-22 10:14:11 +00:00
< div class = "col-xs-12 col-sm-12 col-md-12" >
< div class = "table-responsive" >
{% if not engine_stats.get('time') %}
< div class = "col-sm-12 col-md-12" >
{% include 'oscar/messages/no_data_available.html' %}
2014-09-22 20:42:29 +00:00
< / div >
2021-04-22 10:14:11 +00:00
{% else %}
2021-05-16 15:57:04 +00:00
< table class = "table table-hover table-condensed table-striped engine-stats" >
2021-04-22 10:14:11 +00:00
< tr >
2021-05-16 15:57:04 +00:00
< th scope = "col" class = "engine-name" > {{ th_sort('name', _("Engine name")) }}< / th >
2021-05-17 15:56:18 +00:00
< th scope = "col" class = "engine-score" > {{ th_sort('score', _('Scores')) }}< / th >
2021-05-16 15:57:04 +00:00
< th scope = "col" class = "result-count" > {{ th_sort('result_count', _('Result count')) }}< / th >
< th scope = "col" class = "response-time" > {{ th_sort('time', _('Response time')) }}< / th >
< th scope = "col" class = "engine-reliability" > {{ th_sort('reliability', _('Reliability')) }}< / th >
2021-04-22 10:14:11 +00:00
< / tr >
{% for engine_stat in engine_stats.get('time', []) %}
< tr >
2021-05-16 15:57:04 +00:00
< td class = "engine-name" > < a href = "{{ url_for('stats', engine=engine_stat.name|e) }}" > {{ engine_stat.name }}< / a > < / td >
2021-05-17 15:56:18 +00:00
< td class = "engine-score" >
2021-04-23 19:08:48 +00:00
{%- if engine_stat.score -%}
2021-04-22 10:14:11 +00:00
< span aria-labelledby = "{{engine_stat.name}}_score" > {{ engine_stat.score|round(1) }}< / span >
2021-04-23 09:01:54 +00:00
< div class = "engine-tooltip text-left" role = "tooltip" id = "{{engine_stat.name}}_score" > {{- "" -}}
2021-04-22 10:14:11 +00:00
< p > {{ _('Scores per result') }}: {{ engine_stat.score_per_result | round(3) }}< / p >
< / div >
2021-04-23 19:08:48 +00:00
{%- endif -%}
2021-04-22 10:14:11 +00:00
< / td >
2021-05-16 15:57:04 +00:00
< td class = "result-count" >
2021-04-22 15:47:53 +00:00
{%- if engine_stat.result_count -%}
2021-05-16 11:16:44 +00:00
< div class = "bar-chart-value" > {{- engine_stat.result_count | int -}}< / div > {{- "" -}}
2021-05-17 15:56:18 +00:00
< div class = "bar-chart-graph" aria-hidden = "true" > {{- "" -}}
< div class = "bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}" > < / div > {{- "" -}}
< / div >
2021-04-22 15:47:53 +00:00
{%- endif -%}
2021-04-22 10:14:11 +00:00
< / td >
2021-05-16 15:57:04 +00:00
< td class = "response-time" >
2021-05-19 09:28:57 +00:00
{%- if engine_stat.total is not none -%}
2021-05-16 11:16:44 +00:00
< div class = "bar-chart-value" > {{- engine_stat.total | round(1) -}}< / div > {{- "" -}}
2021-05-17 15:56:18 +00:00
< div class = "bar-chart-graph" aria-labelledby = "{{engine_stat.name}}_time" aria-hidden = "true" > {{- "" -}}
2021-05-19 09:28:57 +00:00
{% if engine_stat.http is not none and engine_stats.max_time %}< div class = "bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}" > < / div > {%- endif -%}
{% if engine_stat.processing is not none and engine_stats.max_time %}< div class = "bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}" > < / div > {%- endif -%}
2021-05-17 15:56:18 +00:00
< / div >
2021-04-23 09:01:54 +00:00
< div class = "engine-tooltip text-left" role = "tooltip" id = "{{engine_stat.name}}_time" > {{- "" -}}
2021-04-22 10:14:11 +00:00
< table class = "table table-striped" >
< tr >
< th scope = "col" > < / th >
< th scope = "col" > {{ _('Total') }}< / th >
< th scope = "col" > {{ _('HTTP') }}< / th >
< th scope = "col" > {{ _('Processing') }}< / th >
< / tr >
< tr >
< th scope = "col" > {{ _('Median') }}< / th >
< td > {{ engine_stat.total }}< / td >
2021-05-19 09:28:57 +00:00
< td > {{ engine_stat.http or '' }}< / td >
2021-04-22 10:14:11 +00:00
< td > {{ engine_stat.processing }}< / td >
< / tr >
< tr >
< th scope = "col" > {{ _('P80') }}< / th >
< td > {{ engine_stat.total_p80 }}< / td >
2021-05-19 09:28:57 +00:00
< td > {{ engine_stat.http_p80 or '' }}< / td >
2021-04-22 10:14:11 +00:00
< td > {{ engine_stat.processing_p80 }}< / td >
< / tr >
< tr >
< th scope = "col" > {{ _('P95') }}< / th >
< td > {{ engine_stat.total_p95 }}< / td >
2021-05-19 09:28:57 +00:00
< td > {{ engine_stat.http_p95 or '' }}< / td >
2021-04-22 10:14:11 +00:00
< td > {{ engine_stat.processing_p95 }}< / td >
< / tr >
< / table >
< / div >
2021-04-22 15:47:53 +00:00
{%- endif -%}
2021-04-22 10:14:11 +00:00
< / td >
2021-05-16 15:57:04 +00:00
< td class = "engine-reliability" > {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}< / td >
2021-04-22 10:14:11 +00:00
< / tr >
{% endfor %}
< / table >
2014-09-26 16:26:46 +00:00
{% endif %}
2014-09-22 20:42:29 +00:00
< / div >
< / div >
2021-04-23 19:08:48 +00:00
< div class = "col-xs-12 col-sm-12 col-md-12" >
{% if selected_engine_name %}
{% for secondary in [False, True] %}
{% set ns = namespace(first=true) %}
{% for error in engine_reliabilities[selected_engine_name].errors %}
{% if secondary == error.secondary %}
{% if ns.first %}
{% set ns.first = false %}
< h3 > {% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}< / h3 >
{% endif %}
2021-05-16 15:57:04 +00:00
< table class = "table table-striped table-bordered engine-error" >
< tbody >
2021-04-23 19:08:48 +00:00
< tr >
{%- if error.exception_classname -%}
2021-05-16 15:57:04 +00:00
< th scope = "row" class = "engine-error-type" > {{ _('Exception') }}< / th > < td > {{ error.exception_classname }}< / td >
2021-04-23 19:08:48 +00:00
{%- elif error.log_message -%}
2021-05-16 15:57:04 +00:00
< th scope = "row" class = "engine-error-type" > {{ _('Message') }}< / th > < td > {{ error.log_message }}< / td >
2021-04-23 19:08:48 +00:00
{%- endif -%}
2021-05-16 15:57:04 +00:00
< th scope = "row" class = "engine-error-type" > {{ _('Percentage') }}< / th > < td class = "engine-error-type" > {{ error.percentage }}< / td >
2021-04-23 19:08:48 +00:00
< / tr >
{% if error.log_parameters and error.log_parameters != (None, None, None) %}< tr > < th scope = "row" > {{ _('Parameter') }}< / th > {{- '' -}}
< td colspan = "3" >
{%- for param in error.log_parameters -%}
2021-05-16 15:57:04 +00:00
< span class = "log_parameters" > {{ param }}< / span >
2021-04-23 19:08:48 +00:00
{%- endfor -%}
< / td >
< / tr >
{% endif %}
< tr > < th scope = "row" > {{ _('Filename') }}< / th > < td colspan = "3" > {{ error.filename }}:{{ error.line_no }}< / td > < / tr >
< tr > < th scope = "row" > {{ _('Function') }}< / th > < td colspan = "3" > {{ error.function }}< / td > < / tr >
< tr > < th scope = "row" > {{ _('Code') }}< / th > < td colspan = "3" > {{ error.code }}< / td > < / tr >
< / tbody >
< / table >
{% endif %}
{% endfor %}
{% endfor %}
{% if engine_reliabilities[selected_engine_name].checker %}
< h3 > {{ _('Checker') }}< / h3 >
< table class = "table table-striped table-bordered" >
< tr >
2021-05-16 15:57:04 +00:00
< th scope = "col" class = "failed-test" > {{ _('Failed test') }}< / th >
2021-04-23 19:08:48 +00:00
< th scope = "col" > {{ _('Comment(s)') }}< / th >
< / tr >
{% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %}
< tr >
< td > {{ test_name }}< / td >
< td >
{% for r in results %}< p > {{ r }}< / p > {% endfor %}
< / td >
< / tr >
{% endfor %}
< / table >
{% endif %}
2021-07-18 13:38:52 +00:00
{{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }}
2021-04-23 19:08:48 +00:00
{% endif %}
< / div >
2014-09-22 20:42:29 +00:00
< / div >
< / div >
2021-04-23 19:08:48 +00:00
2014-09-22 20:42:29 +00:00
{% endblock %}