Skip to content

Commit

Permalink
Print flamegraph path (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
javierhonduco authored Jul 7, 2022
1 parent e72aec2 commit 65d01d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ fn main() -> Result<()> {
let now: DateTime<Utc> = Utc::now();
let name_suffix = now.format("%m%d%Y_%Hh%Mm%Ss");

let f = File::create(format!("rbperf_flame_{}.svg", name_suffix)).unwrap();
let flame_path = format!("rbperf_flame_{}.svg", name_suffix);
let f = File::create(&flame_path).unwrap();
flamegraph::from_reader(&mut options, data, f).unwrap();

let serialized = serde_json::to_string(&profile).unwrap();
fs::write(format!("rbperf_out_{}.json", name_suffix), serialized)
.expect("Unable to write file");

println!("Flamegraph written to: {}", flame_path);
}
}

Expand Down

0 comments on commit 65d01d1

Please sign in to comment.