Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Summary: HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.5.1
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-05 15:21 UTC by Jason McSwain
Modified: 2016-10-18 14:36 UTC (History)
1 user (show)



Attachments
Proposal for a fix (16.37 KB, patch)
2016-10-08 19:12 UTC, Philippe Mouawad
Details | Diff
Updated patch to manage backward compatibility (30.79 KB, patch)
2016-10-08 19:36 UTC, Philippe Mouawad
Details | Diff
Updated patch with backward compat and fix to wrong conversion (31.47 KB, patch)
2016-10-09 14:00 UTC, Philippe Mouawad
Details | Diff
Last version fixing bad conversion in report part (32.07 KB, patch)
2016-10-09 14:07 UTC, Philippe Mouawad
Details | Diff
Last version after fix to Bug 60229 (33.40 KB, patch)
2016-10-10 20:04 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason McSwain 2012-04-05 15:21:22 UTC
While writing some custom "JavaSamplerClient" classes, i ran into a problem with the JMeter SampleResult class.  Currently there are some fields that are too small.

    private int bytes = 0; 
   
    private int bodySize = 0;

The fields noted above and their relative getter/setter methods use int.  this is normally fine, but in the case where you are testing throughput of large streams, you run into a problem.  MAX_INT=2,147,483,647

As you can see this is basically a 2GB stream.  if i wanted to write any stream bigger than that i couldn't accurately calculate throughput with the SampleResult class.

SampleResult result = new SampleResult();
result.setBytes(long);
result.sampleStart();
// like write large file to cloud storage server.
result.sampleEnd();
Comment 1 Philippe Mouawad 2012-04-07 13:33:36 UTC
This can be quite impacting and introduces issues with arrays of bytes as they are limited to int.
Comment 2 Ahmad 2016-10-07 20:11:41 UTC
Hi Phillippe
Do we have a time line when this can be fixed?  This is actually blocker for me since I am mostly doing large objects testing.

thanks

Ahmad
Comment 3 Philippe Mouawad 2016-10-08 19:12:29 UTC
Created attachment 34337 [details]
Proposal for a fix
Comment 4 Philippe Mouawad 2016-10-08 19:36:49 UTC
Created attachment 34338 [details]
Updated patch to manage backward compatibility
Comment 5 Philippe Mouawad 2016-10-09 14:00:13 UTC
Created attachment 34347 [details]
Updated patch with backward compat and fix to wrong conversion
Comment 6 Philippe Mouawad 2016-10-09 14:07:39 UTC
Created attachment 34348 [details]
Last version fixing bad conversion in report part
Comment 7 Philippe Mouawad 2016-10-10 20:04:56 UTC
Created attachment 34355 [details]
Last version after fix to Bug 60229
Comment 8 Philippe Mouawad 2016-10-12 07:53:57 UTC
Was 'SampleResult's "bytes" and "bodySize" are currently "int" but should be "long"'
Comment 9 Philippe Mouawad 2016-10-12 07:56:55 UTC
Note the limitation would manifest itself this way (for example):
2016/10/04 11:55:24 WARN  - jmeter.save.CSVSaveService: java.lang.NumberFormatException: For input string: "2016/10/03 22:28:11.641" 2016/10/04 11:55:24 WARN  - jmeter.save.CSVSaveService: Setting date format to: yyyy/MM/dd HH:mm:ss.SSS 2016/10/04 11:55:25 WARN  - jmeter.save.CSVSaveService: Error parsing field 'bytes' at line 3523 java.lang.NumberFormatException: For input string: "5368709120" 2016/10/04 11:55:25 WARN  - jmeter.reporters.ResultCollector: Problem reading JTL file: ....
Comment 10 Philippe Mouawad 2016-10-12 08:07:03 UTC
Author: pmouawad
Date: Wed Oct 12 08:06:16 2016
New Revision: 1764397

URL: http://svn.apache.org/viewvc?rev=1764397&view=rev
Log:
Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Bugzilla Id: 53039

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/components/org/apache/jmeter/assertions/SMIMEAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/TableVisualizer.java
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
    jmeter/trunk/src/core/org/apache/jmeter/report/core/Sample.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/DataStrippingSampleSender.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/samplers/StatisticalSampleResult.java
    jmeter/trunk/src/core/org/apache/jmeter/save/CSVSaveService.java
    jmeter/trunk/src/core/org/apache/jmeter/save/converters/SampleResultConverter.java
    jmeter/trunk/src/core/org/apache/jmeter/util/Calculator.java
    jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPAbstractImpl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPFileImpl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPJavaImpl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java
    jmeter/trunk/xdocs/changes.xml
Comment 11 Philippe Mouawad 2016-10-12 08:15:39 UTC
Author: pmouawad
Date: Wed Oct 12 08:15:14 2016
New Revision: 1764399

URL: http://svn.apache.org/viewvc?rev=1764399&view=rev
Log:
Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Update properties_reference.xml
Bugzilla Id: 53039

Modified:
    jmeter/trunk/xdocs/usermanual/properties_reference.xml
Comment 12 Philippe Mouawad 2016-10-12 09:19:45 UTC
Author: pmouawad
Date: Wed Oct 12 09:17:37 2016
New Revision: 1764412

URL: http://svn.apache.org/viewvc?rev=1764412&view=rev
Log:
Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Restore changed method for backward compatibility
Bugzilla Id: 53039

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleResult.java
Comment 13 Philippe Mouawad 2016-10-12 09:43:46 UTC
Author: pmouawad
Date: Wed Oct 12 09:43:21 2016
New Revision: 1764422

URL: http://svn.apache.org/viewvc?rev=1764422&view=rev
Log:
Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Fix bug as per Felix Schumacher review, thx
Bugzilla Id: 53039

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPFileImpl.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Comment 14 Ahmad 2016-10-13 19:03:16 UTC
I verified that 5GB file was captured correctly.
Comment 15 UbikLoadPack support 2016-10-18 14:36:13 UTC
Author: pmouawad
Date: Tue Oct 18 14:35:43 2016
New Revision: 1765448

URL: http://svn.apache.org/viewvc?rev=1765448&view=rev
Log:
Bug 53039 - HTTP Request : Be able to handle responses which size exceeds 2147483647 bytes
Fix deprecated calls to setBytes(int)
Bugzilla Id: 53039

Modified:
    jmeter/trunk/src/protocol/ftp/org/apache/jmeter/protocol/ftp/sampler/FTPSampler.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/SubscriberSampler.java
    jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/SmtpSampler.java
    jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/tools/CounterOutputStream.java