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 2006/04/28 23:43:30 UTC

DO NOT REPLY [Bug 39447] New: - Better algorithm for constant throughput timer

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447

           Summary: Better algorithm for constant throughput timer
           Product: JMeter
           Version: Nightly (Please specify date)
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: eric.dalquist@doit.wisc.edu


The original algorithm used by ConstantThroughputTimer does not do a good job in
ensuring requests are evenly spaced and does not ensure throughput if the thread
group has a ramp up period.

I've changed the algorithm to achieve constant throughput no matter how many
threads are actually active (if applying to all threads or the thread group).
The algorithm also ensures a constant distribution of samples as long as the
samplers are not taking too long. I'll attach the modified
ConstantThroughputTimer and a dependent class.

The algorithm should also have less overhead in the way of math and synchronization.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From sebb@apache.org  2006-05-08 23:32 -------
OK, I've added the two new options to the 2.1 code.

The change is in the nightly build 2-1.20060508.

Please check if I've added the code correctly.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-04-29 00:39 -------
Created an attachment (id=18204)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18204&action=view)
A Patch against the trunk

Here is a patch against the latest code in the trunk. I ended up just
re-writing the class to simplify the code.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447


sebb@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From sebb@apache.org  2006-04-28 22:48 -------
(In reply to comment #2)
> Created an attachment (id=18202)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18202&action=view) [edit]
> Helper class for the updated ConstantThroughputTimer code
> 
> This is a helper class used by the updated ConstantThroughputTimer code.

Thanks - but ... but I'm not sure we can accept this code with its current
licence ... can you change it for something else, e.g. ASL V2?

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From sebb@apache.org  2006-05-08 22:03 -------
(In reply to comment #11)
> The patch should work if the delay changes during the test. The
> setThroughput(double) method calculates the millisecondsPerRequest value which
> is used by the calculateDelay(ThrougputInfo) method every time the delay()
> method is called.

Sorry, I got this wrong - I had assumed that setThroughput() was only called at
the start of a test, but it seems the TestBean variables are updated just before
delay is called. So moving it has no effect on the number of times it is invoked.

> I can re-work the code and provide that patch as well if you would like.

No need, thanks.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-04-28 21:44 -------
Created an attachment (id=18201)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18201&action=view)
The updated ConstantThroughputTimer code

This is the modified ConstantThroughputTimer code.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447


sebb@apache.org changed:

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




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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From sebb@apache.org  2006-04-29 00:31 -------
Thanks for the updated source.

I've now had a look at the main code, and I'm finding it rather difficult to
work out what has been changed - for one thing, it looks as though the order of
methods has changed; there are changes in spacing etc.

Any chance you could provide a patch against the 2.1 branch that just has your
changes?

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447


eric.dalquist@doit.wisc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #18204|0                           |1
        is obsolete|                            |




------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-05-01 16:01 -------
Created an attachment (id=18213)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18213&action=view)
ConstantThroughputTimer patch against the 2.1 branch

A patch with a minimal set of changes made against the 2.1 branch. The same
helper class (attachment 18203) can be used with this patch.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From sebb@apache.org  2006-04-29 00:55 -------
Sorry, but I cannot use the patch against the trunk.

All changes at present are being made in the 2.1 branch; the trunk is very much
behind.

Also, please only provide the minimum changes. Thanks.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-05-08 17:51 -------
The patch should work if the delay changes during the test. The
setThroughput(double) method calculates the millisecondsPerRequest value which
is used by the calculateDelay(ThrougputInfo) method every time the delay()
method is called.

The patch doesn't change the behavior of the "This Thread Only" option and over
a long enough period of time doesn't change the number of requests per time unit
for   "All Threads" and "All Threads in Group". The change is instead of trying
to calculate the delay for each thread independently when the user wants the
throughput to apply to a group of threads the delays are calculated for that group.

On that note if the function of the "All Threads" and "All Threads in Group"
options is desired then adding two new options would work too. I can re-work the
code and provide that patch as well if you would like.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From sebb@apache.org  2006-05-08 16:52 -------
[BTW, the patch currently fetches the throughput only once. However the 
thoughput may vary during a run, so this needs to be done every time.]

I've done some fixes to the existing code that should make it more accurate. 
The ramp-up period is now allowed for, and the calculation has been corrected.

The original code calculates the delays indepedently for each thread, and 
tries to maintain the throughput in each thread.

The patch tries to maintain the overall thoughput, regardless of which thread 
generates it.

Seems to me that both approaches are valid, so the best might be to add the 
patch as 2 new options (the per-thread case is now the same).

Would that be OK?

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447


eric.dalquist@doit.wisc.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #18202|0                           |1
        is obsolete|                            |




------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-04-28 23:02 -------
Created an attachment (id=18203)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18203&action=view)
Updated licence appropriately

The helper class with the Apache 2.0 license. I apologize for forgetting to put
this license on the code before I originally uploaded it.

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-05-08 15:03 -------
Is this a viable patch for the ConstantThroughputTimer or should I submit it as
a new timer component for jMeter?

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

---------------------------------------------------------------------
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 39447] - Better algorithm for constant throughput timer

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39447>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39447





------- Additional Comments From eric.dalquist@doit.wisc.edu  2006-04-28 21:44 -------
Created an attachment (id=18202)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=18202&action=view)
Helper class for the updated ConstantThroughputTimer code

This is a helper class used by the updated ConstantThroughputTimer code.

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

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