Skip to content

Commit

Permalink
fix(risectl): cpu profiling: PREFIX_PROFILING not set (#14819)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyufjh authored Jan 27, 2024
1 parent f16a623 commit fa8406a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ctl/src/cmd_impl/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ pub async fn cpu_profile(context: &CtlContext, sleep_s: u64) -> anyhow::Result<(

let clients = ComputeClientPool::default();

let profile_root_path = PathBuf::from(&std::env::var("PREFIX_PROFILING")?);
let profile_root_path = std::env::var("PREFIX_PROFILING").unwrap_or_else(|_| {
tracing::info!("PREFIX_PROFILING is not set, using current directory");
"./".to_string()
});
let profile_root_path = PathBuf::from(&profile_root_path);
let dir_name = Local::now().format("%Y-%m-%d-%H-%M-%S").to_string();
let dir_path = profile_root_path.join(dir_name);
create_dir_all(&dir_path).await?;
Expand Down

0 comments on commit fa8406a

Please sign in to comment.