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

Function create_profile_folder

src/executor/helpers/profile_folder.rs:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7use std::path::PathBuf;
8
9pub fn create_profile_folder() -> Result<PathBuf> {
10 let folder_name = format!(
11 "profile.{}.out",
12 Alphanumeric.sample_string(&mut rand::rng(), 10)
13 );
14 let mut folder_path = env::temp_dir();
15 folder_path.push(folder_name);
16 fs::create_dir_all(&folder_path).map_err(|e| {
17 anyhow!(
18 "Failed to create profile folder: {}, {}",
19 folder_path.display(),
20 e
21 )
22 })?;
23 debug!("Created profile folder: {}", folder_path.display());
24 Ok(folder_path)
25}
26
27#[cfg(test)]
28mod tests {

Callers 2

Calls

no outgoing calls

Tested by 1