From e2a83c92053564531a3f21d5a1f2b0c64c34777f Mon Sep 17 00:00:00 2001 From: JCW Date: Wed, 28 May 2025 12:31:49 +0100 Subject: [PATCH] Add cpu counter --- include/xrpl/beast/core/FunctionProfiler.h | 5 ----- include/xrpl/beast/hash/xxhasher.h | 7 ++----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/xrpl/beast/core/FunctionProfiler.h b/include/xrpl/beast/core/FunctionProfiler.h index bf2d6b75ad..6d6084d12f 100644 --- a/include/xrpl/beast/core/FunctionProfiler.h +++ b/include/xrpl/beast/core/FunctionProfiler.h @@ -64,11 +64,6 @@ public: { auto duration = std::chrono::steady_clock::now() - start; std::lock_guard lock{mutex_}; - if (funcionDurations[functionName].count == - std::numeric_limits::max()) - { - return; - } funcionDurations[functionName].time.emplace_back(duration); funcionDurations[functionName].cpuCycles.emplace_back((__rdtsc() - cpuCycleStart)); } diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 948378dd8c..1345d46254 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -158,13 +158,10 @@ public: std::lock_guard lock{FunctionProfiler::mutex_}; FunctionProfiler::funcionDurations ["xxhasher-" + std::to_string(totalSize_)] - .timeInTotal += duration_; + .time.emplace_back(duration_); FunctionProfiler::funcionDurations ["xxhasher-" + std::to_string(totalSize_)] - .cpuCyclesInTotal += cpuCycles; - FunctionProfiler::funcionDurations - ["xxhasher-" + std::to_string(totalSize_)] - .count++; + .cpuCycles.emplace_back(cpuCycles); return ret; } };