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

Method teardown

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

Source from the content-addressed store, hash-verified

229 }
230
231 async fn teardown(&self, execution_context: &ExecutionContext) -> Result<()> {
232 let results_dir = execution_context.profile_folder.join("results");
233 let has_benchmarks = std::fs::read_dir(&results_dir)?
234 .filter_map(Result::ok)
235 // Filter out non-ExecutionTimestamps files:
236 .filter(|entry| {
237 entry
238 .file_name()
239 .to_string_lossy()
240 .contains(ExecutionTimestamps::name())
241 })
242 .filter_map(|entry| {
243 let file = std::fs::File::open(entry.path()).ok()?;
244 ExecutionTimestamps::decode_from_reader(file).ok()
245 })
246 .any(|artifact| !artifact.uri_by_ts.is_empty());
247
248 if !has_benchmarks {
249 if !execution_context.config.allow_empty {
250 bail!("No memory results found in profile folder: {results_dir:?}.");
251 } else {
252 info!("No memory results found in profile folder: {results_dir:?}.");
253 }
254 }
255
256 Ok(())
257 }
258}
259
260impl MemoryExecutor {

Callers 1

run_executorFunction · 0.45

Calls 3

pathMethod · 0.80
file_nameMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected