cpu: Expose CPU microcode information
This commit exposes the CPU microcode information. Signed-off-by: Simarpreet Singh <simar@opendns.com>
This commit is contained in:
parent
23f4b7eb14
commit
5a4c90ad5f
|
@ -133,6 +133,7 @@ Several methods have been added which are not present in psutil, but will provid
|
|||
- Mhz
|
||||
- CacheSize
|
||||
- Flags (ex: "fpu vme de pse tsc msr pae mce cx8 ...")
|
||||
- Microcode
|
||||
|
||||
- load/LoadAvg() (linux, freebsd)
|
||||
|
||||
|
@ -262,6 +263,7 @@ hostname x x x x x
|
|||
CoreID x
|
||||
Cores x x
|
||||
ModelName x x x x x
|
||||
Microcode x
|
||||
**LoadAvg**
|
||||
Load1 x x x x
|
||||
Load5 x x x x
|
||||
|
|
|
@ -40,6 +40,7 @@ type InfoStat struct {
|
|||
Mhz float64 `json:"mhz"`
|
||||
CacheSize int32 `json:"cacheSize"`
|
||||
Flags []string `json:"flags"`
|
||||
Microcode string `json:"microcode"`
|
||||
}
|
||||
|
||||
type lastPercent struct {
|
||||
|
|
|
@ -186,6 +186,8 @@ func Info() ([]InfoStat, error) {
|
|||
c.Flags = strings.FieldsFunc(value, func(r rune) bool {
|
||||
return r == ',' || r == ' '
|
||||
})
|
||||
case "microcode":
|
||||
c.Microcode = value
|
||||
}
|
||||
}
|
||||
if c.CPU >= 0 {
|
||||
|
|
Loading…
Reference in New Issue