You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2014/09/15 17:57:17 UTC

[2/3] git commit: ninja-fix cassandra-stress totalGcStats metric

ninja-fix cassandra-stress totalGcStats metric


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

Branch: refs/heads/trunk
Commit: 6bff5a3318c46d09f1338665d0d0251bf5bda3a1
Parents: 1d7691e
Author: Benedict Elliott Smith <be...@apache.org>
Authored: Mon Sep 15 16:56:45 2014 +0100
Committer: Benedict Elliott Smith <be...@apache.org>
Committed: Mon Sep 15 16:56:45 2014 +0100

----------------------------------------------------------------------
 tools/stress/src/org/apache/cassandra/stress/StressMetrics.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6bff5a33/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java b/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
index 9e8e961..6d5f387 100644
--- a/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
+++ b/tools/stress/src/org/apache/cassandra/stress/StressMetrics.java
@@ -22,6 +22,7 @@ package org.apache.cassandra.stress;
 
 
 import java.io.PrintStream;
+import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
@@ -56,16 +57,15 @@ public class StressMetrics
     {
         this.output = output;
         Callable<JmxCollector.GcStats> gcStatsCollector;
+        totalGcStats = new JmxCollector.GcStats(0);
         try
         {
             gcStatsCollector = new JmxCollector(settings.node.nodes, settings.port.jmxPort);
-            totalGcStats = new JmxCollector.GcStats(0);
         }
         catch (Throwable t)
         {
             t.printStackTrace();
             System.err.println("Failed to connect over JMX; not collecting these stats");
-            totalGcStats = new JmxCollector.GcStats(Double.POSITIVE_INFINITY);
             gcStatsCollector = new Callable<JmxCollector.GcStats>()
             {
                 public JmxCollector.GcStats call() throws Exception
@@ -149,6 +149,7 @@ public class StressMetrics
     private void update() throws InterruptedException
     {
         Timing.TimingResult<JmxCollector.GcStats> result = timing.snap(gcStatsCollector);
+        totalGcStats = JmxCollector.GcStats.aggregate(Arrays.asList(totalGcStats, result.extra));
         if (result.timing.partitionCount != 0)
             printRow("", result.timing, timing.getHistory(), result.extra, rowRateUncertainty, output);
         rowRateUncertainty.update(result.timing.adjustedRowRate());