mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-26 13:48:59 +08:00
Add support for additional CPU info fields
This commit is contained in:
parent
6b630a841a
commit
8cc32696fe
@ -129,6 +129,20 @@ func InfoWithContext(ctx context.Context) ([]InfoStat, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
} else if strings.HasPrefix(line, "System Model:") {
|
||||||
|
p := strings.Split(string(line), ":")
|
||||||
|
if p != nil {
|
||||||
|
ret.VendorID = strings.TrimSpace(p[1])
|
||||||
|
}
|
||||||
|
} else if strings.HasPrefix(line, "Processor Type:") {
|
||||||
|
p := strings.Split(string(line), ":")
|
||||||
|
if p != nil {
|
||||||
|
c := strings.Split(string(p[1]), "_")
|
||||||
|
if c != nil {
|
||||||
|
ret.Family = strings.TrimSpace(c[0])
|
||||||
|
ret.Model = strings.TrimSpace(c[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return []InfoStat{ret}, nil
|
return []InfoStat{ret}, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user