pull/164/head
longXboy 6 years ago
parent 69282c4c87
commit 15fb800ae8
  1. 2
      go.mod
  2. 3
      pkg/stat/sys/cpu/psutilCPU_test.go

@ -24,7 +24,7 @@ require (
github.com/prometheus/client_golang v0.9.2
github.com/remyoudompheng/bigfft v0.0.0-20190321074620-2f0d2b0e0001 // indirect
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec // indirect
github.com/shirou/gopsutil v2.18.12+incompatible // indirect
github.com/shirou/gopsutil v2.18.12+incompatible
github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726
github.com/sirupsen/logrus v1.4.1
github.com/stretchr/testify v1.3.0

@ -11,8 +11,9 @@ func Test_PsutilCPU(t *testing.T) {
if err != nil {
t.Fatalf("newPsutilCPU failed!err:=%v", err)
}
time.Sleep(time.Millisecond * 600)
for i := 0; i < 6; i++ {
time.Sleep(time.Millisecond * 500)
time.Sleep(time.Millisecond * 600)
u, err := cpu.Usage()
if u == 0 {
t.Fatalf("get cpu from psutil failed!cpu usage is zero!err:=%v", err)

Loading…
Cancel
Save