Bug 60156

Summary: TCPSampler : Latency is not measured for TCP Sampler
Product: JMeter Reporter: Tamas Szabadi <tamas>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: CLOSED FIXED    
Severity: enhancement CC: p.mouawad
Priority: P2 Keywords: PatchAvailable
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Tamas Szabadi 2016-09-20 13:46:47 UTC
TCP Sampler results have always 0 as latency. It seems that .latencyEnd() is not called anywhere in the TCPSampler or in its implementations.

I can't just create a new custom TCPSamplerImpl implementation because the TCPClient interface doesn't specify a read method with the SampleResult passed in to make it able to call 'latencyEnd' on it.
Comment 1 Philippe Mouawad 2016-09-20 20:43:07 UTC
@Team, another Bugzilla where Java8 default method would allow us to add to TCPClient:

    public String read(InputStream is, SampleResult sampleResult)
            throws ReadException 


Regards
Comment 2 UbikLoadPack support 2017-09-02 20:19:02 UTC
Hello,
Proposed PR for this:

- https://github.com/apache/jmeter/pull/306

Please review.

Thanks
Comment 3 Philippe Mouawad 2017-09-08 11:56:05 UTC
Author: pmouawad
Date: Fri Sep  8 11:55:40 2017
New Revision: 1807719

URL: http://svn.apache.org/viewvc?rev=1807719&view=rev
Log:
Bug 60156 - TCPSampler : Latency is not measured for TCP Sampler
Contributed by UbikLoadPack
Bugzilla Id: 60156

Modified:
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/AbstractTCPClient.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClient.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java
    jmeter/trunk/xdocs/changes.xml
Comment 4 Philippe Mouawad 2017-09-08 17:05:25 UTC
Author: pmouawad
Date: Fri Sep  8 17:03:16 2017
New Revision: 1807786

URL: http://svn.apache.org/viewvc?rev=1807786&view=rev
Log:
Bug 60156 - TCPSampler : Latency is not measured for TCP Sampler
Contributed by UbikLoadPack
Oups forgot to commit tests
Bugzilla Id: 60156

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImplTest.java
    jmeter/trunk/test/src/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImplTest.java