-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Fix the problem that dashboard do not correctly show the SystemRule in CPU usage strategy #922
Changes from 1 commit
7718a5d
d00857d
bcf8954
dd1dd15
0ae8ffa
44f69d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ app.controller('SystemCtl', ['$scope', '$stateParams', 'SystemService', 'ngDialo | |
rule.grade = 2; | ||
} else if (rule.qps >= 0) { | ||
rule.grade = 3; | ||
}else if (rule.avgCpu >= 0) { | ||
rule.grade = 4; | ||
} | ||
}); | ||
$scope.rulesPageConfig.totalCount = $scope.rules.length; | ||
|
@@ -119,6 +121,9 @@ app.controller('SystemCtl', ['$scope', '$stateParams', 'SystemService', 'ngDialo | |
} else if (rule.qps != -1) { | ||
ruleTypeDesc = 'QPS'; | ||
ruleTypeCount = rule.qps; | ||
}else if (rule.avgCpu != -1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto ( |
||
ruleTypeDesc = 'CPU'; | ||
ruleTypeCount = rule.avgCpu; | ||
} | ||
|
||
$scope.confirmDialog = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,14 @@ | |
<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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 叫 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's indeed confusing. You could fix that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</td> | ||
<td style="word-wrap:break-word;word-break:break-all;"> | ||
<span ng-if="rule.avgLoad >= 0">{{rule.avgLoad}}</span> | ||
<span ng-if="rule.avgRt >= 0">{{rule.avgRt}}</span> | ||
<span ng-if="rule.maxThread >= 0">{{rule.maxThread}}</span> | ||
<span ng-if="rule.qps >= 0">{{rule.qps}}</span> | ||
<span ng-if="rule.avgCpu >= 0">{{rule.avgCpu}}</span> | ||
</td> | ||
<td> | ||
<button class="btn btn-xs btn-default" type="button" ng-click="editRule(rule)" style="font-size: 12px; height:25px;">编辑</button> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to be
maxCpuUsage
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other legacy fields might not be good enough... For CPU usage it's an instantaneous value rather than average value.