Skip to content

Commit 1dfb808

Browse files
committed
print stats in fuzzer
1 parent c7c69b4 commit 1dfb808

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

velox/exec/fuzzer/JoinFuzzer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,9 @@ RowVectorPtr JoinFuzzer::execute(
430430

431431
TestScopedSpillInjection scopedSpillInjection(spillPct);
432432
RowVectorPtr result;
433+
TaskStats stats;
433434
try {
434-
result = builder.maxDrivers(2).copyResults(pool_.get());
435+
std::tie(result, stats) = builder.maxDrivers(2).copyResultsWithStats(pool_.get());
435436
} catch (VeloxRuntimeError& e) {
436437
if (FLAGS_enable_oom_injection &&
437438
e.errorCode() == facebook::velox::error_code::kMemCapExceeded &&
@@ -451,6 +452,8 @@ RowVectorPtr JoinFuzzer::execute(
451452
// avoid the potential interference of the background activities across query
452453
// executions.
453454
test::waitForAllTasksToBeDeleted();
455+
std::cout << exec::printPlanWithStats(*plan.plan, stats, true)
456+
<< std::endl;
454457
return result;
455458
}
456459

velox/exec/tests/utils/AssertQueryBuilder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ RowVectorPtr AssertQueryBuilder::copyResults(memory::MemoryPool* pool) {
226226
return copyResults(pool, unused);
227227
}
228228

229+
std::pair<RowVectorPtr, TaskStats> AssertQueryBuilder::copyResultsWithStats(memory::MemoryPool* pool) {
230+
std::shared_ptr<Task> unused;
231+
auto result = copyResults(pool, unused);
232+
auto stats = unused->taskStats();
233+
return std::make_pair(result, stats);
234+
}
235+
236+
229237
RowVectorPtr AssertQueryBuilder::copyResults(
230238
memory::MemoryPool* pool,
231239
std::shared_ptr<Task>& task) {

velox/exec/tests/utils/AssertQueryBuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ class AssertQueryBuilder {
178178
/// query returns empty result.
179179
RowVectorPtr copyResults(memory::MemoryPool* pool);
180180

181+
std::pair<RowVectorPtr, TaskStats> copyResultsWithStats(memory::MemoryPool* pool);
182+
181183
/// Similar to above method and also returns the task.
182184
RowVectorPtr copyResults(
183185
memory::MemoryPool* pool,

0 commit comments

Comments
 (0)