MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / getRssUsageRatio

Method getRssUsageRatio

src/processSampler.cpp:15–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13std::unordered_map<int, ProcessHistory> ProcessSampler::_process_history;
14
15double 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
22bool ProcessSampler::shouldIncludeProcess(const ProcessInfo& info) {
23 return info.cpu_percent >= MIN_CPU_THRESHOLD || getRssUsageRatio(info) >= MIN_RSS_THRESHOLD;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected