jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1643716 - in /jmeter/trunk: src/components/org/apache/jmeter/visualizers/backend/UserMetric.java src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java xdocs/changes.xml
Date Sun, 07 Dec 2014 20:38:33 GMT
Author: pmouawad
Date: Sun Dec  7 20:38:33 2014
New Revision: 1643716

URL: http://svn.apache.org/r1643716
Log:
Bug 57321 - BackendListener reports wrong number of Active Users in master-slave configuration
(nightly build r1642603)
Bugzilla Id: 57321

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/UserMetric.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/UserMetric.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/UserMetric.java?rev=1643716&r1=1643715&r2=1643716&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/UserMetric.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/UserMetric.java Sun
Dec  7 20:38:33 2014
@@ -20,6 +20,7 @@ package org.apache.jmeter.visualizers.ba
 
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
 import org.apache.jmeter.samplers.SampleResult;
+import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.util.JMeterUtils;
 
 /**
@@ -42,7 +43,7 @@ public class UserMetric {
      * @param result {@link SampleResult} to be used
      */
     public synchronized void add(SampleResult result) {
-        usersStats.addValue(result.getAllThreads());
+        usersStats.addValue(JMeterContextService.getThreadCounts().activeThreads);
     }
     
     /**
@@ -75,4 +76,18 @@ public class UserMetric {
     public int getMinActiveThreads() {
         return (int) usersStats.getMax();
     }
+
+    /**
+     * @return finished threads
+     */
+    public int getFinishedThreads() {
+        return JMeterContextService.getThreadCounts().finishedThreads;
+    }
+
+    /**
+     * @return started threads
+     */
+    public int getStartedThreads() {
+        return JMeterContextService.getThreadCounts().startedThreads;
+    }
 }

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java?rev=1643716&r1=1643715&r2=1643716&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
(original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
Sun Dec  7 20:38:33 2014
@@ -31,8 +31,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.samplers.SampleResult;
-import org.apache.jmeter.threads.JMeterContextService;
-import org.apache.jmeter.threads.JMeterContextService.ThreadCounts;
 import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient;
 import org.apache.jmeter.visualizers.backend.BackendListenerContext;
 import org.apache.jmeter.visualizers.backend.SamplerMetric;
@@ -99,12 +97,11 @@ public class GraphiteBackendListenerClie
             metric.resetForTimeInterval();
         }
         
-        ThreadCounts tc = JMeterContextService.getThreadCounts();
         pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_MIN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMaxActiveThreads()));
         pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_MAX_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMinActiveThreads()));
         pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_MEAN_ACTIVE_THREADS,
Integer.toString(getUserMetrics().getMeanActiveThreads()));
-        pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_STARTED_THREADS,
Integer.toString(tc.startedThreads));
-        pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_STOPPED_THREADS,
Integer.toString(tc.finishedThreads));
+        pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_STARTED_THREADS,
Integer.toString(getUserMetrics().getStartedThreads()));
+        pickleMetricsManager.addMetric(timestamp, CUMULATED_CONTEXT_NAME, METRIC_STOPPED_THREADS,
Integer.toString(getUserMetrics().getFinishedThreads()));
 
         pickleMetricsManager.writeAndSendMetrics();
     }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1643716&r1=1643715&r2=1643716&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Dec  7 20:38:33 2014
@@ -153,6 +153,7 @@ See  <bugzilla>56357</bugzilla> for deta
 <h3>Listeners</h3>
 <ul>
 <li><bug>57262</bug>Aggregate Report, Aggregate Graph and Summary Report
export : headers use keys instead of labels</li>
+<li><bug>57321</bug>BackendListener reports wrong number of Active Users
in master-slave configuration (nightly build r1642603)</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>



Mime
View raw message