mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +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:
@@ -3,6 +3,7 @@ package daemon
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/autogen/dockerversion"
|
||||
@@ -76,6 +77,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) engine.Status {
|
||||
v.SetBool("Debug", os.Getenv("DEBUG") != "")
|
||||
v.SetInt("NFd", utils.GetTotalUsedFds())
|
||||
v.SetInt("NGoroutines", runtime.NumGoroutine())
|
||||
v.Set("SystemTime", time.Now().Format(time.RFC3339Nano))
|
||||
v.Set("ExecutionDriver", daemon.ExecutionDriver().Name())
|
||||
v.SetInt("NEventsListener", env.GetInt("count"))
|
||||
v.Set("KernelVersion", kernelVersion)
|
||||
|
||||
Reference in New Issue
Block a user