cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [03/11] git commit: Update sstablesPerReadHistogram to use biased sampling patch by jbellis; reviewed by yukim for CASSANDRA-6164
Date Tue, 08 Oct 2013 20:41:49 GMT
Update sstablesPerReadHistogram to use biased sampling
patch by jbellis; reviewed by yukim for CASSANDRA-6164


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

Branch: refs/heads/cassandra-1.2
Commit: 99b40fd005a9250ff8d255cc9c22ff61e4d32587
Parents: 102c3c1
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Oct 8 15:33:11 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Oct 8 15:33:11 2013 -0500

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java    | 14 ++++----------
 .../apache/cassandra/db/ColumnFamilyStoreMBean.java   |  7 ++-----
 .../apache/cassandra/metrics/ColumnFamilyMetrics.java |  6 +++---
 4 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/99b40fd0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index adbae91..c4ee9f4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,7 @@
  * Expose connected thrift + native client counts (CASSANDRA-5084)
  * Optimize auth setup (CASSANDRA-6122)
  * Trace index selection (CASSANDRA-6001)
+ * Update sstablesPerReadHistogram to use biased sampling (CASSANDRA-6164)
 
 
 1.2.10

http://git-wip-us.apache.org/repos/asf/cassandra/blob/99b40fd0/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 6dd6e77..a7e8605 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1911,20 +1911,14 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return getMinimumCompactionThreshold() <= 0 || getMaximumCompactionThreshold()
<= 0;
     }
 
-    public long getTombstonesPerLastRead()
+    public double getTombstonesPerSlice()
     {
-        return metric.tombstoneScannedHistogram.count();
+        return metric.tombstoneScannedHistogram.getSnapshot().getMedian();
     }
 
-    public float getPercentageTombstonesPerLastRead()
+    public double getLiveCellsPerSlice()
     {
-        long total = metric.tombstoneScannedHistogram.count() + metric.liveScannedHistogram.count();
-        return ((float) metric.tombstoneScannedHistogram.count() / total);
-    }
-
-    public long getLiveCellsPerLastRead()
-    {
-        return metric.liveScannedHistogram.count();
+        return metric.liveScannedHistogram.getSnapshot().getMedian();
     }
 
     // End JMX get/set.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/99b40fd0/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
index f937032..ef58c86 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
@@ -287,13 +287,10 @@ public interface ColumnFamilyStoreMBean
     public void disableAutoCompaction();
 
     /** Number of tombstoned cells retreived during the last slicequery */
-    public long getTombstonesPerLastRead();
-
-    /** Percentage of tombstoned cells retreived during the last slicequery */
-    public float getPercentageTombstonesPerLastRead();
+    public double getTombstonesPerSlice();
 
     /** Number of live cells retreived during the last slicequery */
-    public long getLiveCellsPerLastRead();
+    public double getLiveCellsPerSlice();
 
     public long estimateKeys();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/99b40fd0/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 9bd90a9..cb13c22 100644
--- a/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
@@ -142,7 +142,7 @@ public class ColumnFamilyMetrics
                 return histogram;
             }
         });
-        sstablesPerReadHistogram = Metrics.newHistogram(factory.createMetricName("SSTablesPerReadHistogram"));
+        sstablesPerReadHistogram = Metrics.newHistogram(factory.createMetricName("SSTablesPerReadHistogram"),
true);
         compressionRatio = Metrics.newGauge(factory.createMetricName("CompressionRatio"),
new Gauge<Double>()
         {
             public Double value()
@@ -299,8 +299,8 @@ public class ColumnFamilyMetrics
                 return Math.max(requests, 1); // to avoid NaN.
             }
         });
-        tombstoneScannedHistogram = Metrics.newHistogram(factory.createMetricName("TombstoneScannedHistogram"));
-        liveScannedHistogram = Metrics.newHistogram(factory.createMetricName("LiveScannedHistogram"));
+        tombstoneScannedHistogram = Metrics.newHistogram(factory.createMetricName("TombstoneScannedHistogram"),
true);
+        liveScannedHistogram = Metrics.newHistogram(factory.createMetricName("LiveScannedHistogram"),
true);
     }
 
     public void updateSSTableIterated(int count)


Mime
View raw message