Author: pmouawad
Date: Wed Mar 23 14:17:05 2016
New Revision: 1736324

URL: http://svn.apache.org/viewvc?rev=1736324&view=rev
Log:
Bug 59205 TCP Sampler: Set connect time in sampler when connection is 
established
As per dev mailing list discussion, update documentation and handle to 
connection error
Bugzilla Id: 59205

Modified:
    
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
    jmeter/trunk/xdocs/usermanual/glossary.xml

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=1736324&r1=1736323&r2=1736324&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
 Wed Mar 23 14:17:05 2016
@@ -392,8 +392,12 @@ public class TCPSampler extends Abstract
         res.setSamplerData(sb.toString()); 
         res.sampleStart();
         try {
-            Socket sock = getSocket(socketKey);
-            res.connectEnd();
+            Socket sock;
+            try {
+                sock = getSocket(socketKey);
+            } finally {
+                res.connectEnd();
+            }
             if (sock == null) {
                 res.setResponseCode("500"); //$NON-NLS-1$
                 res.setResponseMessage(getError());

Modified: jmeter/trunk/xdocs/usermanual/glossary.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/glossary.xml?rev=1736324&r1=1736323&r2=1736324&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/glossary.xml (original)
+++ jmeter/trunk/xdocs/usermanual/glossary.xml Wed Mar 23 14:17:05 2016
@@ -49,6 +49,8 @@ browser or other application client.
 
 <p>
 <a name="Connect"><b>Connect Time</b></a>. JMeter measures the time it took to 
establish the connection, including SSL handshake. Note that connect time is 
not automatically subtracted from <a href="#Latency">latency</a>.
+In case of connection error, the metric will be equal to the time it took to 
face the error, for example in case of Timeout, it should be equal to 
connection timeout. 
+<note>As of JMeter 3.0, this metric is only computed to TCP Sampler and HTTP 
Request.</note> 
 </p>
 
 <p>


Reply via email to