stats.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {% from 'simple/icons.html' import icon_big %}
  2. {% from 'simple/new_issue.html' import new_issue with context %}
  3. {% extends "simple/page_with_header.html" %}
  4. {%- macro th_sort(column_order, column_name) -%}
  5. {% if selected_engine_name %}
  6. {{ column_name }}
  7. {% elif column_order==sort_order %}
  8. {{ icon_big('navigate-down') }} {{ column_name }}
  9. {% else %}
  10. <a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}</a>
  11. {% endif %}
  12. {%- endmacro -%}
  13. {% block head %} {% endblock %}
  14. {% block content %}
  15. <h1>{% if selected_engine_name %}<a href="{{ url_for('stats') }}">{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %}</a> - {{ selected_engine_name }}{% endif %}</h1>
  16. {% if not engine_stats.get('time') %}
  17. {{ _('There is currently no data available. ') }}
  18. {% else %}
  19. <table class="engine-stats">
  20. <tr>
  21. <th scope="col" class="engine-name">{{ th_sort('name', _("Engine name")) }}</th>
  22. <th scope="col" class="engine-score">{{ th_sort('score', _('Scores')) }}</th>
  23. <th scope="col" class="result-count">{{ th_sort('result_count', _('Result count')) }}</th>
  24. <th scope="col" class="response-time">{{ th_sort('time', _('Response time')) }}</th>
  25. <th scope="col" class="engine-reliability">{{ th_sort('reliability', _('Reliability')) }}</th>
  26. </tr>
  27. {% for engine_stat in engine_stats.get('time', []) %}
  28. <tr>
  29. <td class="engine-name"><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a></td>
  30. <td class="engine-score">
  31. {% if engine_stat.score %}
  32. <span>{{ engine_stat.score_per_result|round(1) }}</span>
  33. {% endif %}
  34. </td>
  35. <td class="engine-result-count">
  36. {%- if engine_stat.result_count -%}
  37. <div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}}
  38. <div class="bar-chart-graph" aria-hidden="true">
  39. <div class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}"></div>{{- "" -}}
  40. </div>
  41. {%- endif -%}
  42. </td>
  43. <td class="response-time">
  44. {%- if engine_stat.total is not none -%}
  45. <div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
  46. <div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">
  47. {% 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 -%}
  48. {% 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 -%}
  49. </div>
  50. <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
  51. <table>
  52. <tr>
  53. <th scope="col"></th>
  54. <th scope="col">{{ _('Total') }}</th>
  55. <th scope="col">{{ _('HTTP') }}</th>
  56. <th scope="col">{{ _('Processing') }}</th>
  57. </tr>
  58. <tr>
  59. <th scope="col">{{ _('Median') }}</th>
  60. <td>{{ engine_stat.total }}</td>
  61. <td>{{ engine_stat.http or ''}}</td>
  62. <td>{{ engine_stat.processing }}</td>
  63. </tr>
  64. <tr>
  65. <th scope="col">{{ _('P80') }}</th>
  66. <td>{{ engine_stat.total_p80 }}</td>
  67. <td>{{ engine_stat.http_p80 or '' }}</td>
  68. <td>{{ engine_stat.processing_p80 }}</td>
  69. </tr>
  70. <tr>
  71. <th scope="col">{{ _('P95') }}</th>
  72. <td>{{ engine_stat.total_p95 }}</td>
  73. <td>{{ engine_stat.http_p95 or '' }}</td>
  74. <td>{{ engine_stat.processing_p95 }}</td>
  75. </tr>
  76. </table>
  77. </div>
  78. {%- endif -%}
  79. </td>
  80. <td class="engine-reliability"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliability') }}</td>
  81. </tr>
  82. {% endfor %}
  83. </table>
  84. {% endif %}
  85. {% if selected_engine_name %}
  86. <div class="engine-errors">
  87. {% for secondary in [False, True] %}
  88. {% set ns = namespace(first=true) %}
  89. {% for error in engine_reliabilities[selected_engine_name].errors %}
  90. {% if secondary == error.secondary %}
  91. {% if ns.first %}
  92. {% set ns.first = false %}
  93. <h2>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h2>
  94. {% endif %}
  95. <table class="engine-error">
  96. <tbody>
  97. <tr>
  98. {%- if error.exception_classname -%}
  99. <th scope="row" class="engine-error-type">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td>
  100. {%- elif error.log_message -%}
  101. <th scope="row" class="engine-error-type">{{ _('Message') }}</th><td>{{ error.log_message }}</td>
  102. {%- endif -%}
  103. <th scope="row" class="engine-error-type">{{ _('Percentage') }}</th><td class="engine-error-type">{{ error.percentage }}</td>
  104. </tr>
  105. {% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}}
  106. <td colspan="3">
  107. {%- for param in error.log_parameters -%}
  108. <span class="log_parameters">{{ param }}</span>
  109. {%- endfor -%}
  110. </td>
  111. </tr>
  112. {% endif %}
  113. <tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr>
  114. <tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr>
  115. <tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr>
  116. </tbody>
  117. </table>
  118. {% endif %}
  119. {% endfor %}
  120. {% endfor %}
  121. {% if engine_reliabilities[selected_engine_name].checker %}
  122. <h3>{{ _('Checker') }}</h3>
  123. <table>
  124. <tr>
  125. <th scope="col" class="failed-test">{{ _('Failed test') }}</th>
  126. <th scope="col">{{ _('Comment(s)') }}</th>
  127. </tr>
  128. {% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %}
  129. <tr>
  130. <td>{{ test_name }}</td>
  131. <td>
  132. {% for r in results %}<p>{{ r }}</p>{% endfor %}
  133. </td>
  134. </tr>
  135. {% endfor %}
  136. </table>
  137. {% endif %}
  138. {{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }}
  139. </div>
  140. {% endif %}
  141. {% endblock %}