Bug 50134

Summary: TransactionController : Reports bad response time when it contains other TransactionControllers
Product: JMeter - Now in Github Reporter: Philippe Mouawad <p.mouawad>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Screenshot showing bug
JMX Plan showing issue
JSP for test case
Patch to the bug
Simpler Test plan
Screenshot showing bug with new Java Sampler JMX
Cleaned up JMX
Patch to issue

Description Philippe Mouawad 2010-10-21 03:43:56 UTC
Created attachment 26197 [details]
Screenshot showing bug

Hello,
I have a case where I nested a TransactionController inside another.
See attached test JMX called bug.jmx.
What happens is root TransactionController cumulates times of its insider transaction controller, see attached screenshot.
scenario4 has time of 16124 instead of having 8063.

This issue affects 2.4 and nightly build of 21/10/2010.

I will submit a patch in minutes.
Regards
Philippe M.
http://www.ubik-ingenierie.com
Comment 1 Philippe Mouawad 2010-10-21 03:46:10 UTC
Created attachment 26198 [details]
JMX Plan showing issue
Comment 2 Philippe Mouawad 2010-10-21 03:48:02 UTC
Created attachment 26199 [details]
JSP for test case

Put this JSP in standard Tomcat 6 inside folder:
examples/jsp/test
Comment 3 Philippe Mouawad 2010-10-21 03:56:51 UTC
Created attachment 26200 [details]
Patch to the bug

This patch corrects the issue.
Comment 4 Philippe Mouawad 2010-10-21 03:58:02 UTC
Hello,
I submitted the patch, hope you can take it into account soon.

Thank you 
Regards
Philippe M.
http://www.ubik-ingenierie.com
Comment 5 Sebb 2010-10-21 06:36:58 UTC
Would it be possible to provide a simpler test case using just Java Request samplers?
Comment 6 Philippe Mouawad 2010-10-21 10:06:57 UTC
Created attachment 26201 [details]
Simpler Test plan

Here is a simpler test based on java samplers.

Philippe M.
http://www.ubik-ingenierie.com
Comment 7 Philippe Mouawad 2010-10-21 10:07:44 UTC
Created attachment 26202 [details]
Screenshot showing bug with new Java Sampler JMX
Comment 8 Sebb 2010-10-21 11:08:43 UTC
Sorry, but the test plan is still quite difficult to follow, as it has disabled entries and assertions, several thread groups etc.

I've no idea which parts of the plan are relevant.
Time spent fixing the test plan is time that cannot be spent fixing the bug.

Please can you provide the simplest possible plan that shows the problem?
Comment 9 Philippe Mouawad 2010-10-21 12:49:50 UTC
Sorry sebb, You can remove all disabled objects, thé scénario to use is S5.
You run it and in résults you Will see that scénario 5 has wrong response Time it cumulates all its inner response Time even when on transactioncontroller contains another one.
I Can upload new jmx within tomorrow if you really need it.

I submitted thé patch to bug and tested it successfully.

Thank you
Comment 10 Philippe Mouawad 2010-10-21 14:39:02 UTC
Created attachment 26203 [details]
Cleaned up JMX

Sorry It seems I messed up with my JMX, this one is the good one.
Thank you again for your time.

Regards
Comment 11 Philippe Mouawad 2010-10-22 08:13:29 UTC
Comment on attachment 26200 [details]
Patch to the bug

Patch is not working.
There is some other case it does not solve.
Comment 12 Philippe Mouawad 2010-11-01 06:11:47 UTC
Created attachment 26245 [details]
Patch to issue

Hello,
I analyzed a bit more what was happening.
I think I understood where the issue comes from.

As the plan is built, here is how sampleOccured in TransactionController is called:
SampleOccured :s4-1-s1 in :s4-chapeau
SampleOccured :s4-1-s1 in :scenario5
SampleOccured :s4-1-s2 in :s4-chapeau
SampleOccured :s4-1-s2 in :scenario5
SampleOccured :s4-chapeau in :scenario5

This is because scenario5 and s4-chapeau are both registered as listeners for each sample, this end up in the upper most parent recording twice things and mixing up pause time.


In my analysis there are 2 types of SampleEvent:
- One that is initiated by a real Sample
- One that is initiated "artificially" by TransactionController#next2, this one should not be used in computations


So my idea was to distinguish them by an additional attribute called isTransactionSampleEvent.
I use this attribute setting it to true in next2() to build the SampleEvent
and use it in sampleOccured() to use it in computation or not.


I tested with the existing test plan and the one that is a bit more complicated and it works.
But I think you have the big picture to validate this modification.

By the way you will notice some changes in SampleEvent because I made some refactoring in the constructor to make them use each others instead of copy/paste.


Thank you for your time and great product and hope you will have some time to take this patch into account.

Regards
Philippe M.
http://www.ubik-ingenierie.com
Comment 13 Sebb 2010-11-01 13:01:39 UTC
Yes, I think your analysis is correct, and the patch approach is reasonable.

Applied the fix to SVN with some minor changes:
- dropped unnecessary setTransactionSampleEvent and made boolean final
- made new ctor private, as not used externally
- simplified nested conditional block.
- replaced tabs with spaces, and removed spurious blank lines


URL: http://svn.apache.org/viewvc?rev=1029746&view=rev
Log:
Bug 50134 - TransactionController : Reports bad response time when it contains other TransactionControllers

Modified:
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/samplers/SampleEvent.java
   jakarta/jmeter/trunk/xdocs/changes.xml
Comment 14 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2415