mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
Bump slow query threshold to 1.2s
(imported from commit 8d97fc22d208274bc57b884828957dacf396348a)
This commit is contained in:
@@ -66,7 +66,7 @@ def format_timedelta(timedelta):
|
|||||||
return "%.0fms" % (timedelta_ms(timedelta),)
|
return "%.0fms" % (timedelta_ms(timedelta),)
|
||||||
|
|
||||||
def is_slow_query(time_delta, path):
|
def is_slow_query(time_delta, path):
|
||||||
if time_delta < 1:
|
if time_delta < 1.2:
|
||||||
return False
|
return False
|
||||||
is_exempt = \
|
is_exempt = \
|
||||||
path in ["/activity", "/json/report_error",
|
path in ["/activity", "/json/report_error",
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ API_KEYS = {}
|
|||||||
|
|
||||||
class SlowQueryTest(TestCase):
|
class SlowQueryTest(TestCase):
|
||||||
def test_is_slow_query(self):
|
def test_is_slow_query(self):
|
||||||
self.assertFalse(is_slow_query(0.9, '/some/random/url'))
|
self.assertFalse(is_slow_query(1.1, '/some/random/url'))
|
||||||
self.assertTrue(is_slow_query(2, '/some/random/url'))
|
self.assertTrue(is_slow_query(2, '/some/random/url'))
|
||||||
self.assertFalse(is_slow_query(2, '/activity'))
|
self.assertFalse(is_slow_query(2, '/activity'))
|
||||||
self.assertFalse(is_slow_query(2, '/json/report_error'))
|
self.assertFalse(is_slow_query(2, '/json/report_error'))
|
||||||
|
|||||||
Reference in New Issue
Block a user