sentinel-golang icon indicating copy to clipboard operation
sentinel-golang copied to clipboard

fix getProcessCpuStat return value (in percentage) breaks compatibility.

Open sunyucheng opened this issue 1 year ago • 6 comments

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

sunyucheng avatar Jun 30 '23 11:06 sunyucheng

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 30 '23 11:06 CLAassistant

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.08 :tada:

Comparison is base (0807185) 53.17% compared to head (5d210df) 53.25%.

:exclamation: Current head 5d210df differs from pull request most recent head 0e75426. Consider uploading reports for the commit 0e75426 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #540      +/-   ##
==========================================
+ Coverage   53.17%   53.25%   +0.08%     
==========================================
  Files          91       91              
  Lines        5894     5896       +2     
==========================================
+ Hits         3134     3140       +6     
+ Misses       2413     2408       -5     
- Partials      347      348       +1     
Impacted Files Coverage Δ
core/system_metric/sys_metric_stat.go 21.80% <100.00%> (+4.24%) :arrow_up:

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Jul 03 '23 01:07 codecov-commenter

Hi @binbin0325 @sczyh30, looking forward to your reply.

HelloCarry avatar Jul 04 '23 06:07 HelloCarry

Hi @sczyh30 @binbin0325, if there are no doubts, we look forward to the adoption of PR

HelloCarry avatar Jul 05 '23 09:07 HelloCarry

Hi @sczyh30 @binbin0325, looking forward to your reply

HelloCarry avatar Jul 10 '23 14:07 HelloCarry

Hi @sczyh30 @binbin0325, looking forward to your reply

HelloCarry avatar Jul 18 '23 14:07 HelloCarry