Bug 41418

Summary: Excludes timer duration from Transaction Controller runtime in report
Product: JMeter - Now in Github Reporter: Holger Isenberg <isenberg>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: benoit.wiart, jens_0, p.mouawad
Priority: P2    
Version: 2.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: adds checkbox to Transaction Controller to exclude timer durations
missing part 2 of patch above
Suggested patch
Simple testplan to show that timer is included
Updated patch against current svn version (2.3 r575019)
Updated patch against trunk of 6/10/2009
Patch to trunk (22/11/2009 21h39)

Description Holger Isenberg 2007-01-19 09:40:48 UTC
The Transaction Controller can be used to simplify the Summary 
Report. However, when you need the runtime summary for all elements 
of a transaction controller, the timer durations are added.

With this patch (against SVN rel-2-2 r497856) a check box is added to 
the Transaction Controller to exclude all timer durations from the 
Summary Report.
Comment 1 Holger Isenberg 2007-01-19 09:41:33 UTC
Created attachment 19435 [details]
adds checkbox to Transaction Controller to exclude timer durations
Comment 2 Sebb 2007-01-19 10:11:02 UTC
Seems to be a bit missing - 

The method incIdleTime() is not defined for SampleResult
Comment 3 Holger Isenberg 2007-01-19 12:15:32 UTC
Created attachment 19436 [details]
missing part 2 of patch above
Comment 4 Alf Hogemark 2007-07-02 11:37:52 UTC
Created attachment 20430 [details]
Suggested patch

This suggested patch adds a jmeter.properties option to control how the
duration o f the TransactionSample is made. I do not have time to add an GUI
option at the moment, and I'm guessing that a property to control the behaviour
should be sufficient short term.

Currently, the TransactionSample will have the start of the first subsample as
it's start time, and the end of the last subsample of the transaction as it's
end times. This means that the time it takes to run pre-, postprocessors,
assertions and timers inside a TransactionController will be included in the
duration of the transaction sample.

With this patch, and the jmeter.properties option set to true, the transaction
sample will report the sum of the subsamples as it's duration. This will then
not include the time for pre-, postprocessors, timers and assertions.
Comment 5 Alf Hogemark 2007-07-02 11:41:15 UTC
Created attachment 20431 [details]
Simple testplan to show that timer is included

The attached testplan shows that both timers are included in the duration of
the transaction sample.
So to correct my statement above slightly : by default, the end timestamp of
the transaction sample is set to the timestamp when the transaction controller
figures out that there are no more subsamples to sample in the transaction, and
not to the  end time of the last subsample, as I said in my previous comment.
Comment 6 Holger Isenberg 2007-09-13 09:44:45 UTC
Created attachment 20819 [details]
Updated patch against current svn version (2.3 r575019)

This is an updated version of my patch against the current svn version 2.3
r575019
Comment 7 Philippe Mouawad 2009-10-06 11:14:27 UTC
Hello,
I find this enhancement very useful.
Attached is the updated patch of Alf Hogemark done against current trunk.

I just changed default value of "Include timer duration in runtime summary" to true to ensure ascending compatibility and commented some code.
I also tested it successfully.

Philippe 
http://www.ubik-ingenierie.com
Comment 8 Philippe Mouawad 2009-10-06 11:17:47 UTC
Created attachment 24351 [details]
Updated patch against trunk of 6/10/2009
Comment 9 Philippe Mouawad 2009-11-15 10:41:21 UTC
I tested this feature in last load tests campaign.
Found no bugs and it is really very useful.
A good enhancement would be to remove TestAction times.


Philippe.
Comment 10 Sebb 2009-11-17 17:28:02 UTC
I've been looking at the patch dated 2009-10-06 11:17 UTC.
[Not all that easy to follow, as there are lots and lots of spurious white-space changes in the SampleResult part. Please try to submit minimum necessary changes in future.]

There is one part of the patch I don't understand:

TransactionController.java
...
@@ -152,6 +164,8 @@
             // Assume success
             res.setSuccessful(true);
             res.sampleStart();
+            prevEndTime = res.getStartTime();
+            pauseTime = 0;
         }

It does not seem correct to use the StartTime as the initial value for the previous End Time. Is the patch correct - if so why? If not, what should it be?
Comment 11 Philippe Mouawad 2009-11-22 12:28:23 UTC
Hello,
First thanks for taking into account this patch and other ones I submitted.
I am sorry for the patch with lot of spaces, you are right, it s hard to read.

Now about your question, here is the concept of the patch as I understood it (originial writer is Alf Hogemark):
- pauseTime cumulates time taken by all transaction timers and this is done by recording "previous end time" of a Sample.
So prevEndTime is used only to compute timer(s) time between samples.


pauseTime for each sample is computed by doing (sample endTime - Time taken by sample) (which would be the sample start time) - previous sample EndTime in same transaction. 

Do you see a pb in this ?
Thanks
Philippe.
Comment 12 Philippe Mouawad 2009-11-22 12:40:13 UTC
Created attachment 24584 [details]
Patch to trunk (22/11/2009 21h39)

Cleaned up patch
Comment 13 Sebb 2009-12-14 14:54:06 UTC
Thanks for the patch; it seems to work fine.

Patch committed to SVN:

URL: http://svn.apache.org/viewvc?rev=890526&view=rev
Log:
Bug 41418 - Exclude timer duration from Transaction Controller runtime in report
Comment 14 jens_0 2010-10-19 03:05:32 UTC
Excluding timer duration does not work if the transaction controller's option "Generate parent sample" is on.

See Bug 50080
Comment 15 The ASF infrastructure team 2022-09-24 20:37:38 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1851