diff options
author | Jonas Schievink <[email protected]> | 2020-12-11 17:24:42 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-12-11 17:24:42 +0000 |
commit | cb35d3a05a6e1414cfc8799d7ebd38f490c8513b (patch) | |
tree | ad4bac6e189748bd1a5b3a616c25b7d750fcd195 /xtask/src | |
parent | 2fdde98b5c3b4e94276b83b7fe4654b9785945ad (diff) |
metrics: go back to `cmd!`
Diffstat (limited to 'xtask/src')
-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 | } |