cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] git commit: Add per-CF range read request latency metrics
Date Wed, 04 Jun 2014 15:03:05 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 1def02f19 -> f81d5ddc6


Add per-CF range read request latency metrics

patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-7338


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

Branch: refs/heads/trunk
Commit: 05ffa8ff1eeaa8f911798c1dca14de6117b27347
Parents: 500e7b7
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Wed Jun 4 17:56:50 2014 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Jun 4 17:56:50 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java   | 10 +++++++++-
 .../org/apache/cassandra/metrics/ColumnFamilyMetrics.java |  4 ++++
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/05ffa8ff/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 18579a1..0d716a6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.9
+ * Add per-CF range read request latency metrics (CASSANDRA-7338)
  * Fix NPE in StreamTransferTask.createMessageForRetry() (CASSANDRA-7323)
  * Add conditional CREATE/DROP USER support (CASSANDRA-7264)
  * Swap local and global default read repair chances (CASSANDRA-7320)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/05ffa8ff/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 709935a..c641f3a 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1703,7 +1703,15 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public List<Row> getRangeSlice(ExtendedFilter filter)
     {
-        return filter(getSequentialIterator(filter.dataRange, filter.timestamp), filter);
+        long start = System.nanoTime();
+        try
+        {
+            return filter(getSequentialIterator(filter.dataRange, filter.timestamp), filter);
+        }
+        finally
+        {
+            metric.rangeLatency.addNano(System.nanoTime() - start);
+        }
     }
 
     @VisibleForTesting

http://git-wip-us.apache.org/repos/asf/cassandra/blob/05ffa8ff/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
index 8880485..50c80fc 100644
--- a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
@@ -52,6 +52,8 @@ public class ColumnFamilyMetrics
     public final Histogram sstablesPerReadHistogram;
     /** (Local) read metrics */
     public final LatencyMetrics readLatency;
+    /** (Local) range slice metrics */
+    public final LatencyMetrics rangeLatency;
     /** (Local) write metrics */
     public final LatencyMetrics writeLatency;
     /** Estimated number of tasks pending for this column family */
@@ -177,6 +179,7 @@ public class ColumnFamilyMetrics
         });
         readLatency = new LatencyMetrics(factory, "Read");
         writeLatency = new LatencyMetrics(factory, "Write");
+        rangeLatency = new LatencyMetrics(factory, "Range");
         pendingCompactions = Metrics.newGauge(factory.createMetricName("PendingCompactions"),
new Gauge<Integer>()
         {
             public Integer value()
@@ -343,6 +346,7 @@ public class ColumnFamilyMetrics
     {
         readLatency.release();
         writeLatency.release();
+        rangeLatency.release();
         Metrics.defaultRegistry().removeMetric(factory.createMetricName("AllMemtablesDataSize"));
         Metrics.defaultRegistry().removeMetric(factory.createMetricName("MemtableColumnsCount"));
         Metrics.defaultRegistry().removeMetric(factory.createMetricName("MemtableDataSize"));


Mime
View raw message