| 59 | } |
| 60 | |
| 61 | void ProgressIndication::updateThreadEventData(HostToTimesMap & new_hosts_data) |
| 62 | { |
| 63 | std::lock_guard lock(profile_events_mutex); |
| 64 | |
| 65 | constexpr UInt64 us_to_ns = 1000; |
| 66 | |
| 67 | UInt64 total_cpu_ns = 0; |
| 68 | for (auto & new_host : new_hosts_data) |
| 69 | { |
| 70 | total_cpu_ns += us_to_ns * new_host.second.time(); |
| 71 | hosts_data[new_host.first] = new_host.second; |
| 72 | } |
| 73 | cpu_usage_meter.add(static_cast<double>(getElapsedNanoseconds()), static_cast<double>(total_cpu_ns)); |
| 74 | } |
| 75 | |
| 76 | double ProgressIndication::getCPUUsage() |
| 77 | { |
no test coverage detected