You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/09/15 11:52:24 UTC

svn commit: r1760920 - in /jmeter/trunk: bin/jmeter.properties src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java xdocs/changes.xml

Author: pmouawad
Date: Thu Sep 15 11:52:24 2016
New Revision: 1760920

URL: http://svn.apache.org/viewvc?rev=1760920&view=rev
Log:
Bug 60137 - In Distributed testing when using StrippedXXXX modes strip response also on error
Bugzilla Id: 60137

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1760920&r1=1760919&r2=1760920&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Thu Sep 15 11:52:24 2016
@@ -775,6 +775,12 @@ wmlParser.types=text/vnd.wap.wml
 # - false means server configuration will be used
 #sample_sender_client_configured=true
 
+# By default when Stripping modes are used JMeter since 3.1 will strip 
+# response even for SampleResults in error.
+# If you want to revert to previous behaviour (no stripping of Responses in error) 
+# set this property to false
+#sample_sender_strip_also_on_error=true
+
 # Remote batching support
 # Since JMeter 2.9, default is MODE_STRIPPED_BATCH, which returns samples in
 # batch mode (every 100 samples or every minute by default)

Modified: jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java?rev=1760920&r1=1760919&r2=1760920&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java Thu Sep 15 11:52:24 2016
@@ -22,6 +22,7 @@ import java.io.ObjectStreamException;
 import java.io.Serializable;
 import java.rmi.RemoteException;
 
+import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
 
@@ -38,8 +39,21 @@ public class DataStrippingSampleSender e
 
     private static final Logger log = LoggingManager.getLoggerForClass();
 
+    private static final boolean DEFAULT_STRIP_ALSO_ON_ERROR = true;
+    
+    private static final boolean SERVER_CONFIGURED_STRIP_ALSO_ON_ERROR = 
+            JMeterUtils.getPropDefault("sample_sender_strip_also_on_error", DEFAULT_STRIP_ALSO_ON_ERROR); // $NON-NLS-1$
+
+    // instance fields are copied from the client instance
+    private final boolean clientConfiguredStripAlsoOnError = 
+            JMeterUtils.getPropDefault("sample_sender_strip_also_on_error", DEFAULT_STRIP_ALSO_ON_ERROR); // $NON-NLS-1$
+    
+    
     private final RemoteSampleListener listener;
     private final SampleSender decoratedSender;
+    // Configuration items, set up by readResolve
+    private transient volatile boolean stripAlsoOnError;
+
 
     /**
      * @deprecated only for use by test code
@@ -76,7 +90,7 @@ public class DataStrippingSampleSender e
     public void sampleOccurred(SampleEvent event) {
         //Strip the response data before writing, but only for a successful request.
         SampleResult result = event.getResult();
-        if(result.isSuccessful()) {
+        if(stripAlsoOnError || result.isSuccessful()) {
             // Compute bytes before stripping
             stripResponse(result);
             // see Bug 57449
@@ -115,7 +129,12 @@ public class DataStrippingSampleSender e
      *             never
      */
     private Object readResolve() throws ObjectStreamException{
-        log.info("Using DataStrippingSampleSender for this run");
+        if (isClientConfigured()) {
+            stripAlsoOnError = clientConfiguredStripAlsoOnError;
+        } else {
+            stripAlsoOnError = SERVER_CONFIGURED_STRIP_ALSO_ON_ERROR;
+        }
+        log.info("Using DataStrippingSampleSender for this run with stripAlsoOnError:"+stripAlsoOnError);
         return this;
     }
 }

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1760920&r1=1760919&r2=1760920&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Thu Sep 15 11:52:24 2016
@@ -69,6 +69,7 @@ Summary
     <li>ThroughputController defaults have changed. Now defaults are Percent Executions which is global and no more per user. See <bugzilla>60023</bugzilla></li>
     <li>Since 3.1 version, HTML report ignores Empty Transaction controller (possibly generated by If Controller or Throughput Controller) when computing metrics. This provides more accurate metrics</li>
     <li>Since 3.1 version, Summariser ignores SampleResults generated by TransactionController when computing the live statistics, see <bugzilla>60109</bugzilla></li>
+    <li>Since 3.1 version, when using Stripped modes (by default StrippedBatch is used) , response will be stripped also for failing SampleResults, you can revert this to previous behaviour by setting <code>sample_sender_strip_also_on_error=false</code> in user.properties, see <bugzilla>60137</bugzilla></li>
 </ul>
 
 <h3>Deprecated and removed elements</h3>
@@ -150,6 +151,7 @@ Summary
     <li><bug>59924</bug>The log level of XXX package is set to DEBUG if <code>log_level.XXXX</code> property value contains spaces, same for __log function</li>
     <li><bug>59777</bug>Extract slf4j binding into its own jar and make it a jmeter lib</li>
     <li><bug>60085</bug>Remove cache for prepared statements, as it didn't work with the current jdbc pool implementation and current jdbc drivers should support caching of prepared statements themselves.</li>
+    <li><bug>60137</bug>In Distributed testing when using StrippedXXXX modes strip response also on error</li>
 </ul>
 
 <ch_section>Non-functional changes</ch_section>