In my jmx test plan I have 10 thread groups. How to run a specific thread group in jmeter non gui mode.
In the above pic you can see I have 10 different thread groups and use case is that we might need to run only 2 thread groups to start the initial stages of tests.
I appreciate your help in advance.
Try this way
If you want to target each thread running:
- ${__P(TCRCSP1,)} - For thread Group 1
- ${__P(TCRCSP2,)} - For thread Group 2
- ${__P(TCRCSP3,)}...so on...
Pass the below property in each Thread group "Number of Threads (users)" field.
Now from the command line pass the value Zero for the threads which don't want to be executed and for rest the number of users like:
-JTCRCSP1=2 -JTCRCSP2=0 -JTCRCSP1=0....so on
Hope this helps!
You can "disable" particular Thread Group by setting it's number of threads to 0 or to a negative value or to not a number, just take the same approach as you did for threads/rampup/iteration using __P() function
You can use Taurus tool as a wrapper for your JMeter test, a minimal Taurus YAML file which kick off a JMeter test plan with Thread Groups TCR CSP 5 and TCR CSP 6 enabled and others disabled will look like:
---
execution:
scenario:
script: test.jmx
modifications:
disable:
- TCR CSP 1
- TCR CSP 2
- TCR CSP 3
- TCR CSP 4
- TCR CSP 7
- TCR CSP 8
- TCR CSP 9
- TCR CSP 10
enable:
- TCR CSP 5
- TCR CSP 6
Related
I'm trying to do a randomised interleaved. A cut down version is as follows.
If I have:-
Thread Group
HTTP - A
HTTP - B
Random Controller
HTTP - 1
HTTP - 2
HTTP - 3
HTTP - 4
HTTP - 5
HTTP - 6
HTTP - 7
HTTP - B
I get mostly what I'm after i.e.
A,B,[Random from 1-8],A,B,[Random from 1-8] etc..
The problem is that if I set to 8 runs I don't always get each of 1-8 being run.
What I'm after is a blend with what Random Order Controller does (run each child once) but only one.
The problem with
Thread Group
HTTP - A
HTTP - B
Random Order Controller
HTTP - 1
HTTP - 2
HTTP - 3
HTTP - 4
HTTP - 5
HTTP - 6
HTTP - 7
HTTP - B
Is that it does
A,B,[Randomly run each of 1-8 once] then ends.
e.g.
A,B,7,1,6,3,8,5,4,2 then ends.
What I need is the numeric requests are randomly selected but only run once each with A & B always run as interleaved requests.
e.g.
A,B,7,A,B,1,A,B,6,A,B,3,A,B,8,A,B,5,A,B,4,A,B,2
Thoughts?
Put everything under Interleave Controller and tick ignore sub-controller blocks box:
If you want to run the whole A->B->X sequence 8 times you will need to set the number of loops to 24 under the Thread Group
In general using random execution order is not the best idea as tests should (or even must) be repeatable so maybe it worth considering using Switch Controller instead?
I am literally new to Jmeter and have just started exploring the tool. I am developing tests to perform load and stress test on a website where the peak load is 10000 users an hour. The stats are something like:
Hour
Index Users
0 2,728
1 1,656
2 1,123
3 1,058
4 1,174
5 1,710
6 3,524
7 5,808
8 7,505
9 8,432
10 9,113
11 9,577
12 9,814
13 9,674
14 10,028
15 9,781
16 8,445
17 8,156
18 6,193
19 6,175
20 5,922
21 5,641
22 4,694
23 3,068
I want to use the ramp up and ramp down feature along with Spike in load but unsure which thread group should i use? The Ultimate Thread group or the Stepping Thread group. Also unsure of how should i configure these thread groups. Any pointers would be greatly helpful.
Thanks in anticipation.
As per Stepping Thread Group documentation
This plugin is deprecated and should not be used. Use Concurrency Thread Group instead.
So Stepping Thread Group doesn't come into play.
Now you need to make a choice between Ultimate Thread Group and Concurrency Thread Group which should be simple as:
Ultimate Thread Group is about threads (or virtual users) which seems to be more applicable for your case
Concurrency Thread Group is about concurrency (or requests per second) which is very useful when you need to generate certain throughput in terms of hits per second rather than need to mimic certain amount of virtual users.
So I would go for the Ultimate Thread Group. With regards to "how to configure" - just use the above values as they are, example configuration for first 8 hours would be something like:
You can install Ultimate Thread Group using JMeter Plugins Manager.
My test plan is as following
- Test Plan
- Thread Group (No of Threads: 4)
- HTTP Request Defaults
- HTTP Cookie Manager
- CSV Data Set Config(Login Information) [4 user login]
- Simple Controller
- HTTP Request(GET: Open Login Page)
- HTTP Request(POST: Login auth)
- Loop Controller
- CSV Data Set Config(Operation Information) [8 operation data]
- HTTP Request(GET: Open Operation page)
- HTTP Request(POST: Commit Operation)
- HTTP Request(POST: Logout)
In this plan suppose I provide 4 users and 8 operation data.
What it doing is running 8 operation for 4 users each in total of 8x4=32 operations.
How could I make this as following
1st user will do 2 operations
2nd user will do 2 operations
3rd user will do 2 operations
4th user will do 2 operations
I want to provide user session wise different operations that 4 users will do number of transactions but the transactions will not be same.
How can I achieve this?
If I'm getting your test scenario correctly you can just set the "Sharing Mode" of your CSV Data Set Config (Operation Information) to Current Thread Group.
Current thread group - each file is opened once for each thread group in which the element appears
If you want more precise control I believe Switch Controller is what you're looking for, using it you can select which user will go for which execution branch.
See Running JMeter Samplers with Defined Percentage Probability article for more information.
As requested, I am posting my solution. Below is the test plan story.
Test Plan
Thread Group
I used only 1 thread in my thread group and 4 in the loop count as shown below.
Loop Controller
CSV Config for the both the files
Output
In JMeter, I have a requirement where I want to run a particular thread group after all the other thread groups complete their run, I know the tearDown thread group has the similar behavior but unfortunately, the logic has to be part of my regular thread.
Let's say there are 4 thread groups A,B,C & D in my test plan and I want the thread group D only to be executed after A, B & C will complete their run.
Can we achieve this without using "setup, teardown & Run groups one at a time" ??
Problem ScreenShot:
I can suggest 2 options:
Use Inter-Thread Communication Plugin. See example test plan for details.
If for some reason you are not in position to use JMeter Plugins you can achieve the same using JMeter Properties like:
When Thread Group A finishes set a JMeter Property, i.e. ThreadGroupADone=true using __setProperty() function like
${__setProperty(ThreadGroupADone,true,)}
In Thread Group D:
Add While Controller at the beginning of the Thread Group and use the following condition:
${__javaScript("${__P(ThreadGroupADone,)}"=="false",)}
Add Test Action sampler as a child of the While Controller and configure it to pause for a reasonable amount of seconds, i.e. 5 so each 5 seconds While Controller will check ThreadGroupADone property value and if it is still false - sleep for another 5 seconds. When property value will become true - Thread Group D will proceed.
I run test plan by distributed method in 3 remote machine with config as below:
3 Thread Group: Each 100 users - loop 1
Each thread group have 5 request
When i run on each remote machine, i get 500 samples in summary report. But when i run on 3 remote machine in same time, report just display 800 - 1000 samples.
What is problem in my case?
You moT probably have one of the 3 servers that is not reporting the SampleResults to the client.
check jmeter.log of each server.