nwangtw commented on a change in pull request #3375: Add instance resource usage in container URL: https://github.com/apache/incubator-heron/pull/3375#discussion_r338321221
########## File path: heron/tools/ui/resources/static/js/physical-plan.js ########## @@ -86,6 +93,18 @@ return d.children.length; }); + function formatByteSize(byteSize) { + if (byteSize > 1024 * 1024 * 1024 / 2) { + return (byteSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB'; + } else if (byteSize > 1024 * 1024 / 2) { + return (byteSize / (1024 * 1024)).toFixed(2) + 'MB'; + } else if (byteSize > 1024 / 2) { + return (byteSize / 1024).toFixed(2) + 'KB'; + } else { + return byteSize + 'B'; + } + } Review comment: hmm. maybe future TODO since I don't want to add new dependency now. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services