Skip to content

Commit 7fc4ba0

Browse files
Capture memory usage metrics
1 parent e68110c commit 7fc4ba0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xtask/src/metrics.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::{
33
env,
44
io::Write as _,
55
path::Path,
6+
process::{Command, Stdio},
67
time::{Instant, SystemTime, UNIX_EPOCH},
78
};
89

@@ -81,7 +82,11 @@ impl Metrics {
8182
}
8283
fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> {
8384
eprintln!("\nMeasuring analysis-stats/{}", name);
84-
let output = cmd!("./target/release/rust-analyzer analysis-stats --quiet {path}").read()?;
85+
let output = Command::new("./target/release/rust-analyzer")
86+
.args(&["analysis-stats", "--quiet", "--memory-usage", path])
87+
.stdout(Stdio::inherit())
88+
.output()?;
89+
let output = String::from_utf8(output.stdout)?;
8590
for (metric, value, unit) in parse_metrics(&output) {
8691
self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into());
8792
}

0 commit comments

Comments
 (0)