Merge pull request #10270 from afbjorklund/gopsutil-cpu
The gopsutil cpu implementation changed in v3pull/10273/head
commit
a1e7799db8
|
@ -979,8 +979,8 @@ func validateCPUCount(drvName string) {
|
|||
var cpuCount int
|
||||
if driver.BareMetal(drvName) {
|
||||
|
||||
// Uses the gopsutil cpu package to count the number of physical cpu cores
|
||||
ci, err := cpu.Counts(false)
|
||||
// Uses the gopsutil cpu package to count the number of logical cpu cores
|
||||
ci, err := cpu.Counts(true)
|
||||
if err != nil {
|
||||
klog.Warningf("Unable to get CPU info: %v", err)
|
||||
} else {
|
||||
|
|
|
@ -181,6 +181,7 @@ var (
|
|||
// cachedCPUInfo will return a cached cpu info
|
||||
func cachedCPUInfo() ([]cpu.InfoStat, error) {
|
||||
if cachedCPU == nil {
|
||||
// one InfoStat per thread
|
||||
i, err := cpu.Info()
|
||||
cachedCPU = &i
|
||||
cachedCPUErr = &err
|
||||
|
|
Loading…
Reference in New Issue