mirror of https://github.com/apache/jmeter.git
Add shortened version of the PUT body to sampler result.
Bugzilla Id: 60092
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1762120 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: 3b0162c77c
This commit is contained in:
parent
d486459752
commit
660c5d34a8
|
|
@ -480,6 +480,9 @@ log_level.jorphan=INFO
|
|||
# No matter what, the connection will not be re-used beyond its TTL.
|
||||
#httpclient4.time_to_live=2000
|
||||
|
||||
# Max size in bytes of PUT body to retain in result sampler. Bigger results will be clipped.
|
||||
#httpclient4.max_body_retain_size=32768
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Apache HttpComponents Commons HTTPClient configuration (HTTPClient 3.1)
|
||||
# DEPRECATED
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ import java.util.regex.Pattern;
|
|||
|
||||
import javax.security.auth.Subject;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.io.input.BoundedInputStream;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpConnection;
|
||||
|
|
@ -137,6 +139,8 @@ import org.apache.log.Logger;
|
|||
*/
|
||||
public class HTTPHC4Impl extends HTTPHCAbstractImpl {
|
||||
|
||||
private static final int MAX_BODY_RETAIN_SIZE = JMeterUtils.getPropDefault("httpclient4.max_body_retain_size", 32 * 1024);
|
||||
|
||||
private static final Logger log = LoggingManager.getLoggerForClass();
|
||||
|
||||
/** retry count to be used (default 0); 0 = disable retries */
|
||||
|
|
@ -1441,7 +1445,11 @@ public class HTTPHC4Impl extends HTTPHCAbstractImpl {
|
|||
// our own stream, so we can return it
|
||||
final HttpEntity entityEntry = entity.getEntity();
|
||||
if(entityEntry.isRepeatable()) {
|
||||
entityBody.append("<actual file content, not shown here>");
|
||||
entityBody.append(IOUtils.toString(new BoundedInputStream(
|
||||
entityEntry.getContent(), MAX_BODY_RETAIN_SIZE)));
|
||||
if (entityEntry.getContentLength() > MAX_BODY_RETAIN_SIZE) {
|
||||
entityBody.append("<actual file content shortened>");
|
||||
}
|
||||
}
|
||||
else { // this probably cannot happen
|
||||
entityBody.append("<RequestEntity was not repeatable, cannot view what was sent>");
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@ log_level.org.apache.http.client=DEBUG
|
|||
<property name="httpclient4.idletimeout">Idle connection timeout (Milliseconds) to apply if the server does not send Keep-Alive headers, defaults to:0 (no suggested duration for Keep-Alive))</property>
|
||||
<property name="httpclient4.validate_after_inactivity">Check connections if the elapsed time (Milliseconds) since the last use of the connection exceeds this value<br/>, defaults to:2000</property>
|
||||
<property name="httpclient4.time_to_live"> TTL (in Milliseconds) represents an absolute value. No matter what, the connection will not be re-used beyond its TTL. <br/>, defaults to:2000</property>
|
||||
<property name="httpclient4.max_body_retain_size">Max size in bytes of PUT body to retain in result sampler. Bigger results will be clipped.<br/>, defaults to: 327678 (bytes)</property>
|
||||
</properties>
|
||||
</section>
|
||||
<section name="§-num;.16 Apache HttpComponents Commons HTTPClient configuration (HTTPClient 3.1)" anchor="httpclient31">
|
||||
|
|
|
|||
Loading…
Reference in New Issue