Merge pull request #325 from simar7/cpu-microcode

cpu: Expose CPU microcode information
pull/330/head
shirou 8 years ago committed by GitHub
commit 35e7422f01

@ -133,6 +133,7 @@ Several methods have been added which are not present in psutil, but will provid
- Mhz - Mhz
- CacheSize - CacheSize
- Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...") - Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...")
- Microcode
- load/LoadAvg() (linux, freebsd) - load/LoadAvg() (linux, freebsd)
@ -262,6 +263,7 @@ hostname x x x x x
CoreID x CoreID x
Cores x x Cores x x
ModelName x x x x x ModelName x x x x x
Microcode x
**LoadAvg** **LoadAvg**
Load1 x x x x Load1 x x x x
Load5 x x x x Load5 x x x x

@ -40,6 +40,7 @@ type InfoStat struct {
Mhz float64 `json:"mhz"` Mhz float64 `json:"mhz"`
CacheSize int32 `json:"cacheSize"` CacheSize int32 `json:"cacheSize"`
Flags []string `json:"flags"` Flags []string `json:"flags"`
Microcode string `json:"microcode"`
} }
type lastPercent struct { type lastPercent struct {

@ -186,6 +186,8 @@ func Info() ([]InfoStat, error) {
c.Flags = strings.FieldsFunc(value, func(r rune) bool { c.Flags = strings.FieldsFunc(value, func(r rune) bool {
return r == ',' || r == ' ' return r == ',' || r == ' '
}) })
case "microcode":
c.Microcode = value
} }
} }
if c.CPU >= 0 { if c.CPU >= 0 {

Loading…
Cancel
Save