go-zero
go-zero copied to clipboard
fix: cpu usage calculate error
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.