From eb0129cba434a7c9c7648a0e32922da8f227d011 Mon Sep 17 00:00:00 2001 From: longXboy Date: Fri, 21 Jun 2019 10:14:39 +0800 Subject: [PATCH] fix cpu --- pkg/stat/sys/cpu/cpu_test.go | 2 +- pkg/stat/sys/cpu/psutilCPU_test.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 d4b2ff4cf..336abe8ff 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 * 2600) + time.Sleep(time.Millisecond * 1000) for i := 0; i < 6; i++ { time.Sleep(time.Millisecond * 500) ReadStat(&stat) diff --git a/pkg/stat/sys/cpu/psutilCPU_test.go b/pkg/stat/sys/cpu/psutilCPU_test.go index 260090a5f..9aa70c48f 100644 --- a/pkg/stat/sys/cpu/psutilCPU_test.go +++ b/pkg/stat/sys/cpu/psutilCPU_test.go @@ -11,7 +11,7 @@ func Test_PsutilCPU(t *testing.T) { if err != nil { t.Fatalf("newPsutilCPU failed!err:=%v", err) } - time.Sleep(time.Millisecond * 600) + time.Sleep(time.Millisecond * 2600) for i := 0; i < 6; i++ { time.Sleep(time.Millisecond * 600) u, err := cpu.Usage()