Skip to content

Commit bce118b

Browse files
committed
Add --collect-metrics argument to benchmarks
1 parent e892096 commit bce118b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

benchmarks/cdk/bin/datafusion-bench.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ async function main () {
1515
.option('-i, --iterations <number>', 'Number of iterations', '3')
1616
.option('--files-per-task <number>', 'Files per task', '4')
1717
.option('--cardinality-task-sf <number>', 'Cardinality task scale factor', '2')
18+
.option('--collect-metrics <boolean>', 'Propagates metric collection', 'true')
1819
.option('--query <number>', 'A specific query to run', undefined)
1920
.parse(process.argv);
2021

@@ -24,6 +25,7 @@ async function main () {
2425
const iterations = parseInt(options.iterations);
2526
const filesPerTask = parseInt(options.filesPerTask);
2627
const cardinalityTaskSf = parseInt(options.cardinalityTaskSf);
28+
const collectMetrics = options.collectMetrics === 'true' || options.collectMetrics === 1
2729

2830
// Compare with previous results first
2931
const results: BenchmarkResults = { queries: [] };
@@ -33,7 +35,8 @@ async function main () {
3335
await query(createTablesSql(sf))
3436
await query(`
3537
SET distributed.files_per_task=${filesPerTask};
36-
SET distributed.cardinality_task_count_factor=${cardinalityTaskSf}
38+
SET distributed.cardinality_task_count_factor=${cardinalityTaskSf};
39+
SET distributed.collect_metrics=${collectMetrics}
3740
`)
3841

3942
for (let id of IDS) {

benchmarks/src/tpch/run.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ pub struct RunOpt {
120120
/// Task count scale factor for when nodes in stages change the cardinality of the data
121121
#[structopt(long)]
122122
cardinality_task_sf: Option<f64>,
123+
124+
/// Collects metrics across network boundaries
125+
#[structopt(long)]
126+
collect_metrics: bool,
123127
}
124128

125129
#[async_trait]
@@ -147,7 +151,8 @@ impl DistributedSessionBuilder for RunOpt {
147151
)?
148152
.with_distributed_cardinality_effect_task_scale_factor(
149153
self.cardinality_task_sf.unwrap_or(1.0),
150-
)?;
154+
)?
155+
.with_distributed_metrics_collection(self.collect_metrics)?;
151156

152157
if self.mem_table {
153158
builder = builder.with_physical_optimizer_rule(Arc::new(InMemoryDataSourceRule));

0 commit comments

Comments
 (0)