jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1570021 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Date Thu, 20 Feb 2014 00:54:54 GMT
Author: sebb
Date: Thu Feb 20 00:54:54 2014
New Revision: 1570021

URL: http://svn.apache.org/r1570021
Log:
Add a bit more sampler debug

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1570021&r1=1570020&r2=1570021&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Thu Feb 20 00:54:54 2014
@@ -394,12 +394,14 @@ public class HTTPHC4Impl extends HTTPHCA
 
         } catch (IOException e) {
             res.sampleEnd();
+            log.debug("IOException", e);
            // pick up headers if failed to execute the request
             res.setRequestHeaders(getConnectionHeaders((HttpRequest) localContext.getAttribute(ExecutionContext.HTTP_REQUEST)));
             errorResult(e, res);
             return res;
         } catch (RuntimeException e) {
             res.sampleEnd();
+            log.debug("RuntimeException", e);
             errorResult(e, res);
             return res;
         } finally {
@@ -569,6 +571,22 @@ public class HTTPHC4Impl extends HTTPHCA
         public int hashCode(){
             return hashCode;
         }
+
+        // For debugging
+        @Override
+        public String toString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append(target);
+            if (hasProxy) {
+                sb.append(" via ");
+                sb.append(proxyUser);
+                sb.append("@");
+                sb.append(proxyHost);
+                sb.append(":");
+                sb.append(proxyPort);
+            }
+            return sb.toString();
+        }
     }
 
     private HttpClient setupClient(URL url) {
@@ -651,13 +669,13 @@ public class HTTPHC4Impl extends HTTPHCA
             clientParams.setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.IGNORE_COOKIES);
 
             if (log.isDebugEnabled()) {
-                log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient));
+                log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient)
+ " " + key.toString());
             }
 
             map.put(key, httpClient); // save the agent for next time round
         } else {
             if (log.isDebugEnabled()) {
-                log.debug("Reusing the HttpClient: @"+System.identityHashCode(httpClient));
+                log.debug("Reusing the HttpClient: @"+System.identityHashCode(httpClient)
+ " " + key.toString());
             }
         }
 



Mime
View raw message