You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/03/12 06:07:35 UTC

DO NOT REPLY [Bug 46838] New: HTTP sampler will always set the latency to 0 if response contains no data

https://issues.apache.org/bugzilla/show_bug.cgi?id=46838

           Summary: HTTP sampler will always set the latency to 0 if
                    response contains no data
           Product: JMeter
           Version: 2.3.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: Wang_zhifeng@emc.com


When I run a post operation which do a create operation on the server, the
latency of the web request is always 0 no matter how big the operation is. 
I traced into the source file, and found in HTTPSamplerBase.java, if no
response data, the sampleResult.latencyEnd(); will not be called. 

while ((bytesRead = in.read(readBuffer)) > -1) {
            if (first) {
                sampleResult.latencyEnd();
                first = false;
            }
            if (asMD5 && md != null) {
                md.update(readBuffer, 0 , bytesRead);
                totalBytes += bytesRead;
            } else {
                w.write(readBuffer, 0, bytesRead);
            }
        }

Add following code after the while loop will fix this bug.
if (first)
    sampleResult.latencyEnd();

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 46838] HTTP sampler will always set the latency to 0 if response contains no data

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46838


Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Sebb <se...@apache.org>  2009-04-03 02:43:24 PST ---
Thanks for the report and fix.

Applied to SVN in

URL: http://svn.apache.org/viewvc?rev=761584&view=rev
Log:
Bug 46838 - if there was no data, still need to set latency in HTTPSampler

Will be in nightly builds after r76158 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=76158 )

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org