1
Fork 0

Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrum

Add build metrics to rustbuild

This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects:

* Type name and debug representation of the `Step` object.
* Duration of the step (excluding child steps).
* Systemwide CPU stats for the duration of the step (both single core and all cores).
* Which child steps were executed.

This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information.

r? `@Mark-Simulacrum`
This commit is contained in:
bors 2022-06-05 01:35:03 +00:00
commit 6dadfc06fe
10 changed files with 268 additions and 4 deletions

View file

@ -837,6 +837,9 @@ class RustBuild(object):
args.append("--locked")
if self.use_vendored_sources:
args.append("--frozen")
if self.get_toml("metrics", "build"):
args.append("--features")
args.append("build-metrics")
run(args, env=env, verbose=self.verbose)
def build_triple(self):