andygrove commented on code in PR #1641:
URL: 
https://github.com/apache/datafusion-ballista/pull/1641#discussion_r3174838750


##########
benchmarks/src/bin/tpch.rs:
##########
@@ -354,34 +355,37 @@ async fn benchmark_datafusion(opt: 
DataFusionBenchmarkOpt) -> Result<Vec<RecordB
                 let df = ctx.sql(sql).await?;
                 result = df.collect().await?;
             }
-            let elapsed = start.elapsed().as_secs_f64() * 1000.0;
+            let elapsed = start.elapsed().as_secs_f64();
             if opt.debug {
                 pretty::print_batches(&result)?;
             }
-            millis.push(elapsed);
+            secs.push(elapsed);
             let row_count = result.iter().map(|b| b.num_rows()).sum();
             if opt.iterations == 1 {
                 println!(
-                    "Query {} took {:.1} ms and returned {} rows",
+                    "Query {} took {:.3} s and returned {} rows",
                     query, elapsed, row_count
                 );
             } else {
                 println!(
-                    "Query {} iteration {} took {:.1} ms and returned {} rows",
+                    "Query {} iteration {} took {:.3} s and returned {} rows",
                     query, i, elapsed, row_count
                 );
             }
             query_run.add_result(elapsed, row_count);
         }
 
         if opt.iterations > 1 {
-            let avg = millis.iter().sum::<f64>() / millis.len() as f64;
-            println!("Query {} avg time: {:.1} ms", query, avg);
+            let avg = secs.iter().sum::<f64>() / secs.len() as f64;
+            println!("Query {} avg time: {:.3} s", query, avg);
         }
 
         benchmark_run.add_query_run(query_run);
     }
 
+    let total_elapsed = total_start.elapsed().as_secs_f64();

Review Comment:
   Good question. Switched to summing per-query times: sum of elapsed when 
iterations is 1, sum of per-query averages when iterations > 1.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to