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 45C1C200BF9 for ; Sun, 8 Jan 2017 11:54:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 44489160B36; Sun, 8 Jan 2017 10:54:00 +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 8E078160B2C for ; Sun, 8 Jan 2017 11:53:59 +0100 (CET) Received: (qmail 52410 invoked by uid 500); 8 Jan 2017 10:53:58 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 52395 invoked by uid 99); 8 Jan 2017 10:53:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jan 2017 10:53:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7FBA72C1F56 for ; Sun, 8 Jan 2017 10:53:58 +0000 (UTC) Date: Sun, 8 Jan 2017 10:53:58 +0000 (UTC) From: "Alain Rastoul (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-13103) incorrect jvm metric names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 08 Jan 2017 10:54:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15809186#comment-15809186 ] Alain Rastoul commented on CASSANDRA-13103: ------------------------------------------- The problem has been introduced in 3.9, CASSANDRA-12312 : Add JVM metrics for custom metrics reporter, 2016-07-26. It should be present in cassandra-2.2, cassandra-3.0, cassandra-3.11, cassandra-3.X, trunk I have attached a patch for 3.9 (and 3.X) which removes the unnecessary '.' and added a unit test for jvm metrics registration. I followed the 'How to contribute' wiki notes but was unable to assign myself the issue. May be an ASF member can tell me what to do or add me as assignable, in case I could work on other LHF? TIA > incorrect jvm metric names > -------------------------- > > Key: CASSANDRA-13103 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13103 > Project: Cassandra > Issue Type: Bug > Components: Observability > Reporter: Alain Rastoul > Priority: Minor > Labels: lhf > Attachments: Fix-incorrect-jvm-metric-names-CASSANDRA-13103.patch > > > Some jvm metrics have a double dot in name like: > jvm.memory..total.max , jvm.memory..total.init (etc). > it seems that an extra dot is added at the end of the name in CassandraDaemon.java, around line 367 (in 3.0.10): > ... > // enable metrics provided by metrics-jvm.jar > CassandraMetricsRegistry.Metrics.register("jvm.buffers.", new BufferPoolMetricSet(ManagementFactory.getPlatformMBeanServer())); > CassandraMetricsRegistry.Metrics.register("jvm.gc.", new GarbageCollectorMetricSet()); > CassandraMetricsRegistry.Metrics.register("jvm.memory.", new MemoryUsageGaugeSet()); > and also added in append method of MetricRegistry. > Call stack is: > MetricRegistry>>registerAll(String prefix, MetricSet metrics) > MetricRegistry>>static String name(String name, String... names) > MetricRegistry>>static void append(StringBuilder builder, String part) > and in append the dot is also added: > ... > if(builder.length() > 0) { > builder.append('.'); > } > builder.append(part); > ... > The codahale MetricRegistry class seems to have no recent modification of name or append methods, so it look like a small bug. > May be the fix could be to simply not to add the final dot in the metric name, ie "jvm.buffers" instead of "jvm.buffers." -- This message was sent by Atlassian JIRA (v6.3.4#6332)