aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHor911 <hor911@ydb.tech>2024-08-16 16:13:57 +0300
committerGitHub <noreply@github.com>2024-08-16 16:13:57 +0300
commit385c253e623dda0ba080b9793e67cda45c91bedb (patch)
tree2a1f0da505efe3c2e698f3de4fb0acee3ae74d90
parentf6476d4aa2654ef051b6e13c9f467715b169f85c (diff)
downloadydb-385c253e623dda0ba080b9793e67cda45c91bedb.tar.gz
Include SourceCpuTimeUs to CpuTimeUs (#7892)
-rw-r--r--ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
index 9536882a2a..be7db0bca5 100644
--- a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
+++ b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
@@ -1613,7 +1613,7 @@ public:
ReportEventElapsedTime();
}
- dst->SetCpuTimeUs(CpuTime.MicroSeconds());
+ dst->SetCpuTimeUs(CpuTime.MicroSeconds() + SourceCpuTime.MicroSeconds());
dst->SetMaxMemoryUsage(MemoryLimits.MemoryQuotaManager->GetMaxMemorySize());
if (auto memProfileStats = GetMemoryProfileStats(); memProfileStats) {
@@ -1646,10 +1646,13 @@ public:
}
FillTaskRunnerStats(Task.GetId(), Task.GetStageId(), *taskStats, protoTask, RuntimeSettings.GetCollectStatsLevel());
- // More accurate cpu time counter:
+ auto cpuTimeUs = taskStats->ComputeCpuTime.MicroSeconds() + taskStats->BuildCpuTime.MicroSeconds();
if (TDerived::HasAsyncTaskRunner) {
- protoTask->SetCpuTimeUs(CpuTime.MicroSeconds() + taskStats->ComputeCpuTime.MicroSeconds() + taskStats->BuildCpuTime.MicroSeconds());
+ // Async TR is another actor, summarize CPU usage
+ cpuTimeUs += CpuTime.MicroSeconds();
}
+ // CpuTimeUs does include SourceCpuTime
+ protoTask->SetCpuTimeUs(cpuTimeUs + SourceCpuTime.MicroSeconds());
protoTask->SetSourceCpuTimeUs(SourceCpuTime.MicroSeconds());
ui64 ingressBytes = 0;