From 91a21db89b6d7bc36b5525f9d3a07d1ebe2a4ad3 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 18 Feb 2025 13:47:34 +0100 Subject: [PATCH] Update. --- src/snek/system/profiler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/snek/system/profiler.py b/src/snek/system/profiler.py index 824208a..c5831e9 100644 --- a/src/snek/system/profiler.py +++ b/src/snek/system/profiler.py @@ -22,7 +22,8 @@ async def profile_middleware(request, handler): async def profiler_handler(request): output = io.StringIO() stats = pstats.Stats(profiler, stream=output) - stats.sort_stats('cumulative') + sort_by = request.query.get("sort", "tot. percall") + stats.sort_stats(sory_by) stats.print_stats() return web.Response(text=output.getvalue())