summaryrefslogtreecommitdiff
path: root/searx/metrics
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-04-22 16:05:39 +0200
committerAlexandre Flament <alex@al-f.net>2021-04-24 06:58:49 +0200
commitc54bf42cb9699501ccbd54a2df0d7fa73be8dcdb (patch)
tree89bf4cb7ec2402644f25f3c318f4591331036350 /searx/metrics
parent65c29081cc3debad9b77194cb917f5b04ea4ac72 (diff)
downloadsearxng-c54bf42cb9699501ccbd54a2df0d7fa73be8dcdb.tar.gz
searxng-c54bf42cb9699501ccbd54a2df0d7fa73be8dcdb.zip
[mod] metrics: add to pylint and justify indentations
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/metrics')
-rw-r--r--searx/metrics/__init__.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py
index 063554f1a..9648e6215 100644
--- a/searx/metrics/__init__.py
+++ b/searx/metrics/__init__.py
@@ -1,4 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
+# pylint: disable=missing-module-docstring, missing-function-docstring
import typing
import math
@@ -63,7 +64,7 @@ def initialize(engine_names=None):
"""
Initialize metrics
"""
- global counter_storage, histogram_storage
+ global counter_storage, histogram_storage # pylint: disable=global-statement
counter_storage = CounterStorage()
histogram_storage = HistogramStorage()
@@ -164,20 +165,21 @@ def get_engines_stats(engine_list):
max_time_total = max(time_total, max_time_total or 0)
max_result_count = max(result_count, max_result_count or 0)
- list_time.append({'total': round(time_total, 1),
- 'total_p80': round(time_total_p80, 1),
- 'total_p95': round(time_total_p95, 1),
- 'http': round(time_http, 1),
- 'http_p80': round(time_http_p80, 1),
- 'http_p95': round(time_http_p95, 1),
- 'name': engine_name,
- 'processing': round(time_total - time_http, 1),
- 'processing_p80': round(time_total_p80 - time_http_p80, 1),
- 'processing_p95': round(time_total_p95 - time_http_p95, 1),
- 'score': score,
- 'score_per_result': score_per_result,
- 'result_count': result_count,
- })
+ list_time.append({
+ 'total': round(time_total, 1),
+ 'total_p80': round(time_total_p80, 1),
+ 'total_p95': round(time_total_p95, 1),
+ 'http': round(time_http, 1),
+ 'http_p80': round(time_http_p80, 1),
+ 'http_p95': round(time_http_p95, 1),
+ 'name': engine_name,
+ 'processing': round(time_total - time_http, 1),
+ 'processing_p80': round(time_total_p80 - time_http_p80, 1),
+ 'processing_p95': round(time_total_p95 - time_http_p95, 1),
+ 'score': score,
+ 'score_per_result': score_per_result,
+ 'result_count': result_count,
+ })
return {
'time': list_time,