Updated Branches: refs/heads/cassandra-1.2 aaf18bd08 -> 843dc796e refs/heads/trunk bef5209d6 -> e5dd390b9
Add get commands for compaction/streaming throughput to nodetool. Patch by Michal Michalski, reviewed by brandonwilliams for CASSANDRA-5588 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/843dc796 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/843dc796 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/843dc796 Branch: refs/heads/cassandra-1.2 Commit: 843dc796ea5e80b003f6429a329ec04a9f1bfff4 Parents: aaf18bd Author: Brandon Williams <brandonwilli...@apache.org> Authored: Tue May 28 13:51:47 2013 -0500 Committer: Brandon Williams <brandonwilli...@apache.org> Committed: Tue May 28 13:51:47 2013 -0500 ---------------------------------------------------------------------- src/java/org/apache/cassandra/tools/NodeCmd.java | 40 ++++++++++++++- src/java/org/apache/cassandra/tools/NodeProbe.java | 18 ++----- .../org/apache/cassandra/tools/NodeToolHelp.yaml | 6 ++ 3 files changed, 50 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/843dc796/src/java/org/apache/cassandra/tools/NodeCmd.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/tools/NodeCmd.java b/src/java/org/apache/cassandra/tools/NodeCmd.java index dce9dba..bca0fcd 100644 --- a/src/java/org/apache/cassandra/tools/NodeCmd.java +++ b/src/java/org/apache/cassandra/tools/NodeCmd.java @@ -118,6 +118,8 @@ public class NodeCmd ENABLETHRIFT, FLUSH, GETCOMPACTIONTHRESHOLD, + GETCOMPACTIONTHROUGHPUT, + GETSTREAMTHROUGHPUT, GETENDPOINTS, GETSSTABLES, GOSSIPINFO, @@ -721,6 +723,39 @@ public class NodeCmd outs.printf("%25s%10s%n", "Active compaction remaining time : ", remainingTime); } + /** + * Print the compaction threshold + * + * @param outs the stream to write to + */ + public void printCompactionThreshold(PrintStream outs, String ks, String cf) + { + ColumnFamilyStoreMBean cfsProxy = probe.getCfsProxy(ks, cf); + outs.println("Current compaction thresholds for " + ks + "/" + cf + ": \n" + + " min = " + cfsProxy.getMinimumCompactionThreshold() + ", " + + " max = " + cfsProxy.getMaximumCompactionThreshold()); + } + + /** + * Print the compaction throughput + * + * @param outs the stream to write to + */ + public void printCompactionThroughput(PrintStream outs) + { + outs.println("Current compaction throughput: " + probe.getCompactionThroughput() + " MB/s"); + } + + /** + * Print the stream throughput + * + * @param outs the stream to write to + */ + public void printStreamThroughput(PrintStream outs) + { + outs.println("Current stream throughput: " + probe.getStreamThroughput() + " MB/s"); + } + public void printColumnFamilyStats(PrintStream outs) { Map <String, List <ColumnFamilyStoreMBean>> cfstoreMap = new HashMap <String, List <ColumnFamilyStoreMBean>>(); @@ -1178,9 +1213,12 @@ public class NodeCmd case GETCOMPACTIONTHRESHOLD : if (arguments.length != 2) { badUse("getcompactionthreshold requires ks and cf args."); } - probe.getCompactionThreshold(System.out, arguments[0], arguments[1]); + nodeCmd.printCompactionThreshold(System.out, arguments[0], arguments[1]); break; + case GETCOMPACTIONTHROUGHPUT : nodeCmd.printCompactionThroughput(System.out); break; + case GETSTREAMTHROUGHPUT : nodeCmd.printStreamThroughput(System.out); break; + case CFHISTOGRAMS : if (arguments.length != 2) { badUse("cfhistograms requires ks and cf args"); } nodeCmd.printCfHistograms(arguments[0], arguments[1], System.out); http://git-wip-us.apache.org/repos/asf/cassandra/blob/843dc796/src/java/org/apache/cassandra/tools/NodeProbe.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java index b2b9cf8..5db8f1c 100644 --- a/src/java/org/apache/cassandra/tools/NodeProbe.java +++ b/src/java/org/apache/cassandra/tools/NodeProbe.java @@ -496,19 +496,6 @@ public class NodeProbe } /** - * Get the compaction threshold - * - * @param outs the stream to write to - */ - public void getCompactionThreshold(PrintStream outs, String ks, String cf) - { - ColumnFamilyStoreMBean cfsProxy = getCfsProxy(ks, cf); - outs.println("Current compaction thresholds for " + ks + "/" + cf + ": \n" + - " min = " + cfsProxy.getMinimumCompactionThreshold() + ", " + - " max = " + cfsProxy.getMaximumCompactionThreshold()); - } - - /** * Set the compaction threshold * * @param minimumCompactionThreshold minimum compaction threshold @@ -759,6 +746,11 @@ public class NodeProbe return ssProxy.getCompactionThroughputMbPerSec(); } + public int getStreamThroughput() + { + return ssProxy.getStreamThroughputMbPerSec(); + } + public int getExceptionCount() { return ssProxy.getExceptionCount(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/843dc796/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml ---------------------------------------------------------------------- diff --git a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml index f918804..568aa20 100644 --- a/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml +++ b/src/resources/org/apache/cassandra/tools/NodeToolHelp.yaml @@ -161,6 +161,12 @@ commands: - name: getcompactionthreshold <keyspace> <cfname> help: | Print min and max compaction thresholds for a given column family + - name: getcompactionthroughput + help: | + Print the MB/s throughput cap for compaction in the system + - name: getstreamthroughput + help: | + Print the MB/s throughput cap for streaming in the system - name: stop <compaction_type> help: | Supported types are COMPACTION, VALIDATION, CLEANUP, SCRUB, INDEX_BUILD