mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Update profiler
This commit is contained in:
@@ -19,7 +19,7 @@ class FunctionProfiler
|
||||
public:
|
||||
|
||||
inline static std::unordered_map<std::string, std::chrono::nanoseconds> 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())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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_);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user