you can change it based on the variable set in the startup thread. See below.
In Jmeter, how to set a variable number of threads using the beanshell selector variable?
However, once a thread group is started, you cannot change it. To the guy who said that this feature will not be useful, I do not agree. There are many types of stress tests, and they do not all have the same number of time users. Here are just two examples of the types of enterprise load tests that we conduct in the bank where I work:
- Test duration - the same number of users starts all the time (possibly with a short rise period)
- Breakpoint Test - Increases the number of users step by step until application breaks
- Spike test - works with a constant number of users, but sporadically - drop a large number of users
The breakpoint test increases the number of users until the application breaks (point of view on how high your application can scale). You can do this using the group property "Rise Time Period". If you set the rise time to 1000 and the number of threads to 100, it will add 1 thread every 10 seconds.
Spike tests are similar to duration tests, but a large number of users are registered at regular intervals. This is used to determine application response time during peak hours or how it will respond if you suddenly get a large number of users (a very real scenario).
I found that Jmeter does not handle all the load scenarios that are needed to test the load in enterprises. One work around Im is just to start all the topics, but find a way to make some of them sleep. Thus, you can set the number of threads to 1000, but somehow make 980 of them sleep or do nothing. Then, perhaps, when time_in_seconds% 5 == 0 (every 5 minutes) you allow other threads to run - simulating a spike test. The idea is that you can hard code the streams up to 1000 and you will always have 1000 streams, but not all of them should do anything at any time.
(in other words, you can probably find a way, but you need to create a creative approach)
Update: I just found this plugin that allows for various types of testing. I have not tried it yet, but it looks promising: http://jmeter-plugins.org/wiki/ThroughputShapingTimer/
George
source share