open-nomad/helper/stats/runtime.go

19 lines
489 B
Go
Raw Normal View History

2018-01-12 21:58:44 +00:00
package stats
import (
"runtime"
"strconv"
)
// RuntimeStats is used to return various runtime information
func RuntimeStats() map[string]string {
return map[string]string{
"kernel.name": runtime.GOOS,
"arch": runtime.GOARCH,
"version": runtime.Version(),
"max_procs": strconv.FormatInt(int64(runtime.GOMAXPROCS(0)), 10),
"goroutines": strconv.FormatInt(int64(runtime.NumGoroutine()), 10),
"cpu_count": strconv.FormatInt(int64(runtime.NumCPU()), 10),
}
}