summaryrefslogtreecommitdiff
path: root/searx/search
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-12-26 22:44:46 +0100
committerAlexandre Flament <alex@al-f.net>2022-01-05 19:03:04 +0100
commit2134703b4bb9847d0efeac3b28ceefb7d1f26271 (patch)
tree054d617ef416a552749cf1cf7761d45f12f348b3 /searx/search
parenta7199bc08552fbd3a8cf8b257aeded5b26591afb (diff)
downloadsearxng-2134703b4bb9847d0efeac3b28ceefb7d1f26271.tar.gz
searxng-2134703b4bb9847d0efeac3b28ceefb7d1f26271.zip
[enh] settings.yml: implement general.enable_metrics
* allow not to record metrics (response time, etc...) * this commit doesn't change the UI. If the metrics are disabled /stats and /stats/errors will return empty response. in /preferences, the columns response time and reliability will be empty.
Diffstat (limited to 'searx/search')
-rw-r--r--searx/search/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/search/__init__.py b/searx/search/__init__.py
index d66f3362d..e790bd05e 100644
--- a/searx/search/__init__.py
+++ b/searx/search/__init__.py
@@ -24,13 +24,13 @@ from searx.search.checker import initialize as initialize_checker
logger = logger.getChild('search')
-def initialize(settings_engines=None, enable_checker=False, check_network=False):
+def initialize(settings_engines=None, enable_checker=False, check_network=False, enable_metrics=True):
settings_engines = settings_engines or settings['engines']
load_engines(settings_engines)
initialize_network(settings_engines, settings['outgoing'])
if check_network:
check_network_configuration()
- initialize_metrics([engine['name'] for engine in settings_engines])
+ initialize_metrics([engine['name'] for engine in settings_engines], enable_metrics)
initialize_processors(settings_engines)
if enable_checker:
initialize_checker()