in health_metric_collector/src/cpu_metric_collector.cpp [28:40]
void CPUMetricCollector::Collect()
{
// new snapshot
new_ = std::make_shared<CPUStats>();
new_->ReadStatsCPU();
if (old_) {
CollectCpuUsage(old_->GetEntries(), new_->GetEntries());
}
old_ = new_;
new_.reset();
}