Bug 50170 - Bytes reported by http sampler is after GUnZip
Bytes reported by http sampler is after GUnZip
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.4
PC Windows XP
: P2 normal with 2 votes (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-10-28 05:11 UTC by jens_0
Modified: 2011-04-04 15:36 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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