stats.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. {% from 'simple/icons.html' import icon_big %}
  2. {% from '__common__/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. {{ column_name }} {{ icon_big('arrow-dropdown') }}
  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 aria-labelledby="{{engine_stat.name}}_score" >{{ engine_stat.score|round(1) }}</span>
  33. <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_score">{{- "" -}}
  34. <p>{{ _('Scores per result') }}: {{ engine_stat.score_per_result | round(3) }}</p>
  35. </div>
  36. {% endif %}
  37. </td>
  38. <td class="engine-result-count">
  39. {%- if engine_stat.result_count -%}
  40. <div class="bar-chart-value">{{- engine_stat.result_count | int -}}</div>{{- "" -}}
  41. <div class="bar-chart-graph" aria-hidden="true">
  42. <div class="bar-chart-bar bar{{ (100 * engine_stat.result_count / engine_stats.max_result_count)|round }}"></div>{{- "" -}}
  43. </div>
  44. {%- endif -%}
  45. </td>
  46. <td class="response-time">
  47. {%- if engine_stat.total is not none -%}
  48. <div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
  49. <div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">
  50. {% 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 -%}
  51. {% 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 -%}
  52. </div>
  53. <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
  54. <table>
  55. <tr>
  56. <th scope="col"></th>
  57. <th scope="col">{{ _('Total') }}</th>
  58. <th scope="col">{{ _('HTTP') }}</th>
  59. <th scope="col">{{ _('Processing') }}</th>
  60. </tr>
  61. <tr>
  62. <th scope="col">{{ _('Median') }}</th>
  63. <td>{{ engine_stat.total }}</td>
  64. <td>{{ engine_stat.http or ''}}</td>
  65. <td>{{ engine_stat.processing }}</td>
  66. </tr>
  67. <tr>
  68. <th scope="col">{{ _('P80') }}</th>
  69. <td>{{ engine_stat.total_p80 }}</td>
  70. <td>{{ engine_stat.http_p80 or '' }}</td>
  71. <td>{{ engine_stat.processing_p80 }}</td>
  72. </tr>
  73. <tr>
  74. <th scope="col">{{ _('P95') }}</th>
  75. <td>{{ engine_stat.total_p95 }}</td>
  76. <td>{{ engine_stat.http_p95 or '' }}</td>
  77. <td>{{ engine_stat.processing_p95 }}</td>
  78. </tr>
  79. </table>
  80. </div>
  81. {%- endif -%}
  82. </td>
  83. <td class="engine-reliability"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td>
  84. </tr>
  85. {% endfor %}
  86. </table>
  87. {% endif %}
  88. <div>
  89. {% if selected_engine_name %}
  90. {% for secondary in [False, True] %}
  91. {% set ns = namespace(first=true) %}
  92. {% for error in engine_reliabilities[selected_engine_name].errors %}
  93. {% if secondary == error.secondary %}
  94. {% if ns.first %}
  95. {% set ns.first = false %}
  96. <h3>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h3>
  97. {% endif %}
  98. <table class="engine-error">
  99. <tbody>
  100. <tr>
  101. {%- if error.exception_classname -%}
  102. <th scope="row" class="engine-error-type">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td>
  103. {%- elif error.log_message -%}
  104. <th scope="row" class="engine-error-type">{{ _('Message') }}</th><td>{{ error.log_message }}</td>
  105. {%- endif -%}
  106. <th scope="row" class="engine-error-type">{{ _('Percentage') }}</th><td class="engine-error-type">{{ error.percentage }}</td>
  107. </tr>
  108. {% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}}
  109. <td colspan="3">
  110. {%- for param in error.log_parameters -%}
  111. <span class="log_parameters">{{ param }}</span>
  112. {%- endfor -%}
  113. </td>
  114. </tr>
  115. {% endif %}
  116. <tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr>
  117. <tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr>
  118. <tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr>
  119. </tbody>
  120. </table>
  121. {% endif %}
  122. {% endfor %}
  123. {% endfor %}
  124. {% if engine_reliabilities[selected_engine_name].checker %}
  125. <h3>{{ _('Checker') }}</h3>
  126. <table>
  127. <tr>
  128. <th scope="col" class="failed-test">{{ _('Failed test') }}</th>
  129. <th scope="col">{{ _('Comment(s)') }}</th>
  130. </tr>
  131. {% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %}
  132. <tr>
  133. <td>{{ test_name }}</td>
  134. <td>
  135. {% for r in results %}<p>{{ r }}</p>{% endfor %}
  136. </td>
  137. </tr>
  138. {% endfor %}
  139. </table>
  140. {% endif %}
  141. {{ new_issue(selected_engine_name, engine_reliabilities[selected_engine_name]) }}
  142. {% endif %}
  143. </div>
  144. {% endblock %}