(&self)
| 127 | } |
| 128 | |
| 129 | pub async fn run(&self) -> Result<()> { |
| 130 | let mut benchmark_run = BenchmarkRun::new(); |
| 131 | |
| 132 | let query_ids = match self.query { |
| 133 | Some(query_id) => vec![query_id], |
| 134 | None => self.available_queries(), |
| 135 | }; |
| 136 | |
| 137 | for query_id in query_ids { |
| 138 | benchmark_run.start_new_case(&format!("{query_id}")); |
| 139 | |
| 140 | let query_results = self.benchmark_query(query_id).await; |
| 141 | match query_results { |
| 142 | Ok(query_results) => { |
| 143 | for iter in query_results { |
| 144 | benchmark_run.write_iter(iter.elapsed, iter.row_count); |
| 145 | } |
| 146 | } |
| 147 | Err(e) => { |
| 148 | benchmark_run.mark_failed(); |
| 149 | eprintln!("Query {query_id} failed: {e}"); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | benchmark_run.maybe_write_json(self.output_path.as_ref())?; |
| 155 | benchmark_run.maybe_print_failures(); |
| 156 | Ok(()) |
| 157 | } |
| 158 | |
| 159 | async fn benchmark_query(&self, query_id: usize) -> Result<Vec<QueryResult>> { |
| 160 | let sql = self.load_query(query_id)?; |
nothing calls this directly
no test coverage detected