You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by db...@apache.org on 2013/08/14 02:45:38 UTC

git commit: add jmx listener to publish metrics for cassandra-5838

Updated Branches:
  refs/heads/trunk feacf6037 -> c651f8362


add jmx listener to publish metrics for cassandra-5838


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

Branch: refs/heads/trunk
Commit: c651f83627b4bc491e2ebe6c8f29c311d40ed2a6
Parents: feacf60
Author: Dave Brosius <db...@apache.org>
Authored: Tue Aug 13 20:44:45 2013 -0400
Committer: Dave Brosius <db...@apache.org>
Committed: Tue Aug 13 20:44:45 2013 -0400

----------------------------------------------------------------------
 .../org/apache/cassandra/metrics/CassandraMetricRegistry.java  | 6 ++++++
 test/unit/org/apache/cassandra/db/RowIterationTest.java        | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c651f836/src/java/org/apache/cassandra/metrics/CassandraMetricRegistry.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/CassandraMetricRegistry.java b/src/java/org/apache/cassandra/metrics/CassandraMetricRegistry.java
index 2f2a855..c69e8af 100644
--- a/src/java/org/apache/cassandra/metrics/CassandraMetricRegistry.java
+++ b/src/java/org/apache/cassandra/metrics/CassandraMetricRegistry.java
@@ -17,12 +17,18 @@
  */
 package org.apache.cassandra.metrics;
 
+import com.codahale.metrics.JmxReporter;
 import com.codahale.metrics.Metric;
 import com.codahale.metrics.MetricRegistry;
 
 public class CassandraMetricRegistry 
 {
     private static MetricRegistry defaultRegistry = new MetricRegistry();
+    static
+    {
+        JmxReporter reporter = JmxReporter.forRegistry(defaultRegistry).build();
+        reporter.start();
+    }
     
     private CassandraMetricRegistry()
     {  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c651f836/test/unit/org/apache/cassandra/db/RowIterationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/RowIterationTest.java b/test/unit/org/apache/cassandra/db/RowIterationTest.java
index c083b19..084be2d 100644
--- a/test/unit/org/apache/cassandra/db/RowIterationTest.java
+++ b/test/unit/org/apache/cassandra/db/RowIterationTest.java
@@ -85,7 +85,7 @@ public class RowIterationTest extends SchemaLoader
         rm.apply();
         store.forceBlockingFlush();
 
-        ColumnFamily cf = Util.getRangeSlice(store).iterator().next().cf;
+        ColumnFamily cf = Util.getRangeSlice(store).get(0).cf;
         assert cf.deletionInfo().equals(delInfo2);
     }