Skip to content

Commit 24b58c5

Browse files
committed
#4 fix
1 parent 8298234 commit 24b58c5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

model/push.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func (p *Push) Push(args []*PushPair) error {
5353
return iface.push(args)
5454
}
5555

56-
// {{key}} {{value}}
5756
type PushFormat string
5857
type PushPair struct {
5958
key string

model/status.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,17 @@ func parseCPUStatus(s string) error {
264264
if err != nil {
265265
return err
266266
}
267-
total := 0
268-
for i := 2; i < 11; i++ {
267+
used := sys + user
268+
total := used
269+
for i := 3; i < 8; i++ {
269270
v, err := strconv.Atoi(fields[i])
270271
if err != nil {
271272
return err
272273
}
273274
total += v
274275
}
275276
Status.CPU[i].TimeSequence.Update(&cpuOneTimeStatus{
276-
Used: user + sys,
277+
Used: used,
277278
Total: total,
278279
})
279280
}

0 commit comments

Comments
 (0)