-
Notifications
You must be signed in to change notification settings - Fork 590
HDDS-11206. Statistics storage usage indicators include min, max, median, stdev #6977
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
Conversation
|
Can you help review this PR, @sumitagrawl @ArafatKhan2198 . |
ivandika3
left a comment
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.
Thank for the patch @jianghuazhu , left a few comments.
| */ | ||
| Map<String, Map<String, String>> getNodeStatusInfo(); | ||
|
|
||
| default Map<String, String> getNodeStatics() { |
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.
Typo: Statics -> Statistics.
Also applies to other instances of Statics in the patch.
| private enum UsageStatics { | ||
| MIN("Min"), | ||
| MAX("Max"), | ||
| MEDINNA("Medina"), |
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.
Typo: MEDINA -> MEDIAN. Also applies to similar typos.
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.
Thanks for your comment and review, @ivandika3 .
I'll update later.
| $scope.statistical = { | ||
| usages : {} | ||
| } | ||
| $scope.statistical.usages.min = ""; | ||
| $scope.statistical.usages.max = ""; | ||
| $scope.statistical.usages.medina = ""; | ||
| $scope.statistical.usages.stdev = ""; |
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.
Nit: statistical -> statistics.
I think it's also better to be more specific that it is the statistics for DNs (since technically we can have statistics for SCM in the future). Maybe scope.statistics.nodes.usages. prefix is better.
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 have updated it.
ivandika3
left a comment
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.
Thanks for updating the patch. LGTM +1.
| Map<String, String> nodeStatics = new HashMap<>(); | ||
| // Statistics node usaged | ||
| nodeUsageStatics(nodeStatics); |
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.
Nit: Statics -> Stats / Statistics
|
@jianghuazhu Can you please update the PR description with the latest screenshots. |
|
Hello @jianghuazhu, thank you for this patch. Statistical
to Statistics
|
|
Thanks for your comments and reviews, @ArafatKhan2198 @devabhishekpal . |
| $scope.statistics = { | ||
| nodes : { | ||
| usages : {} | ||
| } | ||
| } | ||
| $scope.statistics.nodes.usages.min = ""; | ||
| $scope.statistics.nodes.usages.max = ""; | ||
| $scope.statistics.nodes.usages.median = ""; | ||
| $scope.statistics.nodes.usages.stdev = ""; |
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.
Hi @jianghuazhu, was there any reason behind separating these values out?
I believe we can declare them in the statistics object.
Also I think initializing them to something like "N/A" would be better as in case there is any error, the default value won't be empty but rather show something to let the user know something went wrong.
| $scope.statistics = { | |
| nodes : { | |
| usages : {} | |
| } | |
| } | |
| $scope.statistics.nodes.usages.min = ""; | |
| $scope.statistics.nodes.usages.max = ""; | |
| $scope.statistics.nodes.usages.median = ""; | |
| $scope.statistics.nodes.usages.stdev = ""; | |
| $scope.statistics = { | |
| nodes : { | |
| usages : { | |
| min: "N/A", | |
| max: "N/A", | |
| median: "N/A", | |
| stdev: "N/A" | |
| } | |
| } | |
| } |
| $scope.lastIndex = Math.ceil(nodeStatusCopy.length / $scope.RecordsToDisplay); | ||
| $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay); | ||
|
|
||
| ctrl.nodemanagermetrics.NodeStatistics.map(({ key, value }) => { |
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.
While using a .map() will give us the same result, but it will also return an array (empty in this case) which we are ignoring as the value is not being assigned.
This might not be affecting the performance or anything, as it is a minor operation, but I would suggest to use .forEach in this scenario.
devabhishekpal
left a comment
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.
Thanks @jianghuazhu for your changes.
Just a few minor comments, and then it looks good to me.
| $scope.lastIndex = Math.ceil(nodeStatusCopy.length / $scope.RecordsToDisplay); | ||
| $scope.nodeStatus = nodeStatusCopy.slice(0, $scope.RecordsToDisplay); | ||
|
|
||
| ctrl.nodemanagermetrics.NodeStatistics.forEach(function(obj) { |
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.
Just fyi, can de-structure this as well like you did for map().
Since obj = { key: abc, value: xyz }, we can destructure it as:
{key, value} = obj
So the function could also be written as:
ctrl.nodemanagermetrics.NodeStatistics.forEach(({key, value}) => {
....
});
But your current change is good as well
devabhishekpal
left a comment
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.
Thanks a lot @jianghuazhu for your changes, this addition is great.
Thank you @ivandika3 for reviewing this PR
The changes LGTM, +1
|
Thanks for your comments and reviews, @devabhishekpal , @ivandika3 . |
|
Thank you for the patch @jianghuazhu, and @devabhishekpal @ArafatKhan2198 for the reviews. |


What changes were proposed in this pull request?
For SCM, it is very useful to count the min, max, median, and stdev of node storage.

After adding the patch:
jmx:
ui:

What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-11206
How was this patch tested?
It is necessary to ensure that jmx can display NodeStatics correctly.
It is necessary to ensure that the UI can display Statistical correctly.