MCPcopy Create free account
hub / github.com/apache/brpc / cumulated_cputime_ns

Method cumulated_cputime_ns

src/bthread/task_group.cpp:188–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188int64_t TaskGroup::cumulated_cputime_ns() const {
189 CPUTimeStat cpu_time_stat = _cpu_time_stat.load();
190 // Add the elapsed time of running bthread.
191 int64_t cumulated_cputime_ns = cpu_time_stat.cumulated_cputime_ns();
192 if (!cpu_time_stat.is_main_task()) {
193 cumulated_cputime_ns += butil::cpuwide_time_ns() - cpu_time_stat.last_run_ns();
194 }
195 return cumulated_cputime_ns;
196}
197
198void TaskGroup::run_main_task() {
199 bvar::PassiveStatus<double> cumulated_cputime(

Callers 2

print_rq_sizesMethod · 0.45

Calls 4

cpuwide_time_nsFunction · 0.85
last_run_nsMethod · 0.80
loadMethod · 0.45
is_main_taskMethod · 0.45

Tested by

no test coverage detected