MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / AnalysisInstrument

Interface AnalysisInstrument

src/executor/analysis/instruments/mod.rs:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11/// Collects data while the benchmarks run in analysis mode.
12#[async_trait(?Send)]
13pub 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
36pub fn enabled_instruments(instruments: &Instruments) -> Vec<Box<dyn AnalysisInstrument>> {
37 let mut enabled: Vec<Box<dyn AnalysisInstrument>> = Vec::new();

Callers 2

runMethod · 0.45
runMethod · 0.45

Implementers 1

telemetry.rssrc/executor/analysis/instruments/tele

Calls

no outgoing calls

Tested by

no test coverage detected