Increase number of threads in JMeter during execution

Viewed 6248

I have a performance test in JMeter and would like to test maximum system performance/throughput with it. So number of active threads should be increased for example while Error rate is under 2 %. I found Constant Throughput Timer, put it into Thread Group but it only pause or slow down threads. I tried define it as follows, with a property: ${__P(throughput,)}, but not sure what should be correct value for this property. I can't see how JMeter could measure system maximal performance.

2 Answers

There is no Out of the box solution as of JMeter 3.3, see this enhancement request:

Still it is possible to dynamically add threads since JMeter 3.2 (see https://bz.apache.org/bugzilla/show_bug.cgi?id=60530) in a JSR223 Test Element using JMeterContext:

ctx.getThreadGroup().addNewThread(delay, ctx.getEngine());

So based on this, you could in a JSR223 Test Element (Pre/Post Processor or Sampler) check the presence of a file in a folder of your choice named :

NUMBER_OF_THREAD_TO_ADD.txt

If present, use its name to compute number of threads and call this method.

Related