Apache DataFusion SQL Query Engine
ARROW-10986: [Rust][DataFusion] Add average stats to TPC-H benchmarks
Heres, Daniel3845a35a0a3e
diff --git a/rust/benchmarks/src/bin/tpch.rs b/rust/benchmarks/src/bin/tpch.rsindex fff4e2bb61..9cbbd6b166 100644--- a/rust/benchmarks/src/bin/tpch.rs+++ b/rust/benchmarks/src/bin/tpch.rs@@ -130,19 +130,20 @@ async fn benchmark(opt: BenchmarkOpt) -> Result<()> {}}+ let mut millis = vec![];// run benchmarkfor i in 0..opt.iterations {let start = Instant::now();let plan = create_logical_plan(&mut ctx, opt.query)?;execute_query(&mut ctx, &plan, opt.debug).await?;- println!(- "Query {} iteration {} took {} ms",- opt.query,- i,- start.elapsed().as_millis()- );+ let elapsed = start.elapsed().as_secs_f64() * 1000.0;+ millis.push(elapsed as f64);+ println!("Query {} iteration {} took {:.1} ms", opt.query, i, elapsed);}+ let avg = millis.iter().sum::<f64>() / millis.len() as f64;+ println!("Query {} avg time: {:.2} ms", opt.query, avg);+Ok(())}