Skip to content

Commit e72f5a9

Browse files
Merge pull request #1753 from Kobzol/collector-log
Add a few more logs to collector
2 parents 3fbeb90 + ee2dd35 commit e72f5a9

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

collector/src/compile/benchmark/mod.rs

+6
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ impl Benchmark {
330330
preparation_start.elapsed().as_secs()
331331
);
332332

333+
let benchmark_start = std::time::Instant::now();
333334
for &backend in backends {
334335
for (profile, prep_dir) in &profile_dirs {
335336
let profile = *profile;
@@ -414,6 +415,11 @@ impl Benchmark {
414415
}
415416
}
416417
}
418+
log::trace!(
419+
"benchmarking {} took {} seconds",
420+
self.name,
421+
benchmark_start.elapsed().as_secs()
422+
);
417423

418424
Ok(())
419425
}

collector/src/compile/execute/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,13 @@ impl<'a> CargoProcess<'a> {
198198
// really.
199199
pub async fn run_rustc(&mut self, needs_final: bool) -> anyhow::Result<()> {
200200
log::info!(
201-
"run_rustc with incremental={}, profile={:?}, scenario={:?}, patch={:?}, backend={:?}",
201+
"run_rustc with incremental={}, profile={:?}, scenario={:?}, patch={:?}, backend={:?}, phase={}",
202202
self.incremental,
203203
self.profile,
204204
self.processor_etc.as_ref().map(|v| v.1),
205205
self.processor_etc.as_ref().and_then(|v| v.3),
206-
self.backend
206+
self.backend,
207+
if needs_final { "benchmark" } else { "dependencies" }
207208
);
208209

209210
loop {

collector/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::compile::benchmark::{Benchmark, BenchmarkName};
1616
use crate::runtime::{BenchmarkGroup, BenchmarkSuite};
1717
use database::{ArtifactId, ArtifactIdNumber, Connection};
1818
use process::Stdio;
19-
use std::time::Duration;
19+
use std::time::{Duration, Instant};
2020

2121
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Deserialize)]
2222
pub struct DeltaTime(#[serde(with = "round_float")] pub f64);
@@ -228,12 +228,14 @@ pub async fn async_command_output(
228228
) -> anyhow::Result<process::Output> {
229229
use anyhow::Context;
230230

231+
let start = Instant::now();
231232
let child = cmd
232233
.stdout(Stdio::piped())
233234
.stderr(Stdio::piped())
234235
.spawn()
235236
.with_context(|| format!("failed to spawn process for cmd: {:?}", cmd))?;
236237
let output = child.wait_with_output().await?;
238+
log::trace!("command {cmd:?} took {} ms", start.elapsed().as_millis());
237239

238240
if !output.status.success() {
239241
return Err(anyhow::anyhow!(

0 commit comments

Comments
 (0)