mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 15:05:53 +00:00
Add cpu counter
This commit is contained in:
@@ -64,11 +64,6 @@ public:
|
|||||||
{
|
{
|
||||||
auto duration = std::chrono::steady_clock::now() - start;
|
auto duration = std::chrono::steady_clock::now() - start;
|
||||||
std::lock_guard<std::mutex> lock{mutex_};
|
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].time.emplace_back(duration);
|
||||||
funcionDurations[functionName].cpuCycles.emplace_back((__rdtsc() - cpuCycleStart));
|
funcionDurations[functionName].cpuCycles.emplace_back((__rdtsc() - cpuCycleStart));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,13 +158,10 @@ public:
|
|||||||
std::lock_guard<std::mutex> lock{FunctionProfiler::mutex_};
|
std::lock_guard<std::mutex> lock{FunctionProfiler::mutex_};
|
||||||
FunctionProfiler::funcionDurations
|
FunctionProfiler::funcionDurations
|
||||||
["xxhasher-" + std::to_string(totalSize_)]
|
["xxhasher-" + std::to_string(totalSize_)]
|
||||||
.timeInTotal += duration_;
|
.time.emplace_back(duration_);
|
||||||
FunctionProfiler::funcionDurations
|
FunctionProfiler::funcionDurations
|
||||||
["xxhasher-" + std::to_string(totalSize_)]
|
["xxhasher-" + std::to_string(totalSize_)]
|
||||||
.cpuCyclesInTotal += cpuCycles;
|
.cpuCycles.emplace_back(cpuCycles);
|
||||||
FunctionProfiler::funcionDurations
|
|
||||||
["xxhasher-" + std::to_string(totalSize_)]
|
|
||||||
.count++;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user