stats.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {% from 'simple/macros.html' import icon %}
  2. {% extends "simple/base.html" %}
  3. {%- macro th_sort(column_order, column_name) -%}
  4. {% if column_order==sort_order %}
  5. {{ column_name }} {{ icon('arrow-dropdown') }}
  6. {% else %}
  7. <a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}
  8. {% endif %}
  9. {%- endmacro -%}
  10. {% block head %} {% endblock %}
  11. {% block content %}
  12. <a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>
  13. <h2>{{ _('Engine stats') }}</h2>
  14. {% if not engine_stats.get('time') %}
  15. {{ _('There is currently no data available. ') }}
  16. {% else %}
  17. <table style="max-width: 1280px; margin: 0 auto;">
  18. <tr>
  19. <th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th>
  20. <th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th>
  21. <th scope="col">{{ th_sort('result_count', _('Result count')) }}</th>
  22. <th scope="col">{{ th_sort('time', _('Response time')) }}</th>
  23. <th scope="col" style="text-align: right;">{{ th_sort('reliability', _('Reliability')) }}</th>
  24. </tr>
  25. {% for engine_stat in engine_stats.get('time', []) %}
  26. <tr>
  27. <td>{{ engine_stat.name }}</td>
  28. <td style="text-align: right;">
  29. {% if engine_stat.score %}
  30. <span aria-labelledby="{{engine_stat.name}}_score" >{{ engine_stat.score|round(1) }}</span>
  31. <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_score">{{- "" -}}
  32. <p>{{ _('Scores per result') }}: {{ engine_stat.score_per_result | round(3) }}</p>
  33. </div>
  34. {% endif %}
  35. </td>
  36. <td>
  37. {%- if engine_stat.result_count -%}
  38. <span class="stacked-bar-chart-value">{{- engine_stat.result_count | int -}}</span>{{- "" -}}
  39. <span class="stacked-bar-chart" aria-hidden="true">{{- "" -}}
  40. <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
  41. </span>
  42. {%- endif -%}
  43. </td>
  44. <td>
  45. {%- if engine_stat.total -%}
  46. <span class="stacked-bar-chart-value">{{- engine_stat.total | round(1) -}}</span>{{- "" -}}
  47. <span class="stacked-bar-chart" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">{{- "" -}}
  48. <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
  49. <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}
  50. </span>{{- "" -}}
  51. <div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
  52. <table>
  53. <tr>
  54. <th scope="col"></th>
  55. <th scope="col">{{ _('Total') }}</th>
  56. <th scope="col">{{ _('HTTP') }}</th>
  57. <th scope="col">{{ _('Processing') }}</th>
  58. </tr>
  59. <tr>
  60. <th scope="col">{{ _('Median') }}</th>
  61. <td>{{ engine_stat.total }}</td>
  62. <td>{{ engine_stat.http }}</td>
  63. <td>{{ engine_stat.processing }}</td>
  64. </tr>
  65. <tr>
  66. <th scope="col">{{ _('P80') }}</th>
  67. <td>{{ engine_stat.total_p80 }}</td>
  68. <td>{{ engine_stat.http_p80 }}</td>
  69. <td>{{ engine_stat.processing_p80 }}</td>
  70. </tr>
  71. <tr>
  72. <th scope="col">{{ _('P95') }}</th>
  73. <td>{{ engine_stat.total_p95 }}</td>
  74. <td>{{ engine_stat.http_p95 }}</td>
  75. <td>{{ engine_stat.processing_p95 }}</td>
  76. </tr>
  77. </table>
  78. </div>
  79. {%- endif -%}
  80. </td>
  81. <td style="text-align: right;"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td>
  82. </tr>
  83. {% endfor %}
  84. </table>
  85. {% endif %}
  86. {% endblock %}