cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject git commit: Fix cfstats not handling index CF
Date Tue, 26 Nov 2013 21:40:59 GMT
Updated Branches:
  refs/heads/trunk c1d7291c8 -> 41325c346


Fix cfstats not handling index CF

patch by Mikhail Stepura; reviewed by yukim for CASSANDRA-6406


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

Branch: refs/heads/trunk
Commit: 41325c346ab644dd5760a88ce78aadef583d062e
Parents: c1d7291
Author: Mikhail Stepura <mikhail.stepura@outlook.com>
Authored: Tue Nov 26 15:23:45 2013 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Tue Nov 26 15:36:48 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                       |  2 +-
 .../org/apache/cassandra/tools/NodeProbe.java     | 18 ++++++------------
 2 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/41325c34/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 00797e6..70e6f2e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,7 +11,7 @@
  * Remove CFDefinition (CASSANDRA-6253)
  * Use AtomicIntegerFieldUpdater in RefCountedMemory (CASSANDRA-6278)
  * User-defined types for CQL3 (CASSANDRA-5590)
- * Use of o.a.c.metrics in nodetool (CASSANDRA-5871)
+ * Use of o.a.c.metrics in nodetool (CASSANDRA-5871, 6406)
  * Batch read from OTC's queue and cleanup (CASSANDRA-1632)
 
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/41325c34/src/java/org/apache/cassandra/tools/NodeProbe.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 2489de6..b755ff3 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -917,6 +917,8 @@ public class NodeProbe
     {
         try
         {
+            String type = cf.contains(".") ? "IndexColumnFamily": "ColumnFamily";
+            ObjectName oName = new ObjectName(String.format("org.apache.cassandra.metrics:type=%s,keyspace=%s,scope=%s,name=%s",
type, ks, cf, metricName));
             switch(metricName)
             {
                 case "BloomFilterDiskSpaceUsed":
@@ -936,31 +938,23 @@ public class NodeProbe
                 case "RecentBloomFilterFalsePositives":
                 case "RecentBloomFilterFalseRatio":
                 case "SnapshotsSize":
-                    return JMX.newMBeanProxy(mbeanServerConn,
-                            new ObjectName("org.apache.cassandra.metrics:type=ColumnFamily,keyspace="
+ ks + ",scope=" + cf + ",name=" + metricName),
-                            JmxReporter.GaugeMBean.class).getValue();
+                    return JMX.newMBeanProxy(mbeanServerConn, oName, JmxReporter.GaugeMBean.class).getValue();
                 case "LiveDiskSpaceUsed":
                 case "MemtableSwitchCount":
                 case "SpeculativeRetries":
                 case "TotalDiskSpaceUsed":
                 case "WriteTotalLatency":
                 case "ReadTotalLatency":
-                    return JMX.newMBeanProxy(mbeanServerConn,
-                            new ObjectName("org.apache.cassandra.metrics:type=ColumnFamily,keyspace="
+ ks + ",scope=" + cf + ",name=" + metricName),
-                            JmxReporter.CounterMBean.class).getCount();
+                    return JMX.newMBeanProxy(mbeanServerConn, oName, JmxReporter.CounterMBean.class).getCount();
                 case "ReadLatency":
                 case "CoordinatorReadLatency":
                 case "CoordinatorScanLatency":
                 case "WriteLatency":
-                    return JMX.newMBeanProxy(mbeanServerConn,
-                            new ObjectName("org.apache.cassandra.metrics:type=ColumnFamily,keyspace="
+ ks + ",scope=" + cf + ",name=" + metricName),
-                            JmxReporter.TimerMBean.class);
+                    return JMX.newMBeanProxy(mbeanServerConn, oName, JmxReporter.TimerMBean.class);
                 case "LiveScannedHistogram":
                 case "SSTablesPerReadHistogram":
                 case "TombstoneScannedHistogram":
-                    return JMX.newMBeanProxy(mbeanServerConn,
-                            new ObjectName("org.apache.cassandra.metrics:type=ColumnFamily,keyspace="
+ ks + ",scope=" + cf + ",name=" + metricName),
-                            JmxReporter.HistogramMBean.class);
+                    return JMX.newMBeanProxy(mbeanServerConn, oName, JmxReporter.HistogramMBean.class);
                 default:
                     throw new RuntimeException("Unknown column family metric.");
             }


Mime
View raw message