Bug 50170

Summary: Bytes reported by http sampler is after GUnZip
Product: JMeter - Now in Github Reporter: jens_0
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: jens_0
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description jens_0 2010-10-28 05:11:38 UTC
Using a load testing tool, one would expect to see the real amount of data that went over the wire in the reports, but the HTTPSampler does not call setBytes on its result, meaning that the length of the response data is used when SamplerResult.getBytes() is called. 
This response data has the length after unzipping!

Due to a chain of input streams in HTTPSampler.readResponse, the original length is not available directly.
A possibility would be to use the response header value "content-length" plus the header length (how to get that one from the HttpUrlConnection?).
Comment 1 Milamber 2010-11-21 06:33:48 UTC
See Bug 43363
Comment 2 Milamber 2011-04-03 19:17:30 UTC
A new property allow to change the method to get response size. Please try with a nightly build after revision 1088435.
Reopen if needs.

URL: http://svn.apache.org/viewvc?rev=1088435&view=rev
Log:
Bug 50170 - Bytes reported by http sampler is after GUnZip
Add an optional property to allow change the method to get response size.

Modified:
    jakarta/jmeter/trunk/bin/jmeter.properties
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 3 Milamber 2011-04-04 15:36:44 UTC
New revision, better design. Thanks to sebb.



URL: http://svn.apache.org/viewvc?rev=1088748&view=rev
Log:
Simplify new properties to change method to calculate getBytes()
Save Headers size and Content-length on sample (in HTTPSampleResult) instead of calculting when gets results

Modified:
    jakarta/jmeter/trunk/bin/jmeter.properties
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java
    jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 4 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2417