I'm setup a jmeter test where I've added a CSV Data set Config with a list of IDs that I want the test to go through. The csv file has 10,000 IDs but when its running, it seems to run more than 10,000 tests.
I've set some of these setting as well:
Thread Group
Number of threads: 10
Ramp-up period: 1
Loop count: 1
CSV Data Set Config
Recycle on EOF: False
Stop thread of EOF: False
Sharing Mode: All threads
I then run the test via the cli like this:
./jmeter.sh -f -n -t /home/user/rtf-load-csv-list.jmx -l /home/user/logtest/test.log -e -o /home/userhtml/
when I do a wc -l /home/user/logtest/test.log, I see more than the 10,000 requests but there are only 10,000 IDs in the csv file.
why doesn't it stop after the initial 10,000?
You need to set Stop thread of EOF to True otherwise when all 10000 values will be used JMeter will continue sending the requests with default placeholder of <EOF>
More information: Using CSV DATA SET CONFIG
Related
let say i want to test the same http request for 10 users, 25 users ,50 users and 100 users separately and generate a report for each group of users.
One solution is to manually create as many thread group as a number of group of users:
ThreadGroup for 10 users
ThreadGroup for 25 users
...
is there any other solution to create this plan in jmeter?
Define the desired number of threads using __P() function like:
${__P(threads,)}
When you will be running JMeter in command-line non-GUI mode you will be able to pass the number of threads using -J command-line argument like:
jmeter -Jthreads=10 -n -t test.jmx -l 10-threads-result.jtl
jmeter -Jthreads=25 -n -t test.jmx -l 25-threads-result.jtl
etc.
Goal is to set the following and run a test plan with a "Thread Group" and "CSV Data Set Config" with 1000 lines/user accounts. So in 20 mins i want 10 threads to go through my 1000 line long csv file.
I set these settings in GUI mode and it does what i want:
Thread Group .
num of threads - 10 .
LoopCount=Forever .
scheduler=on .
duration=7200 .
"CSV Data Set Config"
Recycle on EOF? - False
Stop thread of EOF? - False
Sharing mode=All Threads
The problem is that i can't reproduce these setting from non_gui mode. I run it as follows and it only goes through # of csv lines equaling the # of threads set. So if i set 20 threads it will go through 20 lines of a file and exit.
-Jseconds=1200
-JthreadCount=20
-JcsvFile=../../user_files/j2kUsers.csv
-JloopCount=???
Use -1 as the property value, Thread Group has a Loop Controller under the hood and as per documentation:
The value -1 is equivalent to checking the Forever toggle.
You can also put the values to user.properties file like:
seconds=1200
threadCound=20
etc.
to avoid entering the values each time you run the script, the values van be overriden via -J command line argument at any time.
More information: Apache JMeter Properties Customization Guide
MY Jmeter Scripts runs for only 50 users even though i have mentioned 60 users in CSV , I have configured number of threads to 60 at the Thread Group Level
For the Thread 51 it starts showing - Stop Thread seen: org.apache.jorphan.util.JMeterStopThreadException: End of file detected
It is expected as you have:
Recycle on EOF: False
Stop Thread on EOF: True
Set Recycle on EOF to True and JMeter will re-use the same file from the beginning.
More information:
CSV Data Set Config
Using CSV DATA SET CONFIG
Scenario :
I have 2 slave machines configured , I want to send 50 users for slave 1, 60 users for slave 2 . I am using non GUI jmeter from command .
IP Address example :
Slave 1 : 1.0.0.1
Slave 2 : 2.0.0.2
Jmeter test plan configuration variables:
Number of threads :${__P(threads1,)}
Ramp-up period : ${__P(threads2,)}
Loop Count : ${__P(threads3,)}
I tried following command on jmeter start, but its not working as per expected:
jmeter -n -t POC1.jmx -R 1.0.0.1,2.0.0.2 -Gthreads1=50 -Gthreads2=1 -Gthreads3=1, -Gthreads1=60 -Gthreads2=1 -Gthreads3=1
Please help me if I am wrong in above command , please tell me how can I send 50 user threads , ramp up period 1 and loop count 1 for slave 1 and 60 user threads ramp up period 1 and loop count 1 for slave 2.
You won't be able to do it the above way as:
All remote slaves are executing the same test plan
You can pass global properties via -G command-line argument, so all the remote clients will be having the same properties set
The solution is to use different user.properties on different slaves, like:
Define amount of virtual users in your Test Plan using __P() function like:
${__P(threads,)}
On first slave add the next line to user.properties file (lives in JMeter's "bin" folder)
threads=50
On second slave add the next line to user.properties file
threads=60
Restart JMeter on slaves
You can also pass threads property value via -J command line argument while starting JMeter servers like:
On first slave
jmeter -Jthreads=50 -s -j jmeter-slave1.log .....
On second slave
jmeter -Jthreads=60 -s -j jmeter-slave2.log .....
See Apache JMeter Properties Customization Guide for more information on using JMeter properties, setting and overriding them
I have an aggregate report:
Do I have to add another listener or add anything else to the testplan?
For ex: consider the above snapshot:
I'm running 9002 samples, I just need to know the total time required for all the 9002 samples?
If your 9002 Samples are played in a sequence by only 1 user, just use a TransactionController that will contain your HTTP Request and you will have this.
If 9002 samples are played by different users then you can export the CSV file that contains the test results and use Excel to sum up the elapsed column.
To generate a CSV file, run test in NON GUI Mode using:
jmeter -n -l results.csv -t test.jmx