summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/stats.html
blob: 0851343ce5b7d307776a6de35473f15059dd3d58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% extends "oscar/base.html" %}
{% block styles %}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/charts.min.css') }}" type="text/css" />
    <style>
        #engine-times {
          --labels-size: 20rem;
        }

        #engine-times th {
            text-align: right;
        }
    </style>
{% endblock %}
{% block title %}{{ _('stats') }} - {% endblock %}
{% block content %}
<div class="container-fluid">
    <h1>{{ _('Engine stats') }}</h1>
    <div class="row">
        <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' %}
                    </div>
                {% else %}
                    <table class="table table-hover table-condensed table-striped">
                        <tr>
                            <th scope="col" style="width:20rem;">{{ _("Engine name") }}</th>
                            <th scope="col" style="width:7rem; text-align: right;">{{ _('Scores') }}</th>
                            <th scope="col">{{ _('Number of results') }}</th>
                            <th scope="col">{{ _('Response time') }}</th>
                        </tr>
                        {% for engine_stat in engine_stats.get('time', []) %}
                        <tr>
                            <td>{{ engine_stat.name }}</td>
                            <td style="text-align: right;">
                                <span aria-labelledby="{{engine_stat.name}}_score" >{{ engine_stat.score|round(1) }}</span>
                                <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_score">{{- "" -}}
                                    <p>{{ _('Scores per result') }}: {{ engine_stat.score_per_result | round(3) }}</p>
                                </div>
                            </td>
                            <td>
                                <span class="stacked-bar-chart-value">{{- engine_stat.result_count | int -}}</span>{{- "" -}}
                                <span class="stacked-bar-chart" aria-labelledby="{{engine_stat.name}}_chart_result_count" aria-hidden="true">{{- "" -}}
                                    <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
                                </span>{{- "" -}}
                            </td>
                            <td>
                                <span class="stacked-bar-chart-value">{{- engine_stat.total | round(1) -}}</span>{{- "" -}}
                                <span class="stacked-bar-chart" aria-labelledby="{{engine_stat.name}}_chart" aria-hidden="true">{{- "" -}}
                                    <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
                                    <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}
                                </span>{{- "" -}}
                                <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_chart">{{- "" -}}
                                    <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>
                                            <td>{{ engine_stat.http }}</td>
                                            <td>{{ engine_stat.processing }}</td>
                                        </tr>
                                        <tr>
                                            <th scope="col">{{ _('P80') }}</th>
                                            <td>{{ engine_stat.total_p80 }}</td>
                                            <td>{{ engine_stat.http_p80 }}</td>
                                            <td>{{ engine_stat.processing_p80 }}</td>
                                        </tr>
                                        <tr>
                                            <th scope="col">{{ _('P95') }}</th>
                                            <td>{{ engine_stat.total_p95 }}</td>
                                            <td>{{ engine_stat.http_p95 }}</td>
                                            <td>{{ engine_stat.processing_p95 }}</td>
                                        </tr>
                                    </table>
                                </div>
                            </td>
                        </tr>
                        {% endfor %}
                    </table>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %}