Skip to content

Commit e62bf24

Browse files
authored
Fix incorrect merge to stable (#20342)
2 parents e2605dd + 043101c commit e62bf24

File tree

1 file changed

+2
-35
lines changed

1 file changed

+2
-35
lines changed

ydb/core/kqp/executer_actor/kqp_executer_stats.cpp

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,42 +1525,8 @@ void TQueryExecutionStats::ExportExecStats(NYql::NDqProto::TDqExecutionStats& st
15251525
}
15261526

15271527
std::unordered_map<TString, NYql::NDqProto::TDqTableStats*> currentTableStats;
1528-
for (auto& [stageId, stageStat] : StageStats) {
1529-
auto& stageStats = *protoStages[stageStat.StageId.StageId];
1530-
stageStats.SetTotalTasksCount(stageStat.Task2Index.size());
1531-
stageStats.SetFinishedTasksCount(stageStat.FinishedCount);
1532-
1533-
stageStats.SetBaseTimeMs(BaseTimeMs);
1534-
stageStat.CpuTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableCpuTimeUs());
1535-
ExportAggStats(stageStat.SourceCpuTimeUs, *stageStats.MutableSourceCpuTimeUs());
1536-
stageStat.MaxMemoryUsage.ExportAggStats(BaseTimeMs, *stageStats.MutableMaxMemoryUsage());
1537-
1538-
ExportAggStats(stageStat.InputRows, *stageStats.MutableInputRows());
1539-
ExportAggStats(stageStat.InputBytes, *stageStats.MutableInputBytes());
1540-
ExportAggStats(stageStat.OutputRows, *stageStats.MutableOutputRows());
1541-
ExportAggStats(stageStat.OutputBytes, *stageStats.MutableOutputBytes());
1542-
ExportAggStats(stageStat.ResultRows, *stageStats.MutableResultRows());
1543-
ExportAggStats(stageStat.ResultBytes, *stageStats.MutableResultBytes());
1544-
ExportAggStats(stageStat.IngressRows, *stageStats.MutableIngressRows());
1545-
ExportAggStats(stageStat.IngressBytes, *stageStats.MutableIngressBytes());
1546-
ExportAggStats(stageStat.IngressDecompressedBytes, *stageStats.MutableIngressDecompressedBytes());
1547-
ExportAggStats(stageStat.EgressRows, *stageStats.MutableEgressRows());
1548-
ExportAggStats(stageStat.EgressBytes, *stageStats.MutableEgressBytes());
1549-
1550-
ExportOffsetAggStats(stageStat.StartTimeMs, *stageStats.MutableStartTimeMs(), BaseTimeMs);
1551-
ExportOffsetAggStats(stageStat.FinishTimeMs, *stageStats.MutableFinishTimeMs(), BaseTimeMs);
1552-
ExportAggStats(stageStat.DurationUs, *stageStats.MutableDurationUs());
1553-
stageStat.WaitInputTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableWaitInputTimeUs());
1554-
stageStat.WaitOutputTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableWaitOutputTimeUs());
1555-
stageStats.SetUpdateTimeMs(stageStat.UpdateTimeMs > BaseTimeMs ? stageStat.UpdateTimeMs - BaseTimeMs : 0);
1556-
1557-
stageStat.SpillingComputeBytes.ExportAggStats(BaseTimeMs, *stageStats.MutableSpillingComputeBytes());
1558-
stageStat.SpillingChannelBytes.ExportAggStats(BaseTimeMs, *stageStats.MutableSpillingChannelBytes());
1559-
stageStat.SpillingComputeTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableSpillingComputeTimeUs());
1560-
stageStat.SpillingChannelTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableSpillingChannelTimeUs());
1561-
1562-
FillStageDurationUs(stageStats);
15631528

1529+
for (auto& [stageId, stageStat] : StageStats) {
15641530
for (auto& [path, t] : stageStat.Tables) {
15651531
NYql::NDqProto::TDqTableStats* tableAggr = nullptr;
15661532
if (auto it = currentTableStats.find(path); it != currentTableStats.end()) {
@@ -1584,6 +1550,7 @@ void TQueryExecutionStats::ExportExecStats(NYql::NDqProto::TDqExecutionStats& st
15841550
if (CollectFullStats(StatsMode)) {
15851551
auto& stageStats = *protoStages[stageStat.StageId.StageId];
15861552
stageStats.SetTotalTasksCount(stageStat.Task2Index.size());
1553+
stageStats.SetFinishedTasksCount(stageStat.FinishedCount);
15871554

15881555
stageStats.SetBaseTimeMs(BaseTimeMs);
15891556
stageStat.CpuTimeUs.ExportAggStats(BaseTimeMs, *stageStats.MutableCpuTimeUs());

0 commit comments

Comments
 (0)