+ Runtime: Add go version to debug infos

Upstream-commit: d6c24092eb0e24f7aaa921110c62e99e81ae1f88
Component: engine
This commit is contained in:
Guillaume J. Charmes
2013-05-08 15:26:44 -07:00
parent d25803433e
commit acc707fbce

View File

@ -11,6 +11,7 @@ import (
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"runtime"
"strconv"
@ -284,9 +285,10 @@ func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string
VERSION,
imgcount)
if !rcli.DEBUG_FLAG {
if os.Getenv("DEBUG") == "" {
return nil
}
fmt.Fprintf(stdout, "Go version: %s\n", runtime.Version())
fmt.Fprintln(stdout, "debug mode enabled")
fmt.Fprintf(stdout, "fds: %d\ngoroutines: %d\n", getTotalUsedFds(), runtime.NumGoroutine())
return nil