github.com/hernad/nomad@v1.6.112/helper/stats/runtime.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package stats 5 6 import ( 7 "runtime" 8 "strconv" 9 ) 10 11 // RuntimeStats is used to return various runtime information 12 func RuntimeStats() map[string]string { 13 return map[string]string{ 14 "kernel.name": runtime.GOOS, 15 "arch": runtime.GOARCH, 16 "version": runtime.Version(), 17 "max_procs": strconv.FormatInt(int64(runtime.GOMAXPROCS(0)), 10), 18 "goroutines": strconv.FormatInt(int64(runtime.NumGoroutine()), 10), 19 "cpu_count": strconv.FormatInt(int64(runtime.NumCPU()), 10), 20 } 21 }