MDL-72921 generators: exported users now match the plan size definition
commitb97643453df2f594bf47abfbc7205019f4a119ba
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 26 Oct 2021 22:06:16 +0000 (27 00:06 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 29 Oct 2021 16:03:44 +0000 (29 18:03 +0200)
tree74a765c38f5117e691d96d8024fe18c3647585ae
parentee1c3d98378182c6377504c960fd5f97eb89a1c1
MDL-72921 generators: exported users now match the plan size definition

Before this patch the exported users (to csv file that jmeter consumes)
were all the enrolled users in the test course. And that's ok when the
number of users enrolled match the number of concurrent threads planned
for a jmeter plan (each thread is a user).

But when both numbers don't match, that can lead to the jmeter plan
not behaving as expected, because it iterates over the excessive users
in the file, leading to some users having run 5 loops, others 4...

The only way to make results more consistent is to, always, ensure that
the number of users exported for the plan match the plan size and not
the site size.

And that's what this issue exactly does, restrict the export to the
number of threads that the plan will have. So every user always runs
the very same number of loops.
admin/tool/generator/classes/testplan_backend.php
admin/tool/generator/cli/maketestplan.php
admin/tool/generator/maketestplan.php
admin/tool/generator/upgrade.txt