From dc1b86fa75b5c508dc485cb598e25dfae4cba7f5 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 5 Aug 2022 13:36:28 +0300 Subject: [PATCH] Show fraction of calls compared to parent in profiler dump --- libs/prof/source/profiler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/prof/source/profiler.cpp b/libs/prof/source/profiler.cpp index 8a20b058..86d2201b 100644 --- a/libs/prof/source/profiler.cpp +++ b/libs/prof/source/profiler.cpp @@ -96,6 +96,13 @@ namespace psemek::prof log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first << " " << pretty(stat.mean()) << " (" << stat.count() << " call)"; + else if (node.execution_time.count() > 0) + log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first + << " avg " << pretty(stat.mean()) + << " 25% " << pretty(stat.percentile(0.25)) + << " 50% " << pretty(stat.percentile(0.50)) + << " 75% " << pretty(stat.percentile(0.75)) + << " (" << stat.count() << " calls, " << std::setprecision(3) << (stat.count() * 1.f / node.execution_time.count() * 1.f) << "x)"; else log::info() << std::string(depth * 2, ' ') << std::setw(max_name_length + 3) << std::left << std::setfill(' ') << c.first << " avg " << pretty(stat.mean())