Fix the problem that dashboard do not correctly show the SystemRule in CPU usage strategy - #922
Fix the problem that dashboard do not correctly show the SystemRule in CPU usage strategy#922Crazy10552 wants to merge 6 commits into
Conversation
|
Crazy10552 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Hi, thanks for contributing. Could you please sign the CLA here? And please make sure the email of your commits match your GitHub email. 感谢贡献,请将 commit 对应的 email 调整成与 GitHub 的 email 相匹配并 确认一下 CLA。 |
| private Long avgRt; | ||
| private Long maxThread; | ||
| private Double qps; | ||
| private Double avgCpu; |
There was a problem hiding this comment.
Maybe it's better to be maxCpuUsage?
There was a problem hiding this comment.
I saw properties in SystemRule named highestSystemLoad and it named avgLoad in SystemRuleEntity ,so i just do like to name highestCpuUsage in SystemRule to avgCpu in SystemRuleEntity
There was a problem hiding this comment.
Other legacy fields might not be good enough... For CPU usage it's an instantaneous value rather than average value.
| } else if (rule.qps != -1) { | ||
| ruleTypeDesc = 'QPS'; | ||
| ruleTypeCount = rule.qps; | ||
| }else if (rule.avgCpu != -1) { |
| <span ng-if="rule.avgRt >= 0">RT</span> | ||
| <span ng-if="rule.maxThread >= 0">线程数</span> | ||
| <span ng-if="rule.qps >= 0">QPS</span> | ||
| <span ng-if="rule.avgCpu >= 0">CPU</span> |
There was a problem hiding this comment.
i know it's much better but i just confused by the AvgLoad ,i can fix both two of them
There was a problem hiding this comment.
It's indeed confusing. You could fix that.
…(原avgLoad) 属性名称错误的命名
| if (avgLoad != null) { | ||
| if (avgLoad < 0) { | ||
| return Result.ofFail(-1, "avgLoad must >= 0"); | ||
| if (highestSystemLoad != null) { |
There was a problem hiding this comment.
highestSystemLoad 的取值范围是 [0, +∞),load 没有 < 1 的限制。这个需要保持与之前一致。
Codecov Report
@@ Coverage Diff @@
## master #922 +/- ##
============================================
+ Coverage 42.54% 42.55% +0.01%
- Complexity 1441 1442 +1
============================================
Files 310 310
Lines 8993 8993
Branches 1222 1222
============================================
+ Hits 3826 3827 +1
Misses 4698 4698
+ Partials 469 468 -1
Continue to review full report at Codecov.
|
| <!--avgLoad --> | ||
| <input type="radio" name="grade" value="0" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" /> LOAD | ||
| <!--highestSystemLoad --> | ||
| <input type="radio" name="grade" value="0" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" /> 最大系统LOAD |
| /> | ||
| <input type='number' class="form-control highlight-border" ng-model='currentRule.qps' placeholder="[0, ~)的小数" ng-if="currentRule.grade == 3" | ||
| /> | ||
| <input type='number' class="form-control highlight-border" ng-model='currentRule.highestSystemLoad' placeholder="[0, 1)的小数" ng-if="currentRule.grade == 0"/> |
| pagination-id="entriesPagination"> | ||
| <td style="word-wrap:break-word;word-break:break-all;"> | ||
| <span ng-if="rule.avgLoad >= 0">LOAD</span> | ||
| <span ng-if="rule.highestSystemLoad >= 0">最大系统LOAD</span> |
| <span ng-if="rule.avgRt >= 0">RT</span> | ||
| <span ng-if="rule.maxThread >= 0">线程数</span> | ||
| <span ng-if="rule.qps >= 0">QPS</span> | ||
| <span ng-if="rule.highestCpuUsage >= 0">最大CPU使用率</span> |
| /> 入口 QPS | ||
| <input type="radio" name="grade" value="3" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'"/> 入口 QPS | ||
| <!--highestCpuUsage --> | ||
| <input type="radio" name="grade" value="4" checked ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" /> 最大CPU使用 |
|
另外需要将 commit 对应的 email 调整成与 GitHub 的 email 相匹配并 确认一下 CLA 。可以参考:https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/#commits-are-not-linked-to-any-user |
…oard-issues-905 # Conflicts: # sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/system.js # sentinel-dashboard/src/main/webapp/resources/app/views/dialog/system-rule-dialog.html # sentinel-dashboard/src/main/webapp/resources/app/views/system.html


it fix the bug that dashboard do not correctly show the system rule(the rule about properties highestCpuUsage)
Does this pull request fix one issue?
Fixes #905
Describe how you did it
I add new properties in entity [com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.SystemRuleEntity]
I update the related js and html about System rule
Describe how to verify it
Special notes for reviews
None