Update process/process.go

Co-authored-by: shirou <shirou.faw@gmail.com>
pull/1692/head
Cnpt 9 months ago committed by GitHub
parent fea0926fc4
commit cc21c22245
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -325,7 +325,7 @@ func calculatePercent(t1, t2 *cpu.TimesStat, delta float64, numcpu int) float64
if delta == 0 {
return 0
}
//https://github1s.com/giampaolo/psutil/blob/c034e6692cf736b5e87d14418a8153bb03f6cf42/psutil/__init__.py#L1064
// https://github.com/giampaolo/psutil/blob/c034e6692cf736b5e87d14418a8153bb03f6cf42/psutil/__init__.py#L1064
delta_proc := (t2.User - t1.User) + (t2.System - t1.System)
if delta_proc <= 0 {
return 0

Loading…
Cancel
Save