You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2010/11/01 17:55:55 UTC

svn commit: r1029746 - in /jakarta/jmeter/trunk: src/core/org/apache/jmeter/control/TransactionController.java src/core/org/apache/jmeter/samplers/SampleEvent.java xdocs/changes.xml

Author: sebb
Date: Mon Nov  1 16:55:54 2010
New Revision: 1029746

URL: http://svn.apache.org/viewvc?rev=1029746&view=rev
Log:
Bug 50134 - TransactionController : Reports bad response time when it contains other TransactionControllers

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java?rev=1029746&r1=1029745&r2=1029746&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java Mon Nov  1 16:55:54 2010
@@ -188,7 +188,7 @@ public class TransactionController exten
                 if (pack == null) {
                     log.warn("Could not fetch SamplePackage");
                 } else {
-                    SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(),threadVars);
+                    SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(),threadVars, true);
                     // We must set res to null now, before sending the event for the transaction,
                     // so that we can ignore that event in our sampleOccured method
                     res = null;
@@ -207,8 +207,8 @@ public class TransactionController exten
     public void sampleOccurred(SampleEvent se) {
         if (!isParent()) {
             // Check if we are still sampling our children
-            if(res != null) {
-                SampleResult sampleResult = se.getResult();
+            if(res != null && !se.isTransactionSampleEvent()) {
+               	SampleResult sampleResult = se.getResult();
                 res.setThreadName(sampleResult.getThreadName());
                 res.setBytes(res.getBytes() + sampleResult.getBytes());
                 if (!isIncludeTimers()) {// Accumulate waiting time for later

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java?rev=1029746&r1=1029745&r2=1029746&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java Mon Nov  1 16:55:54 2010
@@ -73,6 +73,7 @@ public class SampleEvent implements Seri
 
     private final String hostname;
 
+    private final boolean isTransactionSampleEvent;
 
     /*
      * Only for Unit tests
@@ -90,10 +91,7 @@ public class SampleEvent implements Seri
      * @param threadGroup name
      */
     public SampleEvent(SampleResult result, String threadGroup) {
-        this.result = result;
-        this.threadGroup = threadGroup;
-        this.hostname = HOSTNAME;
-        values = new String[variableNames.length];
+        this(result, threadGroup, HOSTNAME, false);
     }
 
     /**
@@ -104,11 +102,7 @@ public class SampleEvent implements Seri
      * @param jmvars Jmeter variables
      */
     public SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars) {
-        this.result = result;
-        this.threadGroup = threadGroup;
-        this.hostname = HOSTNAME;
-        values = new String[variableNames.length];
-        saveVars(jmvars);
+        this(result, threadGroup, jmvars, false);
     }
 
     /**
@@ -119,10 +113,26 @@ public class SampleEvent implements Seri
      * @param hostname
      */
     public SampleEvent(SampleResult result, String threadGroup, String hostname) {
+       this(result, threadGroup, hostname, false);
+    }
+    
+    private SampleEvent(SampleResult result, String threadGroup, String hostname, boolean isTransactionSampleEvent) {
         this.result = result;
         this.threadGroup = threadGroup;
         this.hostname = hostname;
         values = new String[variableNames.length];
+        this.isTransactionSampleEvent = isTransactionSampleEvent;
+    }
+
+    /**
+     * @param result
+     * @param threadGroup
+     * @param jmvars
+     * @param isTransactionSampleEvent
+     */
+    public SampleEvent(SampleResult result, String threadGroup, JMeterVariables jmvars, boolean isTransactionSampleEvent) {
+        this(result, threadGroup, HOSTNAME, isTransactionSampleEvent);
+        saveVars(jmvars);
     }
 
     private void saveVars(JMeterVariables vars){
@@ -161,4 +171,12 @@ public class SampleEvent implements Seri
     public String getHostname() {
         return hostname;
     }
+
+    /**
+     * @return the isTransactionSampleEvent
+     */
+    public boolean isTransactionSampleEvent() {
+        return isTransactionSampleEvent;
+    }
+
 }

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1029746&r1=1029745&r2=1029746&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Mon Nov  1 16:55:54 2010
@@ -80,6 +80,7 @@ To override the default local language f
 <ul>
 <li>Bug 50032 - Last_Sample_Ok along with other controllers doesnt work correctly when the threadgroup has multiple loops</li>
 <li>Bug 50080 - Transaction controller incorrectly creates samples including timer duration</li>
+<li>Bug 50134 - TransactionController : Reports bad response time when it contains other TransactionControllers</li>
 </ul>
 
 <h3>Listeners</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org