diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-11 16:31:13 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-11 16:31:13 +0000 |
commit | d3700b80b1df09c1591cbf9b21642fa4b01a2174 (patch) | |
tree | a435cd47fdf51add337125224394f27e114251c0 | |
parent | e68110c082abe2a16ec97f9f15ad8c9ebf73996d (diff) | |
parent | 7fc4ba000e18c96c2c32593909114fe90e163d85 (diff) |
Merge #6828
6828: Metrics debugging r=jonas-schievink a=jonas-schievink
Co-authored-by: Jonas Schievink <[email protected]>
-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 | } |