daemon: handleContainerExit(): add execDuration in attributes

Add `execDuration` field to the event attributes map. This is useful for tracking how long the container ran.

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
This commit is contained in:
Dorin Geman 2023-05-08 10:22:58 +03:00
parent 698fa85f38
commit 2ad37e1832

View file

@ -78,7 +78,8 @@ func (daemon *Daemon) handleContainerExit(c *container.Container, e *libcontaine
}
attributes := map[string]string{
"exitCode": strconv.Itoa(exitStatus.ExitCode),
"exitCode": strconv.Itoa(exitStatus.ExitCode),
"execDuration": strconv.Itoa(int(execDuration.Seconds())),
}
daemon.Cleanup(c)