add build metrics, to gather ci stats from x.py
This tool will generate a JSON file with statistics about each individual step to disk. It will be used in rust-lang/rust's CI to replace the mix of scripts and log scraping we currently have to gather this data.
This commit is contained in:
@@ -149,6 +149,9 @@ mod tool;
|
||||
mod toolstate;
|
||||
pub mod util;
|
||||
|
||||
#[cfg(feature = "build-metrics")]
|
||||
mod metrics;
|
||||
|
||||
#[cfg(windows)]
|
||||
mod job;
|
||||
|
||||
@@ -311,6 +314,9 @@ pub struct Build {
|
||||
prerelease_version: Cell<Option<u32>>,
|
||||
tool_artifacts:
|
||||
RefCell<HashMap<TargetSelection, HashMap<String, (&'static str, PathBuf, Vec<String>)>>>,
|
||||
|
||||
#[cfg(feature = "build-metrics")]
|
||||
metrics: metrics::BuildMetrics,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -500,6 +506,9 @@ impl Build {
|
||||
delayed_failures: RefCell::new(Vec::new()),
|
||||
prerelease_version: Cell::new(None),
|
||||
tool_artifacts: Default::default(),
|
||||
|
||||
#[cfg(feature = "build-metrics")]
|
||||
metrics: metrics::BuildMetrics::init(),
|
||||
};
|
||||
|
||||
build.verbose("finding compilers");
|
||||
@@ -692,6 +701,9 @@ impl Build {
|
||||
}
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
#[cfg(feature = "build-metrics")]
|
||||
self.metrics.persist(self);
|
||||
}
|
||||
|
||||
/// Clear out `dir` if `input` is newer.
|
||||
|
||||
Reference in New Issue
Block a user