mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-07 20:55:53 +00:00
Add cpu counter
This commit is contained in:
@@ -65,11 +65,12 @@ getProfilingResults()
|
|||||||
std::lock_guard<std::mutex> lock{FunctionProfiler::mutex_};
|
std::lock_guard<std::mutex> lock{FunctionProfiler::mutex_};
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Function profiling results:" << std::endl;
|
ss << "Function profiling results:" << std::endl;
|
||||||
ss << "name,time,count" << std::endl;
|
ss << "name,time,cpu cycles,count" << std::endl;
|
||||||
for (auto const& [name, duration] : FunctionProfiler::funcionDurations)
|
for (auto const& [name, duration] : FunctionProfiler::funcionDurations)
|
||||||
{
|
{
|
||||||
ss << name << "," << duration.first.count() << " ns" << ","
|
ss << name << "," << duration.timeInTotal.count() << ","
|
||||||
<< duration.second << std::endl;
|
<< duration.cpuCyclesInTotal << ","
|
||||||
|
<< duration.count << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
|
|||||||
Reference in New Issue
Block a user