1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-29 13:49:21 +08:00

25 lines
560 B
Go
Raw Normal View History

2014-04-22 09:44:22 +09:00
package gopsutil
2014-04-18 16:34:47 +09:00
import (
"runtime"
)
type CPU_TimesStat struct {
2014-04-24 17:20:12 +09:00
Cpu string `json:"cpu"`
2014-04-24 16:15:57 +09:00
User float32 `json:"user"`
System float32 `json:"system"`
Idle float32 `json:"idle"`
Nice float32 `json:"nice"`
Iowait float32 `json:"iowait"`
Irq float32 `json:"irq"`
Softirq float32 `json:"softirq"`
Steal float32 `json:"steal"`
Guest float32 `json:"guest"`
Guest_nice float32 `json:"guest_nice"`
Stolen float32 `json:"stolen"`
2014-04-18 16:34:47 +09:00
}
func Cpu_counts() (int, error) {
2014-04-18 16:34:47 +09:00
return runtime.NumCPU(), nil
}