From dev-return-80627-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Thu May 2 10:48:07 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 71C13180671 for ; Thu, 2 May 2019 12:48:07 +0200 (CEST) Received: (qmail 97525 invoked by uid 500); 2 May 2019 10:48:06 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 97514 invoked by uid 99); 2 May 2019 10:48:06 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2019 10:48:06 +0000 From: GitBox To: dev@zookeeper.apache.org Subject: [GitHub] [zookeeper] eolivelli commented on a change in pull request #927: ZOOKEEPER-3091 Prometheus.io integration Message-ID: <155679408134.10134.11455617961234485853.gitbox@gitbox.apache.org> Date: Thu, 02 May 2019 10:48:01 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit eolivelli commented on a change in pull request #927: ZOOKEEPER-3091 Prometheus.io integration URL: https://github.com/apache/zookeeper/pull/927#discussion_r280367616 ########## File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java ########## @@ -1383,4 +1392,85 @@ public void setResponseCachingEnabled(boolean isEnabled) { public ResponseCache getReadResponseCache() { return isResponseCachingEnabled ? readResponseCache : null; } + + protected void registerMetrics() { + MetricsContext rootContext = ServerMetrics + .getMetrics() + .getMetricsProvider() + .getRootContext(); + + final ZKDatabase zkdb = this.getZKDatabase(); + final ServerStats stats = this.serverStats(); + + rootContext.registerGauge("avg_latency", stats::getAvgLatency); Review comment: I can't break compatibily. We can do this in a separate step ---------------------------------------------------------------- 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: users@infra.apache.org With regards, Apache Git Services