From eb6868704fe1f4f7c9e2e4ec0053113588476ce7 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 26 Dec 2013 09:20:59 -0500 Subject: [PATCH] Give higher threshold for webathena kerberos queries. These are mostly out of our control, so they are not very actionable. (imported from commit ef342ec1edbff0fa1a934413a7f19ed14817a502) --- zerver/middleware.py | 2 ++ zerver/tests.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/zerver/middleware.py b/zerver/middleware.py index 635ff1d744..372c646923 100644 --- a/zerver/middleware.py +++ b/zerver/middleware.py @@ -75,6 +75,8 @@ def is_slow_query(time_delta, path): or path.startswith("/user_activity/") if is_exempt: return False + if 'webathena_kerberos' in path: + return time_delta >= 10 return True def write_log_line(log_data, path, method, remote_ip, email, client_name, diff --git a/zerver/tests.py b/zerver/tests.py index c118d59976..b96f182111 100644 --- a/zerver/tests.py +++ b/zerver/tests.py @@ -211,6 +211,8 @@ class SlowQueryTest(TestCase): self.assertFalse(is_slow_query(2, '/api/v1/deployments/report_error')) self.assertFalse(is_slow_query(2, '/realm_activity/whatever')) self.assertFalse(is_slow_query(2, '/user_activity/whatever')) + self.assertFalse(is_slow_query(9, '/accounts/webathena_kerberos_login/')) + self.assertTrue(is_slow_query(11, '/accounts/webathena_kerberos_login/')) class DecoratorTestCase(TestCase): def test_REQ_converter(self):