| 21 | }; |
| 22 | |
| 23 | void printCpuStats(std::vector<string> pids) |
| 24 | { |
| 25 | for (string pid : pids) |
| 26 | { |
| 27 | string path = "/proc/" + pid + "/task"; |
| 28 | |
| 29 | if (!fs::exists(path)) |
| 30 | { |
| 31 | throw PidClosedError("Directory does not exist: " + path); |
| 32 | } |
| 33 | |
| 34 | for (const auto &entry : fs::directory_iterator(path)) |
| 35 | { |
| 36 | string subProcessPath = entry.path().string() + "/stat"; |
| 37 | readFile(subProcessPath); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | void printMemoryStats(std::vector<string> pids) |
| 43 | { |
no test coverage detected