Skip to content

Commit cb35d3a

Browse files
metrics: go back to cmd!
1 parent 2fdde98 commit cb35d3a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

xtask/src/metrics.rs

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

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

0 commit comments

Comments
 (0)