From 95b9a77126f85eb8f6bfe8c009d7ff7858a6d63f Mon Sep 17 00:00:00 2001 From: JCW Date: Wed, 21 May 2025 16:54:39 +0100 Subject: [PATCH] Update profiler --- include/xrpl/beast/core/FunctionProfiler.h | 2 +- include/xrpl/beast/hash/xxhasher.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/xrpl/beast/core/FunctionProfiler.h b/include/xrpl/beast/core/FunctionProfiler.h index 179f31ec0b..d6c1b09740 100644 --- a/include/xrpl/beast/core/FunctionProfiler.h +++ b/include/xrpl/beast/core/FunctionProfiler.h @@ -19,7 +19,7 @@ class FunctionProfiler public: inline static std::unordered_map funcionDurations; - FunctionProfiler(std::source_location location = std::source_location::current()): functionName(location.function_name()), start(std::chrono::steady_clock::now()) + FunctionProfiler(const std::string& tag, std::source_location location = std::source_location::current()): functionName(location.function_name() + tag), start(std::chrono::steady_clock::now()) { } diff --git a/include/xrpl/beast/hash/xxhasher.h b/include/xrpl/beast/hash/xxhasher.h index 695bcf6d03..4507b3efda 100644 --- a/include/xrpl/beast/hash/xxhasher.h +++ b/include/xrpl/beast/hash/xxhasher.h @@ -89,14 +89,14 @@ public: void operator()(void const* key, std::size_t len) noexcept { - FunctionProfiler _; + FunctionProfiler _{"-size-" + std::to_string(len)}; XXH3_64bits_update(state_, key, len); } explicit operator std::size_t() noexcept { - FunctionProfiler _; + FunctionProfiler _{"-digest"}; return XXH3_64bits_digest(state_); } };