Jmeter: Threads multiplied by loop count does not match number of samples - jmeter

I am running some tests in Jmeter with the following values -
Number of Threads = 50
Number of Loop count = 133
I would expect the number of samples (column Count in the Summary report) to be 50*133=6650 but I see this as only 3220.
I tried this test with:
Number of Threads = 50
Number of Loop count = 100 and this time also I got the number of samples (Count) as 3221
I tried with:
Number of Threads = 30
Number of Loop count = 133 and this time also I got the number of samples (Count) as 3220
For some reason, Jmeter is limiting the max number of samples to a number around 3220. Why is this happening?
Regards
Ramesh

JMeter doesn't have limitation on number of samples, if it is, it would be something like 2 billion.
Try the following:
Re-run your test in non-GUI mode
Open JMeter GUI. Don't open any .jmx file
Add Summary Report Listener
Click Browse button and open .jtl file which you specified by -l parameter in step 1
Check if real samples count matches your calculation.
It should be equal. If it isn't make sure that i.e. you are not using Test Action Sampler which stops the test on certain condition or CSV Data Set Config with Stop thread on EOF set to true or whatever.
If the problem still persists and none of above recommendations help update the issue with your jmeter.log file

Related

Rps is very low compare to given number of users

I am new in load testing , For understanding the statistics generated by locust , I give very low load to an API, See my below snapshot, there is only 1 user run against given API and it finish its process within milliseconds but my RPS is showing 0 . I am expecting RPS value as 1 because the request able to finish within one second.
Test Result
See my code below and please note that I am not giving any wait_time in my code and it is a very simple code which I wrote.
Main code
config file

Forcing thread to take a particular value from CSV and does not change till the test is completed

I have CSV file which contains Mobile Number, for e.g. number.csv
1276543281
1276543282
1276543283
1276543284
1276543285
Configured CSV Data Set Config with following options
Recycle on EOF? : True
Stop Thread on EOF? : False
Sharing Mode: All Threads
Thread Group settings are given below:
Number of Threads: 5
Ramp-up: 1
Loop Count: 10
Now, when I execute it, threads take any number from CSV and on next iterations based on the thread completion takes the value from CSV.
I want to force Thread1 to take 1st row, Thread2 to take 2nd row and so on... till the loop count is reached or the duration is reached.
You won't be able to achieve the described behaviour using CSV Data Set Config, with the above configuration each thread will pick up the next value on each iteration.
There is no guarantee that 1st thread will pick 1st line and 2nd thread 2nd line.
If you want to "stick" each thread to the respective line from CSV you should use __groovy() function instead like:
${__groovy(new File('/path/to/your/number.csv').readLines().get(ctx.getThreadNum()),)}
where ctx stands for JMeterContext class instance, see Top 8 JMeter Java Classes You Should Be Using with Groovy article for more information.
you can achieve this solution by two ways
You can achieve by keeping the CSV dataset config only once in the controller
You can achieve by using Baolu CSV Data Set Config, in your scenario, set block size for each threads as 1
In these two scenarios, the value picked in first iteration those same values would be picking in next iterations.

How to aggregate the results from different machine in Jmeter?

I have to run 1200 users to support my application.
We are running from 4 different machines and from Each machine we are running 300 users.
From Each machine we are getting .jtl files and it is size more than 300 MB..
we are able to get the Aggregate report by adding Listeners and browsing that .jtl files.
Due to the size of jtl files, every one has aggregate csv files only from 4 machine.
Label #Samples Average Median 90% Line 95% Line 99% Line Min Max Error % Throughput Received KB/sec Sent KB/sec
(Machine 1) TOTAL 34114 7200 1747 11853 60155 80773 0 240417 12.18% 14.61536 144.66 23.35
(Machine 2) TOTAL 35537 7927 1758 24698 60550 76834 0 150719 15.33% 14.79504 140.71 23.06
(Machine 3) TOTAL 34447 7189 1750 12280 60220 76963 0 155425 12.24% 14.72585 145.78 23.55
(Machine 4) TOTAL 34454 7316 1748 13595 60557 76975 0 150490 12.60% 14.69896 144.45 23.35
Eg.., Average = (7200+7927+7189+7316)/4 = 7408
How to present as a single report?
It is just some up all columns from 4 machines and divided by is the only way..If it is present in a way, is it correct report?
Or any other way?
Thanks,
You can switch to running your test in Distributed Mode i.e. using 1 master node and 4 slaves. In this setup you will have single results file on "master" host
If you do not plan to re-run your test in future and would just like to convert 4 results files into a single "uber" results file you can use Merge Results tool which main use case is to compare results of different test runs, however you can use it to combine multiple results files into one, just use the same Prefix Label.
You can install Merge Results tool using JMeter Plugins Manager

How to save start time of all the individual samples in my jmeter test and use that in JSR223 Listener

Im using influxfb to save the result of my jmeter test.
bellow is the part of code in JSR223 Listener where im in need of your help.
result = new StringBuilder();
result.append("Thro_5,")
.append("label=")
.append(escapeValue(sampleResult.getSampleLabel()))
result.append("count=")
count=sampleResult.getSampleCount();
result.append(count)
result.append(",duration=")
dur1=sampleResult.getStartTime();
result.append(sampleResult.getEndTime()-sampleResult.getStartTime())
*****here code to write data to influxdb*****
I'm trying this code in which i want to know the total duration sample has taken till now to calculate throughput.
a=sampleResult.getEndTime()-sampleResult.getStartTime()
.append(",throughput_=")
.append(totalSamplecount/(a/1000))
Last line in the above code , i.e sampleResult.getStartTime() ,it should be the starting time of a sample in the first loop.
If i have 3 samples in my test ,having loop count 3 ,i want to save the starting time of each sample in the first iteration and use that value in the calculation of throughput of each samples.
Then while i'm in 3rd loop i want to know the total duration it has taken so far from the first iteration.And totalsamplecount/duration
As far as i know sampleResult holds the result of current sample.
I'm stuck in 2 points:
in saving the start time of each samples and use it later for each iteration to calculate the duration.
In saving the total count of individual samples executed till now.

Test iteration setting in loadtest using vs 2010

I wanted to test my application for 250 concurrent users, I have some doubts about the load test setting.
What should be the correct setting to achieve the above...
I have set the Max user count as 250 and test iteration in run setting as 1, So will it send 250 virtual request ???
or
I have to set the Max user count as 250 and test iteration in run setting as 250
Here are some explanations about load test settings:
In the Constant Load Pattern you set how the load test will create your virtual users.
If you Set Pattern = Constant then visual studio will create 250 virtual users without meaning that you need them. So if you have 250 users and only 10 Tests Iterations, only 10 users will send a request
If you set Pattern = Step you set an initial number of virtual users and they are increased at each test iteration by the Step User Count. Again, you may create more users form those you will actually need.
In the Run Settings there are 2 basic settings you should focus:
The Test Iterations, which describes the total number of requests (tests) that will be executed from all the virtual users. So, if you set this value 500 and you have a Constant Pattern of 250 virtual users, then each user will send 2 requests. Perhaps some will send 3 and some others 1, but the total tests (requests) will be 500.
The Use Test Iterations setting which describes whether the test should be executed according to the Test Iterations settings (previous scenario) or according to the Run Duration setting. If you set this property to false, then all virtual users will try to execute as many requests/test as they can in the Test Duration time.
So, answering to your questions:
I have set the Max user count as 250 and test iteration in run setting as 1, So will it send 250 virtual request ???
No, it will send only one request. Set the Test Iterations = 250 if you want 250 total tests .
I have to set the Max user count as 250 and test iteration in run setting as 250
This will send 250 total tests but it doesn't mean that they will be concurrent. The 250 virtual user will not created at once, it depends of their initial number. So, if you want 250 concurrent tests you must set the Pattern = Constant.

Resources