Skip to content

Commit a01970d

Browse files
committed
add debug_ds extension to the benchmark runner
1 parent e9f097c commit a01970d

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

benchmark/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ else()
2525
add_definitions(-DDUCKDB_ROOT_DIRECTORY="${PROJECT_SOURCE_DIR}")
2626
endif()
2727

28-
add_executable(benchmark_runner benchmark_runner.cpp interpreted_benchmark.cpp
29-
${BENCHMARK_OBJECT_FILES})
28+
add_executable(
29+
benchmark_runner
30+
benchmark_runner.cpp interpreted_benchmark.cpp
31+
$<TARGET_OBJECTS:test_debug_fs_extension> ${BENCHMARK_OBJECT_FILES})
32+
33+
target_include_directories(
34+
benchmark_runner
35+
PRIVATE ${PROJECT_SOURCE_DIR}/test/extension/debug_fs/include)
3036

3137
target_link_libraries(benchmark_runner duckdb_static imdb test_helpers)
3238
link_extension_libraries(benchmark_runner "")

benchmark/interpreted_benchmark.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "duckdb/execution/operator/helper/physical_result_collector.hpp"
1313
#include "duckdb/common/arrow/physical_arrow_collector.hpp"
1414
#include "duckdb/parser/keyword_helper.hpp"
15+
#include "debug_fs_extension.hpp"
1516

1617
#include <fstream>
1718
#include <sstream>
@@ -47,6 +48,9 @@ struct InterpretedBenchmarkState : public BenchmarkState {
4748
explicit InterpretedBenchmarkState(string path, const string &version)
4849
: benchmark_config(GetBenchmarkConfig(version)),
4950
db(path.empty() ? nullptr : path.c_str(), benchmark_config.get()), con(db) {
51+
//! Statically load the debug_fs extension so benchmarks can inject artificial I/O latency
52+
//! (e.g. SET GLOBAL debug_fs_delay_mean_ms=...), mirroring how the unittest runner loads it.
53+
db.LoadStaticExtension<DebugFsExtension>();
5054
auto &instance = BenchmarkRunner::GetInstance();
5155
auto res = con.Query("PRAGMA threads=" + to_string(instance.threads));
5256
D_ASSERT(!res->HasError());

0 commit comments

Comments
 (0)