Update src/Common/AsynchronousMetrics.cpp

This commit is contained in:
Sergei Trifonov 2023-06-02 11:19:11 +02:00 committed by GitHub
parent 16be379fa5
commit 57a2bfd0ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -956,8 +956,11 @@ void AsynchronousMetrics::update(TimePoint update_time)
quota = std::stoull(field1);
}
auto field2 = line.substr(space + 1);
period = std::stoull(field2);
if (space != std::string::npos)
{
auto field2 = line.substr(space + 1);
period = std::stoull(field2);
}
new_values["CGroupCpuCfsPeriod"] = { period, "The CFS period of CPU cgroup."};
new_values["CGroupCpuCfsQuota"] = { quota, "The CFS quota of CPU cgroup. If stated zero, the quota is max."};