mirror of
https://github.com/searxng/searxng.git
synced 2025-08-27 13:56:57 +02:00
[feat] results: show response times
This commit is contained in:
parent
b09aa7e360
commit
e65edb141d
4 changed files with 50 additions and 24 deletions
|
@ -761,6 +761,11 @@ def search():
|
|||
)
|
||||
)
|
||||
|
||||
# engine_timings: get engine response times sorted from slowest to fastest
|
||||
engine_timings = sorted(result_container.get_timings(), reverse=True, key=lambda e: e.total)
|
||||
max_response_time = engine_timings[0].total if engine_timings else None
|
||||
engine_timings_pairs = [(timing.engine, timing.total) for timing in engine_timings]
|
||||
|
||||
# search_query.lang contains the user choice (all, auto, en, ...)
|
||||
# when the user choice is "auto", search.search_query.lang contains the detected language
|
||||
# otherwise it is equals to search_query.lang
|
||||
|
@ -789,7 +794,9 @@ def search():
|
|||
settings['search']['languages'],
|
||||
fallback=request.preferences.get_value("language")
|
||||
),
|
||||
timeout_limit = request.form.get('timeout_limit', None)
|
||||
timeout_limit = request.form.get('timeout_limit', None),
|
||||
timings = engine_timings_pairs,
|
||||
max_response_time = max_response_time
|
||||
# fmt: on
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue