You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2014/06/13 14:53:53 UTC

[04/20] git commit: Track metrics at a keyspace level

Track metrics at a keyspace level

Patch by brandonwilliams, reviewed by yukim for CASSANDRA-6539


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

Branch: refs/heads/cassandra-2.1
Commit: f1aa49b9f80f532307195932e6bf34f4705e6ccb
Parents: b93f287
Author: Brandon Williams <br...@apache.org>
Authored: Thu Jun 12 18:42:21 2014 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri Jun 13 07:46:20 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                    | 1 +
 src/java/org/apache/cassandra/db/Keyspace.java | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1aa49b9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a2a978e..db94066 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * Reference sstables before populating key cache (CASSANDRA-7234)
 Merged from 1.2:
 1.2.17
+ * Track metrics at a keyspace level (CASSANDRA-6539)
  * Add replace_address_first_boot flag to only replace if not bootstrapped (CASSANDRA-7356)
  * Enable keepalive for native protocol (CASSANDRA-7380)
  * Check internal addresses for seeds (CASSANDRA-6523)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f1aa49b9/src/java/org/apache/cassandra/db/Keyspace.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Keyspace.java b/src/java/org/apache/cassandra/db/Keyspace.java
index 714956a..9651794 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -43,6 +43,7 @@ import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.service.pager.QueryPagers;
 import org.apache.cassandra.tracing.Tracing;
+import org.apache.cassandra.metrics.KeyspaceMetrics;
 
 /**
  * It represents a Keyspace.
@@ -76,6 +77,7 @@ public class Keyspace
     private final ConcurrentMap<UUID, ColumnFamilyStore> columnFamilyStores = new ConcurrentHashMap<UUID, ColumnFamilyStore>();
     private volatile AbstractReplicationStrategy replicationStrategy;
     public static final Function<String,Keyspace> keyspaceTransformer = new Function<String, Keyspace>()
+    public final KeyspaceMetrics metric;
     {
         public Keyspace apply(String keyspaceName)
         {
@@ -133,6 +135,7 @@ public class Keyspace
             {
                 for (ColumnFamilyStore cfs : t.getColumnFamilyStores())
                     t.unloadCf(cfs);
+                t.metric.release();
             }
             return t;
         }
@@ -265,6 +268,7 @@ public class Keyspace
             logger.debug("Initializing {}.{}", getName(), cfm.cfName);
             initCf(cfm.cfId, cfm.cfName, loadSSTables);
         }
+        this.metric = new KeyspaceMetrics(this);
     }
 
     public void createReplicationStrategy(KSMetaData ksm)