diff options
Diffstat (limited to 'xtask/src/metrics.rs')
-rw-r--r-- | xtask/src/metrics.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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::{ | |||
3 | env, | 3 | env, |
4 | io::Write as _, | 4 | io::Write as _, |
5 | path::Path, | 5 | path::Path, |
6 | process::{Command, Stdio}, | ||
6 | time::{Instant, SystemTime, UNIX_EPOCH}, | 7 | time::{Instant, SystemTime, UNIX_EPOCH}, |
7 | }; | 8 | }; |
8 | 9 | ||
@@ -81,7 +82,11 @@ impl Metrics { | |||
81 | } | 82 | } |
82 | fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { | 83 | fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { |
83 | eprintln!("\nMeasuring analysis-stats/{}", name); | 84 | 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)?; | ||
85 | for (metric, value, unit) in parse_metrics(&output) { | 90 | for (metric, value, unit) in parse_metrics(&output) { |
86 | self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); | 91 | self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); |
87 | } | 92 | } |