forked from davecheney/gmx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntime.go
42 lines (31 loc) · 833 Bytes
/
runtime.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package gmx
// pkg/runtime instrumentation
import "runtime"
var memstats runtime.MemStats
func init() {
Publish("runtime.gomaxprocs", runtimeGOMAXPROCS)
Publish("runtime.numcgocall", runtimeNumCgoCall)
Publish("runtime.numcpu", runtimeNumCPU)
Publish("runtime.numgoroutine", runtimeNumGoroutine)
Publish("runtime.version", runtimeVersion)
Publish("runtime.memstats", runtimeMemStats)
}
func runtimeGOMAXPROCS() interface{} {
return runtime.GOMAXPROCS(0)
}
func runtimeNumCgoCall() interface{} {
return runtime.NumCgoCall()
}
func runtimeNumCPU() interface{} {
return runtime.NumCPU()
}
func runtimeNumGoroutine() interface{} {
return runtime.NumGoroutine()
}
func runtimeVersion() interface{} {
return runtime.Version()
}
func runtimeMemStats() interface{} {
runtime.ReadMemStats(&memstats)
return memstats
}