MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / run_rtt_case

Function run_rtt_case

xtask/src/main.rs:4284–4302  ·  view source on GitHub ↗
(
    iterations: usize,
    case: &RttCase,
    mut execute: impl FnMut(&str) -> Result<()>,
)

Source from the content-addressed store, hash-verified

4282}
4283
4284fn 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
4304fn samples_result(
4305 id: &'static str,

Callers 1

run_rtt_direct_benchmarkFunction · 0.85

Calls 3

samples_resultFunction · 0.85
pushMethod · 0.80
elapsedMethod · 0.80

Tested by

no test coverage detected