mirror of
https://github.com/cjbassi/gotop.git
synced 2025-04-27 13:48:54 +08:00
Fix process cpu usage being divided by cpu count
This commit is contained in:
parent
b42d098a99
commit
3ab6ea2380
@ -65,8 +65,9 @@ func NewProc(keyPressed chan bool) *Proc {
|
|||||||
|
|
||||||
func (self *Proc) update() {
|
func (self *Proc) update() {
|
||||||
processes := psutil.Processes()
|
processes := psutil.Processes()
|
||||||
for _, process := range processes {
|
// have to iterate like this in order to actually change the value
|
||||||
process.CPU /= self.cpuCount
|
for i, _ := range processes {
|
||||||
|
processes[i].CPU /= self.cpuCount
|
||||||
}
|
}
|
||||||
|
|
||||||
self.ungroupedProcs = processes
|
self.ungroupedProcs = processes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user