change command duration env var to emit duration in milliseconds and also change var name to CMD_DURATION_MS (#3581)

This commit is contained in:
Darren Schroeder 2021-06-08 16:14:38 -05:00 committed by GitHub
parent a021b99614
commit 5ec226a416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,8 +157,8 @@ pub fn cli(context: EvaluationContext, options: Options) -> Result<(), Box<dyn E
}
// Store cmd duration in an env var
context.scope.add_env_var(
"CMD_DURATION",
format!("{:?}", startup_commands_start_time.elapsed()),
"CMD_DURATION_MS",
format!("{}", startup_commands_start_time.elapsed().as_millis()),
);
trace!(
"startup commands took {:?}",
@ -332,9 +332,10 @@ pub fn cli(context: EvaluationContext, options: Options) -> Result<(), Box<dyn E
};
// Store cmd duration in an env var
context
.scope
.add_env_var("CMD_DURATION", format!("{:?}", cmd_start_time.elapsed()));
context.scope.add_env_var(
"CMD_DURATION_MS",
format!("{}", cmd_start_time.elapsed().as_millis()),
);
match line {
LineResult::Success(line) => {