(
ctx: &SessionContext,
full_path: impl AsRef<Path>,
benchmark_directory: impl AsRef<Path>,
)
| 71 | |
| 72 | impl SqlBenchmark { |
| 73 | pub async fn new( |
| 74 | ctx: &SessionContext, |
| 75 | full_path: impl AsRef<Path>, |
| 76 | benchmark_directory: impl AsRef<Path>, |
| 77 | ) -> Result<Self> { |
| 78 | let full_path = full_path.as_ref(); |
| 79 | let benchmark_directory = benchmark_directory.as_ref(); |
| 80 | let group_name = parse_group_from_path(full_path, benchmark_directory); |
| 81 | let mut bm = Self { |
| 82 | name: String::new(), |
| 83 | group: group_name, |
| 84 | subgroup: String::new(), |
| 85 | benchmark_path: full_path.to_path_buf(), |
| 86 | replacement_mapping: HashMap::new(), |
| 87 | expect: vec![], |
| 88 | queries: HashMap::new(), |
| 89 | result_queries: vec![], |
| 90 | assert_queries: vec![], |
| 91 | is_loaded: false, |
| 92 | last_results: None, |
| 93 | echo: vec![], |
| 94 | }; |
| 95 | insert_replacement( |
| 96 | &mut bm.replacement_mapping, |
| 97 | "BENCHMARK_DIR", |
| 98 | benchmark_directory.to_string_lossy().into_owned(), |
| 99 | ); |
| 100 | |
| 101 | let path = bm.benchmark_path.clone(); |
| 102 | bm.process_file(ctx, &path).await?; |
| 103 | |
| 104 | Ok(bm) |
| 105 | } |
| 106 | |
| 107 | /// Initializes the benchmark by executing `load` and `init` queries. |
| 108 | /// |
nothing calls this directly
no test coverage detected