[
https://issues.apache.org/jira/browse/DRILL-6467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16502179#comment-16502179
]
ASF GitHub Bot commented on DRILL-6467:
---------------------------------------
kkhatua opened a new pull request #1305: DRILL-6467: Percentage usage of memory
is reported as zero by the WebUI
URL: https://github.com/apache/drill/pull/1305
The memory reported as a percentage is incorrectly reported as 0%,
irrespective of the actual usage.

This is because of a snippet in the Javascript that computes the percentage:
```javascript
//Compute Usage
function computeMemUsage(used, max) {
let percent = 0;
if ( max > 0) {
let percent = Math.round((100 * used / max), 2);
}
let usage = bytesInGB(used, 2) + "GB (" + Math.max(0, percent) +
"% of "+ bytesInGB(max, 2) +"GB)";
return usage;
}
```
Turns out, the `let` keyword creates a new `percent` variable within the
scope of the `if (max > 0) { .. }` block, so the original variable never got
updated. The fix was to simply remove the `let` preceding the percentage
computation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Percentage usage of memory is reported as zero by the WebUI
> -----------------------------------------------------------
>
> Key: DRILL-6467
> URL: https://issues.apache.org/jira/browse/DRILL-6467
> Project: Apache Drill
> Issue Type: Bug
> Components: Web Server
> Affects Versions: 1.14.0
> Reporter: Kunal Khatua
> Assignee: Kunal Khatua
> Priority: Trivial
> Fix For: 1.14.0
>
> Attachments: image-2018-06-05-10-28-08-067.png
>
> Original Estimate: 0.5h
> Remaining Estimate: 0.5h
>
> The memory reported as a percentage is incorrectly reported as 0%,
> irrespective of the actual usage.
> !image-2018-06-05-10-28-08-067.png!
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)