Skip to content

Commit d7fd657

Browse files
author
liaotonglang
committed
bugfix: fix cpu everage
CPU usage was average from when ssh connected to current. It should be average every 10 seconds.
1 parent 69b5557 commit d7fd657

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sguala",
33
"productName": "sguala",
4-
"version": "2.0.3",
4+
"version": "2.0.4",
55
"description": "My Electron application description",
66
"main": ".webpack/main",
77
"scripts": {

src/main/sshRemote.ts

+12
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,18 @@ export class SshClient {
844844
const idled = Idle - PrevIdle
845845

846846
const CPU_Percentage = (totald - idled) / totald
847+
848+
this.prev = {
849+
user: user,
850+
nice: nice,
851+
system: system,
852+
idle: idle,
853+
iowait: iowait,
854+
irq: irq,
855+
softirq: softirq,
856+
steal: steal,
857+
};
858+
847859
return CPU_Percentage;
848860
}
849861
}

0 commit comments

Comments
 (0)