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

Method teardown

src/executor/memory/executor.rs:179–205  ·  view source on GitHub ↗
(&self, execution_context: &ExecutionContext)

Source from the content-addressed store, hash-verified

177 }
178
179 async fn teardown(&self, execution_context: &ExecutionContext) -> Result<()> {
180 let results_dir = execution_context.profile_folder.join("results");
181 let has_benchmarks = std::fs::read_dir(&results_dir)?
182 .filter_map(Result::ok)
183 // Filter out non-ExecutionTimestamps files:
184 .filter(|entry| {
185 entry
186 .file_name()
187 .to_string_lossy()
188 .contains(ExecutionTimestamps::name())
189 })
190 .filter_map(|entry| {
191 let file = std::fs::File::open(entry.path()).ok()?;
192 ExecutionTimestamps::decode_from_reader(file).ok()
193 })
194 .any(|artifact| !artifact.uri_by_ts.is_empty());
195
196 if !has_benchmarks {
197 if !execution_context.config.allow_empty {
198 bail!("No memory results found in profile folder: {results_dir:?}.");
199 } else {
200 info!("No memory results found in profile folder: {results_dir:?}.");
201 }
202 }
203
204 Ok(())
205 }
206}
207
208impl MemoryExecutor {

Callers 1

run_executorFunction · 0.45

Calls 3

file_nameMethod · 0.80
pathMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected