Reputation: 337
I have a JMeter test plan that looks like this:
My expectation is that all threads should work their way through sampler 1 and sampler 2 sequentially. However, when I start the test the logs indicate threads execute sampler 1 only for a period of time before executing sampler 2 much later down the line. It's almost as if the thread is "slept" after the first sampler and woken later down the line to run sampler 2.
Example log output:
Sampler 1 - thread 1
Sampler 1 - thread 2
Sampler 1 - thread 3
Sampler 1 - thread 4
Sampler 1 - thread 5
Sampler 1 - thread 6
Sampler 1 - thread 7
... some time later
Sampler 2 - thread 1
Sampler 1 - thread 8
Sampler 2 - thread 3
Why is the second sampler not appearing immediately after the first Sampler has been run? It's almost like the Throughput timing plugin is not treating the pair of samplers together and it's only running sampler 1 to it's schedule to begin with. I expect output to look much more "balanced" between samplers, something like:
Sampler 1 - thread 1
Sampler 1 - thread 2
Sampler 2 - thread 1
Sampler 1 - thread 3
Sampler 2 - thread 2
Sampler 2 - thread 3
Upvotes: 0
Views: 492
Reputation: 168247
Take a look a JMeter Timers documentation:
Note that timers are processed before each sampler in the scope in which they are found
If you're using Throughput Shaping Timer to limit JMeter's throughput to some value it's absolutely expected that the Throughput Shaping Timer will introduce delay before Sampler 2.
It also introduces a delay before Sampler 1 as well (starting from 2nd iteration of the Thread Group)
Also I don't understand your "balanced" expectation, JMeter threads are absolutely independent and they're executing Samplers as fast as they can so unless response time is static and doesn't change you won't have any predictable execution order.
Of course each thread will execute Samplers upside down (or according to Logic Controllers) but when it comes to concurrency the "global" execution order is not something you can "predict" because response times may (and will) vary.
More information: A Comprehensive Guide to Using JMeter Timers
Upvotes: 0