jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harperdev <>
Subject Re: Stop Test when Thread Group #2 Stops
Date Thu, 14 Aug 2014 23:26:10 GMT
Thanks Sebb. I ended up using a BeanShell to calculate how many total threads
would run, like this:

int numThreads = ctx.getThreadGroup().getNumberOfThreads();
Controller ctrl = ctx.getThreadGroup().getSamplerController();
LoopController loopCtrl = (LoopController)ctrl;
int numLoops= loopCtrl.getLoops();
int totalThreads = numLoops * numThreads;

I also have a simple counter, and if the counter >= totalThreads it stops
the test:

Too bad it doesn't work when TG2 is set to loop "Forever". In that case TG2
automatically stops when the csv data hits eof, but TG1 keeps going since my
code above doesn't know when TG2 will stop.

View this message in context:
Sent from the JMeter - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message