| 50 | } |
| 51 | |
| 52 | void ProcessSampler::cleanupProcessHistory(const int pid_count) { |
| 53 | const std::unordered_set<int> active_pid_set(_pids, _pids + pid_count); |
| 54 | for (auto it = _process_history.begin(); it != _process_history.end();) { |
| 55 | if (active_pid_set.count(it->first) == 0) { |
| 56 | it = _process_history.erase(it); |
| 57 | } else { |
| 58 | ++it; |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | void ProcessSampler::enable(const long sampling_interval) { |
| 64 | if (_sampling_interval != sampling_interval) { |