You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/05 17:37:00 UTC

[jira] [Commented] (DRILL-6467) Percentage usage of memory is reported as zero by the WebUI

    [ 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.
   ![image](https://user-images.githubusercontent.com/4335237/40992450-b568ab6a-68ab-11e8-9c32-d1a6de2f7c91.png)
   
   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:
users@infra.apache.org


> 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)