Interleave controller Issue - JMeter - jmeter

I am trying to simulate a sequential call to couple of webservices by putting them under Interleave controller. Although I have unchecked "ignore sub-controller blocks", jmeter still runs only one of the controllers living under interleave controller and alternates it for each iteration. What I need is a sequential call to all .
Any help is appreciated. Cheers

The Interleave Controller is running as it should do. It will alternate through one web service for each iteration
If you want a Sequential call to both web services on each request, then just put them directly under the Thread Group - without any logic controller or keep a Simple Controller
Unless I'm misunderstanding your question, why do you need the Interleave Controller?

Jose
Thanks for the answer. Keeping them directly under thread group did not call them sequentially. You can try it. I currently have about 10 webservices (let us call them 1..10) some are heavy and some are light there by resulting in different response times. However, I would like to run these in order that is from 1 to 10.
Directly placing them under thread group did not call them sequentially, so I used interleave controller with "ignore sub-controller blocks" unchecked.

Related

Different between Critical Section Controller and Simple Controller in JMeter

Could you tell me the different between Critical Section Controller and Simple Controller in JMeter?
I don't understand about them clearly.
I created example but their results are same.
Simple Controller does nothing but group the samplers below it
lets you organize your Samplers and other Logic Controllers. Unlike other Logic Controllers, this controller provides no functionality beyond that of a storage device
While Critical Section Controller used to block threads executing in parallel
ensures that its children elements (samplers/controllers, etc.) will be executed by only one thread as a named lock will be taken before executing children of controller.
Note that it doesn't work on distributed testing
Critical Section Controller takes locks only within one JVM, so if using Distributed testing ensure your use case does not rely on all threads of all JVMs blocking.
If you work with one thread you won't notice the difference between controllers
Simple Controller is just a container, you can put Samplers as a child of it. It doesn't do anything at all, the only valid use case is using it in combination with Test Fragment and Module Controller when you want to avoid code duplication
Critical Section Controller ensures that its children are executed by only one thread at a time, it can be used a a global lock to avoid race conditions (for example concurrent writing to the same file by several threads or something like this)

How do I test multiple parallel threads per-user in JMeter?

I am using JMeter to simulate a user running our Android app. This app has several background threads that poll different services at different intervals. I'd like to test a large number of these types of users. Is there a way to do that in JMeter?
If "different intervals" come into play the only solution I can think of is using different Thread Groups for representing different services consumers as due to JMeter's threads model all Samplers inside a single Thread Group will act at a speed of the "slowest" sampler and given the application has "background" services these calls need to be non-blocking.
There are other approaches like using Throughput Controller, Weighted Switch Controller, etc. but they fall under the aforementioned limitation.
I may have figured it out. I use a combination of Parallel Controller, and nested within those are Loop Controllers with a Flow Control Action that pauses for the right number of seconds. I'll leave this question open for a bit in case anyone has a better recommendation.
See: https://github.com/Blazemeter/jmeter-bzm-plugins/blob/master/parallel/Parallel.md

How can i execute several scenarios simultaneously without using several thread groups

I have created seven thread groups which execute different scenarios in one application. I'm trying to optimize my scripts in order to be more maintainable and easy to master when someone else uses them.
The thing that i cannot figure out is how can i combine those thread groups into one or two and to still have the seven different execution paths and the possibility to control them, by control i mean to set how many users to execute scenario 1, how many to execute scenario 2 etc. till 7.
Currently the test plan looks like this
If you don't want several thread groups for some reason the alternative options are in:
Throughput Controller - with different global executions or execution percentages
Switch Controller - which provides random weighted values (in some cases Throughput Controller doesn't guarantee that samplers in scope will ever be executed)
See Running JMeter Samplers with Defined Percentage Probability guide for more information on configuration and implementation.
Well i just figured out how to do that i have added a Loop controller a Random Order Controller as child of the loop controller. And i have put seven throughput controllers as child of the Random Order Controller so now everything looks fine

How to run jmeter samplers sequentially for multiple requests

I am trying to run http samplers sequentially for multiple requests. Where the output of 1 API response is the input of next API request. My concern is when I run with 5 users (for. e.g), then at given point of time it first executes 1st API with 5 users then second API with 5 users, in this process the API where input is required gets lost. Please help me on this. I need a solution, where all the samplers are first executed for first user, then for second thread all the samplers are executed and so on.
Dzizu is correct, threads are independent so you are going to run into problems with this approach.
Since you are using 5 users across the test, it would be better to have one thread group with 5 users, and then have Simple controllers (or Transaction controllers) that hold the HTTP samplers and whatever else you are using. This will ensure that the samplers are executed concurrently, but they can still share data if required.
Simple example below:
Threads usually are independent. The easiest way in my opinion is to put full process in one thread and then multiply threads in thread groups.
Eventually I tried to solve this by using loop count option. For example if I want to simulate 5 users in 1 second, I set values as loop count=5,threads=1,ramp-up=.2.
This worked for me so give it a try.
Use the Transaction Controller or Simple Controller to group your samplers together and run them in sequence without worrying about the number of threads. For me, it is working as expected :).

Loop interleave controller

I am trying to use the interleave controller inside another controller (ForEach OR Loop OR any other) such that each of the sampler (which is HTTP request) under Interleave controller is executed once and the test exits the "outer" controller once the last sampler is done.
My test plan looks somewhat like show below
test plan
--Loop controller ( with loop count = num of requests in Interleave Controller)
----Some test elements
----Interleave Controller
--------HTTP requests (count = n, with some differences)
----Some More test elements
The test plan is to test multiple test scenarios of a lot of REST services (having some changes in the request data etc) so some services might have 2 scenarios some might have 10.
Thus is there any way of getting the number of samplers under the interleave controller ? OR a better design to my test plan.
Thanks
Have a look at the interleave documentation as it explains nicely how it works and how one sampler, going from top to bottom, is executed per iteration. If you want only one sampler executed randomly (per iteration) you can use the random controller.
Note: Those controllers don't stop by them selves if all children have been executed. They start all over again. If you want to stop you have to add different logic to make that happen.

Resources