1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-05 22:53:41 +02:00
This commit is contained in:
longXboy 2019-06-21 10:11:51 +08:00
parent 5f0e0dca3e
commit 2470047483
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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
}