(self)
| 87 | |
| 88 | impl RunOpt { |
| 89 | pub async fn run(self) -> Result<()> { |
| 90 | let files_on_disk = |
| 91 | find_or_generate_files(&self.path, self.num_files, self.num_rows_per_file) |
| 92 | .await?; |
| 93 | |
| 94 | // Using an in-memory object store is important for this benchmark to ensure `datafusion` |
| 95 | // is yielding often enough regardless of whether the file reading happens to be yielding. |
| 96 | let store = |
| 97 | Arc::new(object_store::memory::InMemory::new()) as Arc<dyn ObjectStore>; |
| 98 | println!("Starting to load data into in-memory object store"); |
| 99 | load_data(Arc::clone(&store), &files_on_disk).await?; |
| 100 | println!("Done loading data into in-memory object store"); |
| 101 | |
| 102 | let mut rundata = BenchmarkRun::new(); |
| 103 | rundata.start_new_case("Cancellation"); |
| 104 | |
| 105 | for i in 0..self.common.iterations { |
| 106 | let elapsed = run_test(self.wait_time, Arc::clone(&store))?; |
| 107 | let ms = elapsed.as_secs_f64() * 1000.0; |
| 108 | println!("Iteration {i} cancelled in {ms} ms"); |
| 109 | rundata.write_iter(elapsed, 0); |
| 110 | } |
| 111 | |
| 112 | rundata.maybe_write_json(self.output_path.as_ref())?; |
| 113 | |
| 114 | Ok(()) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | fn run_test(wait_time: u64, store: Arc<dyn ObjectStore>) -> Result<Duration> { |
nothing calls this directly
no test coverage detected