Skip to content

Commit

Permalink
Merge pull request #1753 from Kobzol/collector-log
Browse files Browse the repository at this point in the history
Add a few more logs to collector
  • Loading branch information
Mark-Simulacrum authored Nov 25, 2023
2 parents 3fbeb90 + ee2dd35 commit e72f5a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions collector/src/compile/benchmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ impl Benchmark {
preparation_start.elapsed().as_secs()
);

let benchmark_start = std::time::Instant::now();
for &backend in backends {
for (profile, prep_dir) in &profile_dirs {
let profile = *profile;
Expand Down Expand Up @@ -414,6 +415,11 @@ impl Benchmark {
}
}
}
log::trace!(
"benchmarking {} took {} seconds",
self.name,
benchmark_start.elapsed().as_secs()
);

Ok(())
}
Expand Down
5 changes: 3 additions & 2 deletions collector/src/compile/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,13 @@ impl<'a> CargoProcess<'a> {
// really.
pub async fn run_rustc(&mut self, needs_final: bool) -> anyhow::Result<()> {
log::info!(
"run_rustc with incremental={}, profile={:?}, scenario={:?}, patch={:?}, backend={:?}",
"run_rustc with incremental={}, profile={:?}, scenario={:?}, patch={:?}, backend={:?}, phase={}",
self.incremental,
self.profile,
self.processor_etc.as_ref().map(|v| v.1),
self.processor_etc.as_ref().and_then(|v| v.3),
self.backend
self.backend,
if needs_final { "benchmark" } else { "dependencies" }
);

loop {
Expand Down
4 changes: 3 additions & 1 deletion collector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::compile::benchmark::{Benchmark, BenchmarkName};
use crate::runtime::{BenchmarkGroup, BenchmarkSuite};
use database::{ArtifactId, ArtifactIdNumber, Connection};
use process::Stdio;
use std::time::Duration;
use std::time::{Duration, Instant};

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

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

if !output.status.success() {
return Err(anyhow::anyhow!(
Expand Down

0 comments on commit e72f5a9

Please sign in to comment.