From b95d741ffe77496df9e202c507c7cac10e9b0e77 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 6 Mar 2025 12:12:40 +0530 Subject: [PATCH] fix(DX): Limit cprofiler output to 200 lines (#31538) Most of the time, first 100 lines are all you need, so 200 should be more than enough. --- frappe/recorder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/recorder.py b/frappe/recorder.py index facdcc416d..a5706c8466 100644 --- a/frappe/recorder.py +++ b/frappe/recorder.py @@ -259,7 +259,7 @@ class Recorder: def dump(self): if not self._recording: return - profiler_output = self.process_profiler() + profiler_output = self.process_profiler() or "" request_data = { "uuid": self.uuid, @@ -277,7 +277,7 @@ class Recorder: request_data["calls"] = self.calls request_data["headers"] = self.headers request_data["form_dict"] = self.form_dict - request_data["profile"] = profiler_output + request_data["profile"] = "".join(profiler_output.splitlines(keepends=True)[:200]) frappe.cache.hset(RECORDER_REQUEST_HASH, self.uuid, request_data) if self.config.record_sql: