| 13 | std::unordered_map<int, ProcessHistory> ProcessSampler::_process_history; |
| 14 | |
| 15 | double ProcessSampler::getRssUsageRatio(const ProcessInfo& info) { |
| 16 | const u64 ram_size = OS::getRamSize(); |
| 17 | if (ram_size == 0 || info.vm_rss == 0) return 0.0; |
| 18 | |
| 19 | return (double)info.vm_rss / ram_size; |
| 20 | } |
| 21 | |
| 22 | bool ProcessSampler::shouldIncludeProcess(const ProcessInfo& info) { |
| 23 | return info.cpu_percent >= MIN_CPU_THRESHOLD || getRssUsageRatio(info) >= MIN_RSS_THRESHOLD; |
nothing calls this directly
no outgoing calls
no test coverage detected