| 11 | /// Collects data while the benchmarks run in analysis mode. |
| 12 | #[async_trait(?Send)] |
| 13 | pub trait AnalysisInstrument { |
| 14 | /// Called before the benchmark process is spawned, to set up the instrument and the |
| 15 | /// environment it needs in the benchmark process. |
| 16 | async fn start( |
| 17 | &mut self, |
| 18 | profile_folder: &Path, |
| 19 | env: &mut HashMap<String, String>, |
| 20 | ) -> Result<()>; |
| 21 | |
| 22 | /// Called when the integration starts measuring a benchmark. |
| 23 | async fn on_start_profiler(&mut self) -> Result<()> { |
| 24 | Ok(()) |
| 25 | } |
| 26 | |
| 27 | /// Called when the integration stops measuring a benchmark. |
| 28 | async fn on_stop_profiler(&mut self) -> Result<()> { |
| 29 | Ok(()) |
| 30 | } |
| 31 | |
| 32 | /// Called once the benchmark process has exited, successfully or not. |
| 33 | async fn stop(&mut self) -> Result<()>; |
| 34 | } |
| 35 | |
| 36 | pub fn enabled_instruments(instruments: &Instruments) -> Vec<Box<dyn AnalysisInstrument>> { |
| 37 | let mut enabled: Vec<Box<dyn AnalysisInstrument>> = Vec::new(); |
no outgoing calls
no test coverage detected