liuxiaolong
2020-09-16 4501e38ca66f09b35aaaf43fa5a316554930fcf4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package agent
 
import (
    "runtime"
    "strconv"
)
 
// runtimeStats is used to return various runtime information
func runtimeStats() map[string]string {
    return map[string]string{
        "os":         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),
    }
}