alibaba / sentinel-golang

Sentinel Go enables reliability and resiliency for Go microservices
https://sentinelguard.io/
Apache License 2.0
2.76k stars 431 forks source link

fix:cpu rate error #554

Open erouss opened 7 months ago

erouss commented 7 months ago

Describe what this PR does / why we need it

fix getProcessCpuStat return value (in percentage) breaks compatibility.

Does this pull request fix one issue?

Fix https://github.com/alibaba/sentinel-golang/issues/539

Describe how you did it

fix the bug that the CPU usage from getProcessCpuStat was changed to percentage value (i.e. 0-100), which breaks compatibility and affects system adaptive rules.

Describe how to verify it

Added a unit test func TestRetrieveAndUpdateCpuStatReturnValueRange(t *testing.T)

Special notes for reviews

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.