From 0590c13de3e5b2a2f979fc7302d279c3a5cce44d Mon Sep 17 00:00:00 2001 From: JCW Date: Wed, 21 May 2025 17:38:13 +0100 Subject: [PATCH] Modify profiler --- include/xrpl/beast/core/FunctionProfiler.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/xrpl/beast/core/FunctionProfiler.h b/include/xrpl/beast/core/FunctionProfiler.h index d6c1b09740..ebca1520bb 100644 --- a/include/xrpl/beast/core/FunctionProfiler.h +++ b/include/xrpl/beast/core/FunctionProfiler.h @@ -18,7 +18,7 @@ class FunctionProfiler std::chrono::steady_clock::time_point start; public: - inline static std::unordered_map funcionDurations; + inline static std::unordered_map> funcionDurations; FunctionProfiler(const std::string& tag, std::source_location location = std::source_location::current()): functionName(location.function_name() + tag), start(std::chrono::steady_clock::now()) { } @@ -26,7 +26,8 @@ public: ~FunctionProfiler() noexcept { auto duration = std::chrono::steady_clock::now() - start; - funcionDurations[functionName] += std::chrono::duration_cast(duration); + funcionDurations[functionName].first += std::chrono::duration_cast(duration); + funcionDurations[functionName].second++; } };