Skip to content

Add getCpuUsageThreshold() method in SystemRuleManager #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 21, 2019

Conversation

yikangfeng
Copy link

Describe what this PR does / why we need it

Open getHighest CpuUsage to send custom alarm when system current limit occurs。

Does this pull request fix one issue?

Fixes #769

Describe how you did it

Adding getHighestCpuUsage Method

Describe how to verify it

Access via SystemRuleManager. getHighestCpuUsage

Special notes for reviews

@codecov-io
Copy link

codecov-io commented May 17, 2019

Codecov Report

Merging #770 into master will decrease coverage by 0.07%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #770      +/-   ##
============================================
- Coverage        41%   40.92%   -0.08%     
+ Complexity     1334     1333       -1     
============================================
  Files           301      301              
  Lines          8629     8630       +1     
  Branches       1159     1159              
============================================
- Hits           3538     3532       -6     
- Misses         4665     4671       +6     
- Partials        426      427       +1
Impacted Files Coverage Δ Complexity Δ
...a/csp/sentinel/slots/system/SystemRuleManager.java 43.16% <0%> (-0.32%) 7 <0> (ø)
...m/alibaba/csp/sentinel/log/DateFileLogHandler.java 54.54% <0%> (-3.04%) 6% <0%> (-1%)
...tinel/slots/block/flow/param/ParamFlowChecker.java 52.7% <0%> (-2.71%) 28% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83ab401...9f0d500. Read the comment docs.

@sczyh30 sczyh30 added the to-review To review label May 20, 2019
@sczyh30
Copy link
Member

sczyh30 commented May 20, 2019

And I think if you're going to retrieve the current CPU usage and load of your system, you may get them via:

SystemRuleManager.getCurrentCpuUsage();
SystemRuleManager.getCurrentSystemAvgLoad()

The highestCpuUsage is only the value of the SystemRule.

Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sczyh30 sczyh30 merged commit 4ec0462 into alibaba:master May 21, 2019
@sczyh30
Copy link
Member

sczyh30 commented May 21, 2019

Thanks for contributing!

@sczyh30 sczyh30 removed the to-review To review label May 21, 2019
@sczyh30 sczyh30 added this to the 1.6.1 milestone May 23, 2019
@sczyh30 sczyh30 changed the title Enhancement/highestcpuusage Add getCpuUsageThreshold() method in SystemRuleManager May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants