mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
profile_request: Support only synchronous responses for now.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 32a8151ce8
)
This commit is contained in:
committed by
Alex Vandiver
parent
a715e6aa33
commit
3f265b257a
@@ -27,6 +27,7 @@ def profile_request(request: HttpRequest) -> HttpResponseBase:
|
||||
prof = cProfile.Profile()
|
||||
with tempfile.NamedTemporaryFile(prefix="profile.data.", delete=False) as stats_file:
|
||||
response = LogRequests(get_response)(request)
|
||||
assert isinstance(response, HttpResponseBase) # async responses not supported here for now
|
||||
prof.dump_stats(stats_file.name)
|
||||
logging.info("Profiling data written to %s", stats_file.name)
|
||||
return response
|
||||
|
Reference in New Issue
Block a user