jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1418659 - /jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
Date Sat, 08 Dec 2012 12:31:47 GMT
Author: sebb
Date: Sat Dec  8 12:31:46 2012
New Revision: 1418659

URL: http://svn.apache.org/viewvc?rev=1418659&view=rev
Log:
Show a bit more info in the request pane

Modified:
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java

Modified: jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java?rev=1418659&r1=1418658&r2=1418659&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java (original)
+++ jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java Sat
Dec  8 12:31:46 2012
@@ -380,12 +380,24 @@ public class TCPSampler extends Abstract
             initSampling();
             firstSample=false;
         }
+        final boolean reUseConnection = isReUseConnection();
+        final boolean closeConnection = isCloseConnection();
         String socketKey = getSocketKey();
         log.debug(getLabel() + " " + getFilename() + " " + getUsername() + " " + getPassword());
         SampleResult res = new SampleResult();
         boolean isSuccessful = false;
         res.setSampleLabel(getName());// Use the test element name for the label
-        res.setSamplerData("Host: " + getServer() + " Port: " + getPort()); //$NON-NLS-1$
$NON-NLS-2$
+        StringBuilder sb = new StringBuilder();
+        sb.append("Host: ").append(getServer()); // $NON-NLS-1$
+        sb.append(" Port: ").append(getPort()); // $NON-NLS-1$
+        sb.append("\n"); // $NON-NLS-1$
+        sb.append("Reuse: ").append(reUseConnection); // $NON-NLS-1$
+        sb.append(" Close: ").append(closeConnection); // $NON-NLS-1$
+        sb.append("\n["); // $NON-NLS-1$
+        sb.append("SOLINGER: ").append(getSoLinger()); // $NON-NLS-1$
+        sb.append(" EOL: ").append(getEolByte()); // $NON-NLS-1$
+        sb.append("]"); // $NON-NLS-1$
+        res.setSamplerData(sb.toString()); 
         res.sampleStart();
         try {
             Socket sock = getSocket(socketKey);
@@ -422,7 +434,7 @@ public class TCPSampler extends Abstract
             // Set if we were successful or not
             res.setSuccessful(isSuccessful);
 
-            if (!isReUseConnection() || isCloseConnection()) {
+            if (!reUseConnection || closeConnection) {
                 closeSocket(socketKey);
             }
         }



Mime
View raw message