mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 10:35:50 +00:00
Add cpu counter
This commit is contained in:
@@ -64,11 +64,6 @@ public:
|
||||
{
|
||||
auto duration = std::chrono::steady_clock::now() - start;
|
||||
std::lock_guard<std::mutex> lock{mutex_};
|
||||
if (funcionDurations[functionName].count ==
|
||||
std::numeric_limits<std::int64_t>::max())
|
||||
{
|
||||
return;
|
||||
}
|
||||
funcionDurations[functionName].time.emplace_back(duration);
|
||||
funcionDurations[functionName].cpuCycles.emplace_back((__rdtsc() - cpuCycleStart));
|
||||
}
|
||||
|
||||
@@ -158,13 +158,10 @@ public:
|
||||
std::lock_guard<std::mutex> 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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user