mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Merge #6828
6828: Metrics debugging r=jonas-schievink a=jonas-schievink Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
commit
d3700b80b1
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@ use std::{
|
|||
env,
|
||||
io::Write as _,
|
||||
path::Path,
|
||||
process::{Command, Stdio},
|
||||
time::{Instant, SystemTime, UNIX_EPOCH},
|
||||
};
|
||||
|
||||
|
@ -81,7 +82,11 @@ impl Metrics {
|
|||
}
|
||||
fn measure_analysis_stats_path(&mut self, name: &str, path: &str) -> Result<()> {
|
||||
eprintln!("\nMeasuring analysis-stats/{}", name);
|
||||
let output = cmd!("./target/release/rust-analyzer analysis-stats --quiet {path}").read()?;
|
||||
let output = Command::new("./target/release/rust-analyzer")
|
||||
.args(&["analysis-stats", "--quiet", "--memory-usage", path])
|
||||
.stdout(Stdio::inherit())
|
||||
.output()?;
|
||||
let output = String::from_utf8(output.stdout)?;
|
||||
for (metric, value, unit) in parse_metrics(&output) {
|
||||
self.report(&format!("analysis-stats/{}/{}", name, metric), value, unit.into());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue