Merge pull request #248 from dvusboy/cpu_freq_unit
Addressing frequency unit discrepancies
This commit is contained in:
commit
0130d5f088
|
@ -96,11 +96,11 @@ func Info() ([]InfoStat, error) {
|
|||
}
|
||||
|
||||
values := strings.Fields(string(out))
|
||||
mhz, err := strconv.ParseFloat(values[1], 64)
|
||||
hz, err := strconv.ParseFloat(values[1], 64)
|
||||
if err != nil {
|
||||
return ret, err
|
||||
}
|
||||
c.Mhz = mhz / 1000000.0
|
||||
c.Mhz = hz / 1000000.0
|
||||
|
||||
return append(ret, c), nil
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ func finishCPUInfo(c *InfoStat) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.Mhz = value
|
||||
c.Mhz = value/1000.0 // value is in kHz
|
||||
}
|
||||
}
|
||||
if len(c.CoreID) == 0 {
|
||||
|
|
Loading…
Reference in New Issue