Store bootstrap command-line into metrics

This commit is contained in:
Jakub Beránek 2025-02-19 16:06:47 +01:00
parent 6463590f0c
commit 2e5ab4e6a0
2 changed files with 10 additions and 0 deletions

View file

@ -200,6 +200,14 @@ impl BuildMetrics {
}
};
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)

View file

@ -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.