mirror of
https://github.com/clearlinux/docker.git
synced 2026-05-14 10:43:50 +00:00
Add system time to /info
This change adds daemon's system time as RFC3339Nano to the `/info` endpoint and shows in a more readable format (UnixDate) in `docker -D info` output. I will be using this to fix the clock skew between the remote test host and the CI machines running `docker events`-related tests as they're using `--since` and `--until` and the timestamps are not matching when daemon is not on the same machine. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
@@ -578,6 +578,14 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
|
||||
if remoteInfo.Exists("NGoroutines") {
|
||||
fmt.Fprintf(cli.out, "Goroutines: %d\n", remoteInfo.GetInt("NGoroutines"))
|
||||
}
|
||||
if remoteInfo.Exists("SystemTime") {
|
||||
t, err := remoteInfo.GetTime("SystemTime")
|
||||
if err != nil {
|
||||
log.Errorf("Error reading system time: %v", err)
|
||||
} else {
|
||||
fmt.Fprintf(cli.out, "System Time: %s\n", t.Format(time.UnixDate))
|
||||
}
|
||||
}
|
||||
if remoteInfo.Exists("NEventsListener") {
|
||||
fmt.Fprintf(cli.out, "EventsListeners: %d\n", remoteInfo.GetInt("NEventsListener"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user