mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
Store bootstrap command-line into metrics
This commit is contained in:
@@ -200,6 +200,14 @@ pub(crate) fn persist(&self, build: &Build) {
|
||||
}
|
||||
};
|
||||
invocations.push(JsonInvocation {
|
||||
// The command-line invocation with which bootstrap was invoked.
|
||||
// Skip the first argument, as it is a potentially long absolute
|
||||
// path that is not interesting.
|
||||
cmdline: std::env::args_os()
|
||||
.skip(1)
|
||||
.map(|arg| arg.to_string_lossy().to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(" "),
|
||||
start_time: state
|
||||
.invocation_start
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
|
||||
@@ -12,6 +12,8 @@ pub struct JsonRoot {
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub struct JsonInvocation {
|
||||
// Remembers the command-line invocation with which bootstrap was invoked.
|
||||
pub cmdline: String,
|
||||
// Unix timestamp in seconds
|
||||
//
|
||||
// This is necessary to easily correlate this invocation with logs or other data.
|
||||
|
||||
Reference in New Issue
Block a user