Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/1160#discussion_r174444069
--- Diff: exec/java-exec/src/main/resources/rest/metrics/metrics.ftl ---
@@ -109,18 +114,23 @@
};
function updateBars(gauges) {
- $.each(["heap","non-heap","total"], function(i, key) {
+ $.each(["heap","non-heap","total","drill.allocator.root"],
function(i, key) {
var used = gauges[key + ".used"].value;
- var max = gauges[key + ".max"].value;
- var usage = round((used / 1073741824), 2) + "GB";
- var percent = round((used / max), 2);
-
- var styleVal = "width: " + percent + "%;"
- $("#" + key + "Usage").attr({
+ var max;
+ if (key.startsWith("drill.allocator")) {
--- End diff --
Using `key.startsWith("drill.allocator")` several times in this method is
not very elegant. Besides it he fact it is repeated action, I do not like such
checks in general. I guess that can be re-written.
---