I have a JMeter test scenario that consists of multiple thread groups. I am controlling the scenario using command line parameters to pass in workload, thread count etc. The thread groups are always a fixed percentage of the overall thread count (for example three groups with a 40:40:20 split). I want to pass in a single value and have that calculated for the three groups.
Problem is, the only thing I could think of is to use a Beanshell sampler in a startup thread group to calculate the threads, but I'm now realising at the point this sampler is running, JMeter has already gone past the point where it's set up the threads for the other groups. Therefore the other thread groups end up with zero threads.
What I think I need to do is put the calculation right into the thread group 'number of users' box, and I think it's Javascript. But the syntax fails me. Can anyone help?
Oh, and I know passing in three parameters in the command line would also suffice, but the command line is coming from a Jenkins job and I want to make sure that the users only have to add a single number as a parameter.