diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-11 17:25:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-11 17:25:16 +0000 |
commit | 3df4b8c1fa4c1686228162bff03e4db3f01b9826 (patch) | |
tree | ad4bac6e189748bd1a5b3a616c25b7d750fcd195 /xtask | |
parent | 24731e107f3c4790fc5fe73b63ad251a9d6e62ae (diff) | |
parent | cb35d3a05a6e1414cfc8799d7ebd38f490c8513b (diff) |
Merge #6830
6830: Avoid panic when collecting memory metrics r=jonas-schievink a=jonas-schievink
This is getting hit during metrics collection.
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
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 | } |