go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

fix: cpu usage calculate error

Open pig-peppa opened this issue 2 years ago • 0 comments

in your code, usage = uint64(float64(cpuDeltacores1e3) / (float64(systemDelta) * quota)).

when host's CPU It's big enough such as 48core, while container's cpu limit is small such as 100m, according to the above calculation method, the result value is likely to be greater than CpuThreshold's max value(1000) in config file.

pig-peppa avatar Jun 17 '22 08:06 pig-peppa