Skip to content
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

SystemRule usage #905

Closed
Crazy10552 opened this issue Jul 12, 2019 · 3 comments · Fixed by #927
Closed

SystemRule usage #905

Crazy10552 opened this issue Jul 12, 2019 · 3 comments · Fixed by #927
Labels
kind/question Category issues related to questions or problems

Comments

@Crazy10552
Copy link
Contributor

Issue Description

rule do not work all and the olny rule which works but it do not set as i want
Type: bug report

I set five system rule,use zookeeperdatasource,now receive system rule update data
image

then i use curl http://127.0.0.1:8720/getRules?type=system to get my rule

debug find SystemRuleManager code like that
image
only first rule can seem to be seen, someone like the first rule,but the only rule become five rule
image

also dashboard can not show system which i set highestCpuUsage
image

image

Tell us your environment

dubbo 2.5.3
sentinel version 1.6.2

@sczyh30 sczyh30 added the kind/question Category issues related to questions or problems label Jul 12, 2019
@sczyh30
Copy link
Member

sczyh30 commented Jul 15, 2019

then i use curl http://127.0.0.1:8720/getRules?type=system to get my rule

What rules did you get? Could you please provide the rules that you are actually setting, and the rules that the SystemRuleManager actually loaded?

also dashboard can not show system which i set highestCpuUsage

That's not updated in the dashboard. Would you like to contribute?

@Crazy10552
Copy link
Contributor Author

Crazy10552 commented Jul 16, 2019

then i use curl http://127.0.0.1:8720/getRules?type=system to get my rule

What rules did you get? Could you please provide the rules that you are actually setting, and the rules that the SystemRuleManager actually loaded?

my original system_rule data

 [{"avgRt":1,"createTime":1563240045000,"highestCpuUsage":0.1,"highestSystemLoad":100.0,"isDeleted":"N","limitApp":"default","maxThread":100,"qps":100.0,"resource":"sentinel-dubbo-web-demo","systemRuleId":7,"updateTime":1563240134000},{"avgRt":2,"createTime":1563240083000,"highestCpuUsage":0.2,"highestSystemLoad":200.0,"isDeleted":"N","limitApp":"default","maxThread":200,"qps":200.0,"resource":"sentinel-dubbo-web-demo","systemRuleId":9,"updateTime":1563240083000},{"avgRt":3,"createTime":1563240094000,"highestCpuUsage":0.3,"highestSystemLoad":300.0,"isDeleted":"N","limitApp":"default","maxThread":300,"qps":300.0,"resource":"sentinel-dubbo-web-demo","systemRuleId":11,"updateTime":1563240094000}]

system_rule i got with curl http://127.0.0.1:8720/getRules?type=system (SystemRuleManager actually loaded)

 [{"avgRt":-1,"highestCpuUsage":-1.0,"highestSystemLoad":100.0,"maxThread":-1,"qps":-1.0},{"avgRt":-1,"highestCpuUsage":0.1,"highestSystemLoad":-1.0,"maxThread":-1,"qps":-1.0},{"avgRt":1,"highestCpuUsage":-1.0,"highestSystemLoad":-1.0,"maxThread":-1,"qps":-1.0},{"avgRt":-1,"highestCpuUsage":-1.0,"highestSystemLoad":-1.0,"maxThread":100,"qps":-1.0},{"avgRt":-1,"highestCpuUsage":-1.0,"highestSystemLoad":-1.0,"maxThread":-1,"qps":100.0}]

also dashboard can not show system which i set highestCpuUsage

That's not updated in the dashboard. Would you like to contribute?

 i fix it on my local ,but  i have no authority to push my request,how to do it 

@sczyh30
Copy link
Member

sczyh30 commented Jul 16, 2019

You can only create at most one SystemRule of each type. The getRules command will convert each type to individual rules.

系统规则每种只能创建一条,多条的话会以几条中的最小阈值为准。getRules API 会进行转换,每种策略转换成一条单独的规则。

I fix it on my local, but I have no authority to push my request, how to do it

You could refer to https://github.com/alibaba/Sentinel/wiki/开源贡献指南
The related issue: #916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
2 participants