From 7fc4ba000e18c96c2c32593909114fe90e163d85 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 11 Dec 2020 17:30:32 +0100 Subject: Capture memory usage metrics --- xtask/src/metrics.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xtask') diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs index e0d1aaf97..42ab09eeb 100644 --- a/xtask/src/metrics.rs +++ b/xtask/src/metrics.rs @@ -3,6 +3,7 @@ use std::{ env, io::Write as _, path::Path, + process::{Command, Stdio}, time::{Instant, SystemTime, UNIX_EPOCH}, }; @@ -81,7 +82,11 @@ impl Metrics { } fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { eprintln!("\nMeasuring analysis-stats/{}", name); - let output = cmd!("./target/release/rust-analyzer analysis-stats --quiet {path}").read()?; + let output = Command::new("./target/release/rust-analyzer") + .args(&["analysis-stats", "--quiet", "--memory-usage", path]) + .stdout(Stdio::inherit()) + .output()?; + let output = String::from_utf8(output.stdout)?; for (metric, value, unit) in parse_metrics(&output) { self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); } -- cgit v1.2.3