Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7C1F1200D37 for ; Thu, 9 Nov 2017 09:27:28 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7AC0B160BEF; Thu, 9 Nov 2017 08:27:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E73871609E5 for ; Thu, 9 Nov 2017 09:27:27 +0100 (CET) Received: (qmail 87840 invoked by uid 500); 9 Nov 2017 08:27:27 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 87829 invoked by uid 99); 9 Nov 2017 08:27:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Nov 2017 08:27:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AE6B4DFCF9; Thu, 9 Nov 2017 08:27:26 +0000 (UTC) From: arina-ielchiieva To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #1020: DRILL-5921: Display counter metrics in table Content-Type: text/plain Message-Id: <20171109082726.AE6B4DFCF9@git1-us-west.apache.org> Date: Thu, 9 Nov 2017 08:27:26 +0000 (UTC) archived-at: Thu, 09 Nov 2017 08:27:28 -0000 Github user arina-ielchiieva commented on a diff in the pull request: https://github.com/apache/drill/pull/1020#discussion_r149891566 --- Diff: exec/java-exec/src/main/resources/rest/metrics/metrics.ftl --- @@ -138,21 +154,14 @@ }); }; - 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); + if(! $.isEmptyObject(metrics.meters)) $("#metersVal").html(JSON.stringify(metrics.meters, null, 2)); --- End diff -- @prasadns14 1. Thanks for adding the screenshots. 2. Most of the code in `createTable` and `createCountersTable` coincide. I suggested you make one function. For example, with three parameters, `createTable(metric, name, addReportingClass)`. When you don't need to add reporting class you'll call this method with false. Our goal here is generify existing methods rather then adding new specific with almost the same content. 3. If we don't have any meters, let's remove them. ---