@@ -167,7 +167,7 @@ void TTableStats::Resize(ui32 taskCount) {
167
167
168
168
void TStageExecutionStats::Resize (ui32 taskCount) {
169
169
CpuTimeUs.Resize (taskCount);
170
- SourceCpuTimeUs.Resize (taskCount);
170
+ SourceCpuTimeUs.resize (taskCount);
171
171
172
172
InputRows.resize (taskCount);
173
173
InputBytes.resize (taskCount);
@@ -187,6 +187,11 @@ void TStageExecutionStats::Resize(ui32 taskCount) {
187
187
WaitInputTimeUs.resize (taskCount);
188
188
WaitOutputTimeUs.resize (taskCount);
189
189
190
+ SpillingComputeBytes.Resize (taskCount);
191
+ SpillingChannelBytes.Resize (taskCount);
192
+ SpillingComputeTimeUs.Resize (taskCount);
193
+ SpillingChannelTimeUs.Resize (taskCount);
194
+
190
195
for (auto & p : Ingress) p.second .Resize (taskCount);
191
196
for (auto & p : Input) p.second .Resize (taskCount);
192
197
for (auto & p : Output) p.second .Resize (taskCount);
@@ -198,17 +203,17 @@ void TStageExecutionStats::Resize(ui32 taskCount) {
198
203
void TStageExecutionStats::SetHistorySampleCount (ui32 historySampleCount) {
199
204
HistorySampleCount = historySampleCount;
200
205
CpuTimeUs.HistorySampleCount = historySampleCount;
201
- SourceCpuTimeUs.HistorySampleCount = historySampleCount;
202
206
MaxMemoryUsage.HistorySampleCount = historySampleCount;
207
+ SpillingComputeBytes.HistorySampleCount = historySampleCount;
208
+ SpillingChannelBytes.HistorySampleCount = historySampleCount;
209
+ SpillingComputeTimeUs.HistorySampleCount = historySampleCount;
210
+ SpillingChannelTimeUs.HistorySampleCount = historySampleCount;
203
211
}
204
212
205
213
void TStageExecutionStats::ExportHistory (ui64 baseTimeMs, NYql::NDqProto::TDqStageStats& stageStats) {
206
214
if (stageStats.HasCpuTimeUs ()) {
207
215
CpuTimeUs.ExportHistory (baseTimeMs, *stageStats.MutableCpuTimeUs ());
208
216
}
209
- if (stageStats.HasSourceCpuTimeUs ()) {
210
- SourceCpuTimeUs.ExportHistory (baseTimeMs, *stageStats.MutableSourceCpuTimeUs ());
211
- }
212
217
for (auto & p : *stageStats.MutableIngress ()) {
213
218
auto it = Ingress.find (p.first );
214
219
if (it != Ingress.end ()) {
@@ -236,6 +241,18 @@ void TStageExecutionStats::ExportHistory(ui64 baseTimeMs, NYql::NDqProto::TDqSta
236
241
if (stageStats.HasMaxMemoryUsage ()) {
237
242
MaxMemoryUsage.ExportHistory (baseTimeMs, *stageStats.MutableMaxMemoryUsage ());
238
243
}
244
+ if (stageStats.HasSpillingComputeBytes ()) {
245
+ SpillingComputeBytes.ExportHistory (baseTimeMs, *stageStats.MutableSpillingComputeBytes ());
246
+ }
247
+ if (stageStats.HasSpillingChannelBytes ()) {
248
+ SpillingChannelBytes.ExportHistory (baseTimeMs, *stageStats.MutableSpillingChannelBytes ());
249
+ }
250
+ if (stageStats.HasSpillingComputeTimeUs ()) {
251
+ SpillingComputeTimeUs.ExportHistory (baseTimeMs, *stageStats.MutableSpillingComputeTimeUs ());
252
+ }
253
+ if (stageStats.HasSpillingChannelTimeUs ()) {
254
+ SpillingChannelTimeUs.ExportHistory (baseTimeMs, *stageStats.MutableSpillingChannelTimeUs ());
255
+ }
239
256
}
240
257
241
258
void SetNonZero (ui64& target, ui64 source) {
@@ -295,7 +312,7 @@ ui64 TStageExecutionStats::UpdateStats(const NYql::NDqProto::TDqTaskStats& taskS
295
312
}
296
313
297
314
CpuTimeUs.SetNonZero (index, taskStats.GetCpuTimeUs ());
298
- SourceCpuTimeUs. SetNonZero (index, taskStats.GetSourceCpuTimeUs ());
315
+ SetNonZero (SourceCpuTimeUs[ index] , taskStats.GetSourceCpuTimeUs ());
299
316
300
317
SetNonZero (InputRows[index], taskStats.GetInputRows ());
301
318
SetNonZero (InputBytes[index], taskStats.GetInputBytes ());
@@ -321,6 +338,11 @@ ui64 TStageExecutionStats::UpdateStats(const NYql::NDqProto::TDqTaskStats& taskS
321
338
SetNonZero (WaitInputTimeUs[index], taskStats.GetWaitInputTimeUs ());
322
339
SetNonZero (WaitOutputTimeUs[index], taskStats.GetWaitOutputTimeUs ());
323
340
341
+ SpillingComputeBytes.SetNonZero (index, taskStats.GetSpillingComputeWriteBytes ());
342
+ SpillingChannelBytes.SetNonZero (index, taskStats.GetSpillingChannelWriteBytes ());
343
+ SpillingComputeTimeUs.SetNonZero (index, taskStats.GetSpillingComputeReadTimeUs () + taskStats.GetSpillingComputeWriteTimeUs ());
344
+ SpillingChannelTimeUs.SetNonZero (index, taskStats.GetSpillingChannelReadTimeUs () + taskStats.GetSpillingChannelWriteTimeUs ());
345
+
324
346
for (auto & tableStat : taskStats.GetTables ()) {
325
347
auto tablePath = tableStat.GetTablePath ();
326
348
auto [it, inserted] = Tables.try_emplace (tablePath, taskCount);
@@ -594,6 +616,12 @@ void TQueryExecutionStats::AddComputeActorFullStatsByTask(
594
616
UpdateAggr (stageStats->MutableDurationUs (), stats.GetDurationUs ());
595
617
UpdateAggr (stageStats->MutableWaitInputTimeUs (), task.GetWaitInputTimeUs ());
596
618
UpdateAggr (stageStats->MutableWaitOutputTimeUs (), task.GetWaitOutputTimeUs ());
619
+
620
+ UpdateAggr (stageStats->MutableSpillingComputeBytes (), task.GetSpillingComputeWriteBytes ());
621
+ UpdateAggr (stageStats->MutableSpillingChannelBytes (), task.GetSpillingChannelWriteBytes ());
622
+ UpdateAggr (stageStats->MutableSpillingComputeTimeUs (), task.GetSpillingComputeReadTimeUs () + task.GetSpillingComputeWriteTimeUs ());
623
+ UpdateAggr (stageStats->MutableSpillingChannelTimeUs (), task.GetSpillingChannelReadTimeUs () + task.GetSpillingChannelWriteTimeUs ());
624
+
597
625
FillStageDurationUs (*stageStats);
598
626
599
627
for (auto & sourcesStat : task.GetSources ()) {
@@ -964,7 +992,7 @@ void TQueryExecutionStats::ExportExecStats(NYql::NDqProto::TDqExecutionStats& st
964
992
965
993
stageStats.SetBaseTimeMs (BaseTimeMs);
966
994
p.second .CpuTimeUs .ExportAggStats (BaseTimeMs, *stageStats.MutableCpuTimeUs ());
967
- p.second .SourceCpuTimeUs . ExportAggStats (BaseTimeMs , *stageStats.MutableSourceCpuTimeUs ());
995
+ ExportAggStats ( p.second .SourceCpuTimeUs , *stageStats.MutableSourceCpuTimeUs ());
968
996
p.second .MaxMemoryUsage .ExportAggStats (BaseTimeMs, *stageStats.MutableMaxMemoryUsage ());
969
997
970
998
ExportAggStats (p.second .InputRows , *stageStats.MutableInputRows ());
@@ -984,6 +1012,12 @@ void TQueryExecutionStats::ExportExecStats(NYql::NDqProto::TDqExecutionStats& st
984
1012
ExportAggStats (p.second .DurationUs , *stageStats.MutableDurationUs ());
985
1013
ExportAggStats (p.second .WaitInputTimeUs , *stageStats.MutableWaitInputTimeUs ());
986
1014
ExportAggStats (p.second .WaitOutputTimeUs , *stageStats.MutableWaitOutputTimeUs ());
1015
+
1016
+ p.second .SpillingComputeBytes .ExportAggStats (BaseTimeMs, *stageStats.MutableSpillingComputeBytes ());
1017
+ p.second .SpillingChannelBytes .ExportAggStats (BaseTimeMs, *stageStats.MutableSpillingChannelBytes ());
1018
+ p.second .SpillingComputeTimeUs .ExportAggStats (BaseTimeMs, *stageStats.MutableSpillingComputeTimeUs ());
1019
+ p.second .SpillingChannelTimeUs .ExportAggStats (BaseTimeMs, *stageStats.MutableSpillingChannelTimeUs ());
1020
+
987
1021
FillStageDurationUs (stageStats);
988
1022
989
1023
for (auto & p2 : p.second .Tables ) {
0 commit comments