cpu_usage/linux: count iowait toward idle time

This commit is contained in:
Kauan Decarli 2023-11-18 13:59:21 -03:00
parent 0a747ddafc
commit d2dd2d553f
1 changed files with 3 additions and 2 deletions

View File

@ -21,8 +21,9 @@ std::vector<std::tuple<size_t, size_t>> waybar::modules::CpuUsage::parseCpuinfo(
size_t idle_time = 0;
size_t total_time = 0;
if (times.size() >= 4) {
idle_time = times[3];
if (times.size() >= 5) {
// idle + iowait
idle_time = times[3] + times[4];
total_time = std::accumulate(times.begin(), times.end(), 0);
}
cpuinfo.emplace_back(idle_time, total_time);