diff options
Diffstat (limited to 'xtask')
-rw-r--r-- | xtask/src/metrics.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/xtask/src/metrics.rs b/xtask/src/metrics.rs index 40fc6e622..624ad3b7e 100644 --- a/xtask/src/metrics.rs +++ b/xtask/src/metrics.rs | |||
@@ -3,7 +3,6 @@ use std::{ | |||
3 | env, | 3 | env, |
4 | io::Write as _, | 4 | io::Write as _, |
5 | path::Path, | 5 | path::Path, |
6 | process::{Command, Stdio}, | ||
7 | time::{Instant, SystemTime, UNIX_EPOCH}, | 6 | time::{Instant, SystemTime, UNIX_EPOCH}, |
8 | }; | 7 | }; |
9 | 8 | ||
@@ -82,11 +81,9 @@ impl Metrics { | |||
82 | } | 81 | } |
83 | fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { | 82 | fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> { |
84 | eprintln!("\nMeasuring analysis-stats/{}", name); | 83 | eprintln!("\nMeasuring analysis-stats/{}", name); |
85 | let output = Command::new("./target/release/rust-analyzer") | 84 | let output = |
86 | .args(&["analysis-stats", "--quiet", "--memory-usage", path]) | 85 | cmd!("./target/release/rust-analyzer analysis-stats --quiet --memory-usage {path}") |
87 | .stderr(Stdio::inherit()) | 86 | .read()?; |
88 | .output()?; | ||
89 | let output = String::from_utf8(output.stdout)?; | ||
90 | for (metric, value, unit) in parse_metrics(&output) { | 87 | for (metric, value, unit) in parse_metrics(&output) { |
91 | self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); | 88 | self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into()); |
92 | } | 89 | } |