From 2470047483c88b99e927a41dd06500d68100411a Mon Sep 17 00:00:00 2001 From: longXboy Date: Fri, 21 Jun 2019 10:11:51 +0800 Subject: [PATCH] fix test --- pkg/stat/sys/cpu/cpu_test.go | 2 +- pkg/stat/sys/cpu/psutilCPU.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/stat/sys/cpu/cpu_test.go b/pkg/stat/sys/cpu/cpu_test.go index accad1deb..d4b2ff4cf 100644 --- a/pkg/stat/sys/cpu/cpu_test.go +++ b/pkg/stat/sys/cpu/cpu_test.go @@ -10,7 +10,7 @@ func Test_CPUUsage(t *testing.T) { var stat Stat ReadStat(&stat) fmt.Println(stat) - time.Sleep(time.Millisecond * 600) + time.Sleep(time.Millisecond * 2600) for i := 0; i < 6; i++ { time.Sleep(time.Millisecond * 500) ReadStat(&stat) diff --git a/pkg/stat/sys/cpu/psutilCPU.go b/pkg/stat/sys/cpu/psutilCPU.go index d0e548801..8d64f8dcc 100644 --- a/pkg/stat/sys/cpu/psutilCPU.go +++ b/pkg/stat/sys/cpu/psutilCPU.go @@ -23,7 +23,7 @@ func (ps *psutilCPU) Usage() (u uint64, err error) { var percents []float64 percents, err = cpu.Percent(ps.interval, false) if err == nil { - u = uint64(percents[0] * 10000000) + u = uint64(percents[0] * 10) } return }