drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ar...@apache.org
Subject [09/11] drill git commit: DRILL-5921: Display counter metrics in table
Date Mon, 13 Nov 2017 12:07:23 GMT
DRILL-5921: Display counter metrics in table

closes #1020


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/ed6c4bc8
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/ed6c4bc8
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/ed6c4bc8

Branch: refs/heads/master
Commit: ed6c4bc8e18b55e2aaac731f6cb4bc0f4480e490
Parents: 99e4504
Author: Prasad Nagaraj Subramanya <prasadns14@gmail.com>
Authored: Wed Nov 8 23:18:42 2017 -0800
Committer: Arina Ielchiieva <arina.yelchiyeva@gmail.com>
Committed: Mon Nov 13 11:45:20 2017 +0200

----------------------------------------------------------------------
 .../src/main/resources/rest/metrics/metrics.ftl | 34 +++++++++++---------
 1 file changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/ed6c4bc8/exec/java-exec/src/main/resources/rest/metrics/metrics.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/metrics/metrics.ftl b/exec/java-exec/src/main/resources/rest/metrics/metrics.ftl
index 1600a2d..fbd2f4e 100644
--- a/exec/java-exec/src/main/resources/rest/metrics/metrics.ftl
+++ b/exec/java-exec/src/main/resources/rest/metrics/metrics.ftl
@@ -63,12 +63,6 @@
           <strong>No histograms.</strong>
         </div>
       </div>
-      <h3 id="meters">Meters</h3>
-      <div id="metersVal">
-        <div class="alert alert-info">
-          <strong>No meters.</strong>
-        </div>
-      </div>
       <h3 id="timers">Timers</h3>
       <div id="timersVal">
         <div class="alert alert-info">
@@ -98,6 +92,22 @@
       });
     };
 
+    function createCountersTable(counters) {
+      $("#countersVal").html(function() {
+        var table = "<table class=\"table table-striped\" id=\"countersTable\">";
+        table += "<tbody>";
+        $.each(counters, function(key, value) {
+          table += "<tr>";
+          table += "<td>" + key + "</td>";
+          table += "<td>" + value.count + "</td>";
+          table += "</tr>";
+        });
+        table += "</tbody>";
+        table += "</table>";
+        return table;
+      });
+    };
+
     function updateBars(gauges) {
       $.each(["heap","non-heap","total"], function(i, key) {
         var used    = gauges[key + ".used"].value;
@@ -138,21 +148,13 @@
       });
     };
 
-    function updateOthers(metrics) {
-      $.each(["counters", "meters"], function(i, key) {
-        if(! $.isEmptyObject(metrics[key])) {
-          $("#" + key + "Val").html(JSON.stringify(metrics[key], null, 2));
-        }
-      });
-    };
-
     var update = function() {
       $.get("/status/metrics", function(metrics) {
         updateGauges(metrics.gauges);
         updateBars(metrics.gauges);
         if(! $.isEmptyObject(metrics.timers)) createTable(metrics.timers, "timers");
         if(! $.isEmptyObject(metrics.histograms)) createTable(metrics.histograms, "histograms");
-        updateOthers(metrics);
+        if(! $.isEmptyObject(metrics.counters)) createCountersTable(metrics.counters);
       });
     };
 
@@ -161,4 +163,4 @@
   </script>
 </#macro>
 
-<@page_html/>
\ No newline at end of file
+<@page_html/>


Mime
View raw message