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

Interface Executor

src/executor/mod.rs:114–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113#[async_trait(?Send)]
114pub trait Executor {
115 fn name(&self) -> ExecutorName;
116
117 /// Report the installation status of the tool(s) this executor depends on.
118 fn tool_status(&self) -> Option<ToolStatus>;
119
120 /// Report whether the elevated privileges this executor needs are in place.
121 /// Defaults to `None` for executors that need none. Only consulted once the
122 /// tool itself is installed.
123 fn privilege_status(&self) -> Option<PrivilegeStatus> {
124 None
125 }
126
127 /// Declare how well this executor runs on the host system. Drives whether `setup()` is invoked
128 /// (only when [`ExecutorSupport::FullySupported`]) and whether we bail out of running the
129 /// executor at all (on [`ExecutorSupport::Unsupported`]).
130 fn support_level(&self, system_info: &SystemInfo) -> ExecutorSupport;
131
132 async fn setup(
133 &self,
134 _system_info: &SystemInfo,
135 _setup_cache_dir: Option<&Path>,
136 _run_environment: &RunEnvironment,
137 ) -> Result<()> {
138 Ok(())
139 }
140
141 /// Grant any elevated privileges this executor needs (e.g. file capabilities).
142 /// Runs after [`setup`](Self::setup) and may prompt for sudo. Defaults to a
143 /// no-op for executors that need none.
144 fn grant_privileges(&self) -> Result<()> {
145 Ok(())
146 }
147
148 /// Runs the executor
149 async fn run(
150 &mut self,
151 execution_context: &ExecutionContext,
152 // TODO: use Instruments instead of directly passing the mongodb tracer
153 mongo_tracer: &Option<MongoTracer>,
154 ) -> Result<()>;
155
156 async fn teardown(&self, execution_context: &ExecutionContext) -> Result<()>;
157}
158
159/// Run a single executor: setup → run → teardown → persist logs.
160/// Does NOT upload.

Callers 5

statusFunction · 0.45
setup_and_grantFunction · 0.45
run_executorFunction · 0.45
setup_and_grantFunction · 0.45
run_executorFunction · 0.45

Implementers 4

executor.rssrc/executor/wall_time/executor.rs
executor.rssrc/executor/memory/executor.rs
executor.rssrc/executor/analysis/executor.rs
executor.rssrc/executor/valgrind/executor.rs

Calls

no outgoing calls

Tested by

no test coverage detected