(
iterations: usize,
case: &RttCase,
mut execute: impl FnMut(&str) -> Result<()>,
)
| 4282 | } |
| 4283 | |
| 4284 | fn run_rtt_case( |
| 4285 | iterations: usize, |
| 4286 | case: &RttCase, |
| 4287 | mut execute: impl FnMut(&str) -> Result<()>, |
| 4288 | ) -> Result<BenchmarkTestResult> { |
| 4289 | let mut samples = Vec::with_capacity(iterations); |
| 4290 | for _ in 0..iterations { |
| 4291 | let started = Instant::now(); |
| 4292 | execute(&case.sql).with_context(|| format!("execute RTT benchmark {}", case.id))?; |
| 4293 | samples.push(started.elapsed().as_micros()); |
| 4294 | } |
| 4295 | Ok(samples_result( |
| 4296 | case.id, |
| 4297 | format!("Test {}: {}", case.id, case.label), |
| 4298 | "milliseconds", |
| 4299 | iterations, |
| 4300 | samples, |
| 4301 | )) |
| 4302 | } |
| 4303 | |
| 4304 | fn samples_result( |
| 4305 | id: &'static str, |
no test coverage detected