Fix process cpu usage being divided by cpu count

This commit is contained in:
Caleb Bassi 2018-05-15 11:46:06 -07:00
parent b42d098a99
commit 3ab6ea2380

View File

@ -65,8 +65,9 @@ func NewProc(keyPressed chan bool) *Proc {
func (self *Proc) update() {
processes := psutil.Processes()
for _, process := range processes {
process.CPU /= self.cpuCount
// have to iterate like this in order to actually change the value
for i, _ := range processes {
processes[i].CPU /= self.cpuCount
}
self.ungroupedProcs = processes