mirror of
https://github.com/searxng/searxng.git
synced 2025-07-23 13:19:17 +02:00
[enh] Add Server-Timing header (#1637)
Server Timing specification: https://www.w3.org/TR/server-timing/ In the browser Dev Tools, focus on the main request, there are the responses per engine in the Timing tab.
This commit is contained in:
parent
cfcbc3a5c3
commit
554a21e1d0
4 changed files with 70 additions and 15 deletions
|
@ -33,6 +33,19 @@ class ViewsTestCase(SearxTestCase):
|
|||
},
|
||||
]
|
||||
|
||||
timings = [
|
||||
{
|
||||
'engine': 'startpage',
|
||||
'total': 0.8,
|
||||
'load': 0.7
|
||||
},
|
||||
{
|
||||
'engine': 'youtube',
|
||||
'total': 0.9,
|
||||
'load': 0.6
|
||||
}
|
||||
]
|
||||
|
||||
def search_mock(search_self, *args):
|
||||
search_self.result_container = Mock(get_ordered_results=lambda: self.test_results,
|
||||
answers=set(),
|
||||
|
@ -42,7 +55,8 @@ class ViewsTestCase(SearxTestCase):
|
|||
unresponsive_engines=set(),
|
||||
results=self.test_results,
|
||||
results_number=lambda: 3,
|
||||
results_length=lambda: len(self.test_results))
|
||||
results_length=lambda: len(self.test_results),
|
||||
get_timings=lambda: timings)
|
||||
|
||||
Search.search = search_mock
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue