how jmeter can distribute outbound traffic between the two user groups. For example the group #1 gets 30% of the traffic and the group #2 of 70%.
Not sure I understand your requirement as Oliver did, for me you just setup a Thread Group with 30% of the total threads and the second one with 70%.
Otherwise, you can read this article with is another way to do the way Oliver understood:
http://www.ubik-ingenierie.com/blog/jmeter_control_percentage_of_sampler/
It shows how to distribute but contrary to Throughput Controller it ensures at least one sample is executed.
There are various ways you can do this. You could use a Throughput Controller which is pretty simple, or, if you only ever want one request to fire, you could create a simple Random Variable, set it as a random number between 0 and 10 and then use an If Controller to control execution.
Something like:
Thread Group
- Random Variable 0 - 10
- If Controller set to ${myVar} <= 3
HTTP Sampler
- If Controller set to ${myVar} > 3
HTTP Sampler
Related
I have 250 users ,and around 60000 sample counts should be hit including all the requests. Whichever request is supposed to get huge sample count,I have put those request within loop count,But the requests outside the loop are getting executed only 3-4 times which is less than expected. How do I handle this?
It is not very possible to provide the comprehensive answer without knowing what you're trying to achieve and seeing your test or at least Thread Group configuration
The easiest option is moving the requests which you want to execute more times into a separate Thread Group
If the requests have to stay in one Thread Group you can control the frequency using Throughput Controller
If the logic is more complex - consider using Switch Controller or Weighted Switch Controller
Customer has 2 scenario's. Both have more then 1 flow.
For example.
Tickets
a. Buy Tickets: 1500 concurrent users
b. Browse the website: 1500 concurrent users
View
a. Flow 1: 750 concurrent users
b. Flow 2: 750 concurrent users
c. Search the website: 500 concurrent users
Scenario 1 must be run before scenario 2 can be run.
Now is my question: how can I put this in Jmeter?
Normally you should use different Thread Groups to represent different groups of business users. If you need one Thread Group to be executed before the other(s) either go for setUp Thread Group or tick Run Thread Groups consecutively on Test Plan level, this way Thread Groups will be executed upside down
If you need yet another level of distribution inside the Thread Group you can use Throughput Controller which controls how often its children will be executed. So if you put 3 flows under 2nd Thread Group you can use:
2000 threads (virtual users) in total
Throughput Controller 1 - 37.5% of threads will be executing flow b
Throughput Controller 2 - 37.5% of threads will be executing flow c
Throughput Controller 3 - 25% of threads will be searching website
Example test plan outline:
More information: Running JMeter Samplers with Defined Percentage Probability
It's important to note that, although the mentioned techniques will work in terms of configuring the number of VUsers, they will not guarantee that the Avg TPS per requests will match the same proportion. I've mentioned this in another post:
"It's common a misconception when trying to achieve a targeted percentage of requests to instantiate Vusers in the same proportion. This only works if the Avg Response Time (ART) of each type of request is the same. It's very unlikely that, for example, the search request ART will the same RT as the registration request. As a consequence, after executing the test for a certain amount of time the actual proportion of requests (of each type) will be the different than the targeted request proportion."
I'm having the following scenario:
Thread group
1: http request 1
2: http request 2
3: http request 3
4: http request 4
I'm running this threadgroup with a fixed number of threads in a loop for a specified duration.
Now I'm trying to figure out a way to only execute a certain request each thread loop for a certain percentage.
Let's say I want to have something like 50%: request 1 & 2 and 50%: request 3 & 4.
Also within those 50%'s that I would like to have another dimension like request 1: 75% request :2 25% and request 3: 95% request 4: 5%
i'm not looking to divide the number of threads here (which a troughput controller would do) but to take a specific path each time the threadgroup loops arround.
Is there any controller that can do this out of the box? Or am I better of using an IF controller based on a variable that I up each time (perhaps even the threadloop number which I mod) and then run the correct "scenario" based on that loop number?
Any tips, let me know!
I think you're looking for a Switch Controller
If you
Provide ${__jm__Thread Group__idx} pre-defined variable as the "Switch Value"
Add i.e. Simple Controllers and name it like 0, 1, etc. and put the Samplers you want to execute under the Simple Controllers
This way 1st Thread Group iteration will trigger the children of the Simple Controller with the name 0, 2nd Thread Group iteration will kick off the children of the Simple Controller with the name 1, etc.
Sub-distribution can be established either the same way of using i.e. Throughput Controller. See Running JMeter Samplers with Defined Percentage Probability to learn more about different approaches to distributing JMeter's requests.
Requirement: Load for a total of 100 users within an hour. Each user hits 3 different services different number of times at the same time.
for example: user 1 is going to hit service1- 3 times, service2- 5 times and service3 - 4 times at the same time. Same will be repeated for 100 users over 1 hour.
I have a thread with users-100, rampup time -60 (min). and then I am using parallel plugin and within that plugin created those 3 different sample requests. But I don't know how to configure the number of times, each of those service will be called per user at the same time.
Your test scenario doesn't make sense, normally 1 thread (virtual user) can hit only one endpoint at a time. The use when user executes 3 same requests to the same endpoint looks very suspicious as well. So I would recommend reconsidering your scenario and implement distribution using one of the following approaches:
Use different Thread Groups for different requests
Use Throughput Controller
Use Switch Controller
Use Weighted Switch Controller
If however I'm wrong and you're trying to implement some form of AJAX testing when requests are being triggered at the same time and in parallel - example test plan would be something like:
I have Jmeter script with two thread group with two different API calls. My requirement is Thread Group 1 is to achieve 10 throughput per min and Thread Group 2 is to achieve 50 throughput per min. So I used constant throughput timer in the script.
When I run the test with above setting, thread group 2 is not achieving the expected throughput(50 per min) instead its only achieving the whatever the throughput defined in thread group 1's constant throughput timer(10 per min). I have kept 'this thread only" setting in the Timer.
Am I missing anything or some other setting needs to be done to achieve my requirement?
Your two groups are having different threads but you have also used Interthread communication Pre and Post processor's which works on FIFO concept as shown below.
For more info check this
Until its FIFO you cant achieve it. Instead, use properties to set the variables and get them in other thread. Check this.
Hope it help.