Skip to content

Commit

Permalink
bugfix: fix cpu everage
Browse files Browse the repository at this point in the history
CPU usage was average from when ssh connected to current.
It should be average every 10 seconds.
  • Loading branch information
liaotonglang committed Mar 29, 2023
1 parent 69b5557 commit d7fd657
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sguala",
"productName": "sguala",
"version": "2.0.3",
"version": "2.0.4",
"description": "My Electron application description",
"main": ".webpack/main",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions src/main/sshRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,18 @@ export class SshClient {
const idled = Idle - PrevIdle

const CPU_Percentage = (totald - idled) / totald

this.prev = {
user: user,
nice: nice,
system: system,
idle: idle,
iowait: iowait,
irq: irq,
softirq: softirq,
steal: steal,
};

return CPU_Percentage;
}
}
Expand Down

0 comments on commit d7fd657

Please sign in to comment.