diff options
| author | Alexandre Flament <alex@al-f.net> | 2021-04-22 08:34:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-22 08:34:17 +0200 |
| commit | c6d5605d272c963b075bf17eba7407d0a700cd2a (patch) | |
| tree | 799ef589f587465f1b8d323fc1f569b1c7590f2a /searx/search/checker/impl.py | |
| parent | b7848e342273526192a3392dcfd8c291196506ac (diff) | |
| parent | baff1cbbab8a72155823c3186971a5f56d7a92f2 (diff) | |
Merge pull request #7 from searxng/metrics
Metrics
Diffstat (limited to 'searx/search/checker/impl.py')
| -rw-r--r-- | searx/search/checker/impl.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/search/checker/impl.py b/searx/search/checker/impl.py index e54b3f68d..dd090c513 100644 --- a/searx/search/checker/impl.py +++ b/searx/search/checker/impl.py @@ -4,8 +4,8 @@ import typing import types import functools import itertools -import threading from time import time +from timeit import default_timer from urllib.parse import urlparse import re @@ -17,6 +17,7 @@ from searx import network, logger from searx.results import ResultContainer from searx.search.models import SearchQuery, EngineRef from searx.search.processors import EngineProcessor +from searx.metrics import counter_inc logger = logger.getChild('searx.search.checker') @@ -385,9 +386,8 @@ class Checker: engineref_category = search_query.engineref_list[0].category params = self.processor.get_params(search_query, engineref_category) if params is not None: - with threading.RLock(): - self.processor.engine.stats['sent_search_count'] += 1 - self.processor.search(search_query.query, params, result_container, time(), 5) + counter_inc('engine', search_query.engineref_list[0].name, 'search', 'count', 'sent') + self.processor.search(search_query.query, params, result_container, default_timer(), 5) return result_container def get_result_container_tests(self, test_name: str, search_query: SearchQuery) -> ResultContainerTests: |