cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [2/2] cassandra git commit: Merge branch 'cassandra-2.1' into trunk
Date Sat, 24 Jan 2015 02:06:50 GMT
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: 7b533d0677fcbd93b45ae442e60ab9a302f57d3d
Parents: feda54f 1bb0c14
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri Jan 23 21:04:59 2015 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri Jan 23 21:04:59 2015 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/tools/NodeTool.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7b533d06/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/tools/NodeTool.java
index b67dff9,674b346..18feac7
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@@ -1024,68 -1014,23 +1024,68 @@@ public class NodeToo
              String keyspace = args.get(0);
              String cfname = args.get(1);
  
 -            ColumnFamilyStoreMBean store = probe.getCfsProxy(keyspace, cfname);
 +            // calculate percentile of row size and column count
 +            long[] estimatedRowSize = (long[]) probe.getColumnFamilyMetric(keyspace, cfname,
"EstimatedRowSizeHistogram");
 +            long[] estimatedColumnCount = (long[]) probe.getColumnFamilyMetric(keyspace,
cfname, "EstimatedColumnCountHistogram");
  
 -            long[] estimatedRowSizeHistogram = store.getEstimatedRowSizeHistogram();
 -            long[] estimatedColumnCountHistogram = store.getEstimatedColumnCountHistogram();
 +            // build arrays to store percentile values
 +            double[] estimatedRowSizePercentiles = new double[7];
 +            double[] estimatedColumnCountPercentiles = new double[7];
 +            double[] offsetPercentiles = new double[]{0.5, 0.75, 0.95, 0.98, 0.99};
  
-             if (isEmpty(estimatedRowSize) || isEmpty(estimatedColumnCount))
 -            if (ArrayUtils.isEmpty(estimatedRowSizeHistogram) || ArrayUtils.isEmpty(estimatedColumnCountHistogram))
++            if (ArrayUtils.isEmpty(estimatedRowSize) || ArrayUtils.isEmpty(estimatedColumnCount))
              {
                  System.err.println("No SSTables exists, unable to calculate 'Partition Size'
and 'Cell Count' percentiles");
 +
 +                for (int i = 0; i < 7; i++)
 +                {
 +                    estimatedRowSizePercentiles[i] = Double.NaN;
 +                    estimatedColumnCountPercentiles[i] = Double.NaN;
 +                }
 +            }
 +            else
 +            {
 +                long[] rowSizeBucketOffsets = new EstimatedHistogram(estimatedRowSize.length).getBucketOffsets();
 +                long[] columnCountBucketOffsets = new EstimatedHistogram(estimatedColumnCount.length).getBucketOffsets();
 +                EstimatedHistogram rowSizeHist = new EstimatedHistogram(rowSizeBucketOffsets,
estimatedRowSize);
 +                EstimatedHistogram columnCountHist = new EstimatedHistogram(columnCountBucketOffsets,
estimatedColumnCount);
 +
 +                if (rowSizeHist.isOverflowed())
 +                {
 +                    System.err.println(String.format("Row sizes are larger than %s, unable
to calculate percentiles", rowSizeBucketOffsets[rowSizeBucketOffsets.length - 1]));
 +                    for (int i = 0; i < offsetPercentiles.length; i++)
 +                            estimatedRowSizePercentiles[i] = Double.NaN;
 +                }
 +                else
 +                {
 +                    for (int i = 0; i < offsetPercentiles.length; i++)
 +                        estimatedRowSizePercentiles[i] = rowSizeHist.percentile(offsetPercentiles[i]);
 +                }
 +
 +                if (columnCountHist.isOverflowed())
 +                {
 +                    System.err.println(String.format("Column counts are larger than %s,
unable to calculate percentiles", columnCountBucketOffsets[columnCountBucketOffsets.length
- 1]));
 +                    for (int i = 0; i < estimatedColumnCountPercentiles.length; i++)
 +                        estimatedColumnCountPercentiles[i] = Double.NaN;
 +                }
 +                else
 +                {
 +                    for (int i = 0; i < offsetPercentiles.length; i++)
 +                        estimatedColumnCountPercentiles[i] = columnCountHist.percentile(offsetPercentiles[i]);
 +                }
 +
 +                // min value
 +                estimatedRowSizePercentiles[5] = rowSizeHist.min();
 +                estimatedColumnCountPercentiles[5] = columnCountHist.min();
 +                // max value
 +                estimatedRowSizePercentiles[6] = rowSizeHist.max();
 +                estimatedColumnCountPercentiles[6] = columnCountHist.max();
              }
  
 -            // calculate percentile of row size and column count
              String[] percentiles = new String[]{"50%", "75%", "95%", "98%", "99%", "Min",
"Max"};
 -            double[] readLatency = probe.metricPercentilesAsArray(store.getRecentReadLatencyHistogramMicros());
 -            double[] writeLatency = probe.metricPercentilesAsArray(store.getRecentWriteLatencyHistogramMicros());
 -            double[] estimatedRowSizePercentiles = probe.metricPercentilesAsArray(estimatedRowSizeHistogram);
 -            double[] estimatedColumnCountPercentiles = probe.metricPercentilesAsArray(estimatedColumnCountHistogram);
 -            double[] sstablesPerRead = probe.metricPercentilesAsArray(store.getRecentSSTablesPerReadHistogram());
 +            double[] readLatency = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean)
probe.getColumnFamilyMetric(keyspace, cfname, "ReadLatency"));
 +            double[] writeLatency = probe.metricPercentilesAsArray((JmxReporter.TimerMBean)
probe.getColumnFamilyMetric(keyspace, cfname, "WriteLatency"));
 +            double[] sstablesPerRead = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean)
probe.getColumnFamilyMetric(keyspace, cfname, "SSTablesPerReadHistogram"));
  
              System.out.println(format("%s/%s histograms", keyspace, cfname));
              System.out.println(format("%-10s%10s%18s%18s%18s%18s",


Mime
View raw message