Skip to content

Commit 6ed260f

Browse files
authored
refactor(timings): separate data collection and presentation (#16282)
### What does this PR try to resolve? The goal of this refactor is to separate data collection and presentation, so that we can replay an HTML report from log generated by `-Zbuild-analysis`. ### How to test and review this PR? Should have no user-facing change, though I would encourage review to run `cargo build --timings` and check if there is anything broken.
2 parents 14c6f00 + ae9beb9 commit 6ed260f

File tree

6 files changed

+1170
-1101
lines changed

6 files changed

+1170
-1101
lines changed

src/cargo/core/compiler/job_queue/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,11 @@ impl<'gctx> DrainState<'gctx> {
817817
}
818818

819819
let time_elapsed = util::elapsed(build_runner.bcx.gctx.creation_time().elapsed());
820-
if let Err(e) = self.timings.finished(build_runner, &errors.to_error()) {
820+
if let Err(e) = self
821+
.timings
822+
.finished(build_runner, &errors.to_error())
823+
.context("failed to render timing report")
824+
{
821825
self.handle_error(&mut build_runner.bcx.gctx.shell(), &mut errors, e);
822826
}
823827
if build_runner.bcx.build_config.emit_json() {

0 commit comments

Comments
 (0)