MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / updateThreadEventData

Method updateThreadEventData

src/Common/ProgressIndication.cpp:61–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void 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
76double ProgressIndication::getCPUUsage()
77{

Callers 1

onProfileEventsMethod · 0.80

Calls 2

timeMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected