Change the thread count of test plan in JMeter, at

2019-01-25 09:19发布

I want to change the number of threads for a JMeter test plan at runtime.

I have Googled my problem and found a proposed solution to use JMeter plugins. But in this solution I would have to schedule the thread group before running the test plan, which I don't want. I also found another potential solution which changes the property, but doesn't affect test plan behavior at run time.

Ultimately, what I am trying to do is change the thread number given in a thread group and have it immediately increase or decrease the number of threads in the current running test plan.

Is this possible?

7条回答
看我几分像从前
2楼-- · 2019-01-25 10:11

By enabling the BeanShell server you can vary properties at runtime. Just enable it and telnet on port 9001 (warning: not secure!) Based on a test I did, unfortnately, it appears that the thread count it's not applied at runtime. However you can still manipulate the load of the test by other means, for example apply a costant throughput timer parametrized with a property named "throughput" and vary it at runtime like this:

setprop("throughput","2000");

It's well explained in the guide.

查看更多
登录 后发表回答