(
name: &'static str,
description: &'static str,
cache_state_before: impl Into<String>,
process_state_before: &'static str,
root_state: &'static str,
query_state: &'static str,
| 4687 | |
| 4688 | #[allow(clippy::too_many_arguments)] |
| 4689 | fn capture_operation( |
| 4690 | name: &'static str, |
| 4691 | description: &'static str, |
| 4692 | cache_state_before: impl Into<String>, |
| 4693 | process_state_before: &'static str, |
| 4694 | root_state: &'static str, |
| 4695 | query_state: &'static str, |
| 4696 | workload: &'static str, |
| 4697 | primary_latency_phase: &'static str, |
| 4698 | operation: impl FnOnce() -> Result<()>, |
| 4699 | ) -> Result<PerfOperation> { |
| 4700 | let started = Instant::now(); |
| 4701 | let (result, phases) = capture_phase_timings(operation); |
| 4702 | let elapsed_micros = started.elapsed().as_micros(); |
| 4703 | result?; |
| 4704 | let primary_latency_micros = phases |
| 4705 | .iter() |
| 4706 | .rev() |
| 4707 | .find(|phase| phase.name == primary_latency_phase) |
| 4708 | .map(|phase| phase.elapsed_micros) |
| 4709 | .unwrap_or(elapsed_micros); |
| 4710 | Ok(PerfOperation { |
| 4711 | name, |
| 4712 | description, |
| 4713 | cache_state_before: cache_state_before.into(), |
| 4714 | process_state_before, |
| 4715 | root_state, |
| 4716 | query_state, |
| 4717 | workload, |
| 4718 | primary_latency_phase, |
| 4719 | primary_latency_micros, |
| 4720 | elapsed_micros, |
| 4721 | correct: true, |
| 4722 | phases, |
| 4723 | }) |
| 4724 | } |
| 4725 | |
| 4726 | fn pglite_oxide_cache_dir() -> Result<PathBuf> { |
| 4727 | ProjectDirs::from("dev", "pglite-oxide", "pglite-oxide") |
no test coverage detected