I am checking a load with a minimum of 2000 threads in JMeter in the command line mode. I am using Graphic Generator also to get nice graphs. But at the end of the execution, I am getting an aggregated result inside the graphics generated results. What I actually wanted is the time taken for each thread in a nice format either in CSV or in Graph.
The command I am using is
sh jmeter -n -t /Project/Tests/test.jmx -l /Project/Tests/results.csv
Even though the results.CSV generates the whole but its not in a nice format. Can someone suggest me any other better options if available? Because my program is expecting each thread to return within 7 seconds if not my program will discard that thread. Hence i need to know how many threads are returned within 7 seconds.
Actually you should already have what you need.
You can figure out threads response times from .jtl results file, look into elapsed column. You can sort and see the most time-consuming sample results and how many of them exceed 7000 ms
There is Response Times Over Time graph which can show the trend of response times while the test is running
There is Response Times Distribution graph which can show the statistics of response times per number of requests executed
Both plugins can be installed using JMeter Plugins Manager
And finally you can use Duration Assertion so JMeter would fail requests which last longer than 7 seconds automatically
Related
Is there any way that we can find out average response time for last one hour from the script which performed for 3 hours??
Hi, so I have script which is timed to run for 3 hours. I want aggregate report to find out average response time. But I want response data from the last one hour run. I want to find pout the average response from the transactions which where performed in last hour of run. Is this possible and how?
Depending on the reporting system you're using:
If you're reading the .jtl results file you can use Filter Results Tool to "cut" first 2 hours of the test execution like:
FilterResults.bat --output-file last-hour-only.jtl --input-file original-test-results.jtl --start-offset 7200 --end-offset 10800
in this case last-hour-only.jtl will contain only sample results collected between 2nd and 3rd hours of the test run
Filter Results Tool can be installed using JMeter Plugins Manager
If you're using HTML Reporting Dashboard you can use jmeter.reportgenerator.start_date and jmeter.reportgenerator.end_date properties to set the time frame where the "interesting" part of results is.
So I'm working on JMeter and I tried to run a test plan (with only one script: edureka.co that further has 6 scripts when viewed in Result Tree like https://www.edureka.co/-0 https://www.edureka.co/-1 till https://www.edureka.co/-5) with concurrency thread group with 100 threads, 200 sec Ramp-up time and 2 Ramp-up steps. I ran this test plan in Non-GUI Mode of JMeter and to my surprise I got 7880+ records in my CSV File. Max I should have gotten like 600 records.
Anyone can tell why I'm getting this much records in my CSV file and what does the scripts https://www.edureka.co/-0, https://www.edureka.co/-1, https://www.edureka.co/-2 till https://www.edureka.co/-5 mean. (they show up even with 1 thread)
For these -0, -1, etc. there is an explanation:
first couple is being caused by redirection to https://www.edureca.co
next requests stand for images, scripts and styles - so called "embedded resources"
this is absolutely normal as long as JMeter sends the same requests as the real browser does, the only piece of advice I can give is to add HTTP Cache Manager to your test plan as real browsers download these embedded resources only once.
Max I should have gotten like 600 records - this is not true, the number of "records" depends on the application response time and related metrics (connect time, latency, network bandwidth, etc). If you want to limit the number of results to 600 only either switch to normal Thread Group with 100 threads and 6 loops or use Throughput Controller to limit the number of requests to 600 only
I have tried but have a doubt that whether the below-mentioned specification is equivalent to 4000load or not.
the number of threads-100,
ramp-up period-10 secs,
loop count- 40, then
which is equal to how much load??
You are loading 100 concurrent threads, the loops just adds more execution time.
So it isn't equivalent to 4000 concurrent threads hitting your server
I don't know what do you mean by 4000load, your test will send 4000 requests per each Sampler which is in your Thread Group as fast as it can. The actual test duration will depend on your application response time but will not be less than 10 seconds.
You might want to take a look at Transactions per Second and Server Hits per Second charts to see how many requests your configuration delivers, both charts can be installed using JMeter Plugins Manager
Also you can generate HTML Reporting Dashboard which will have consolidated aggregate view of your test results.
I have been trying to figure out how to measure the amount of time it takes a thread (virtual user) in JMeter to fully complete. I'm not necessarily concerned with response times at the moment. The API that I'm attempting to load test works in an async fashion. I make a request to start a job, I'm given a job id then I use that job id to check the status of said job until it's complete. I'm interested in knowing how long it takes for each job to complete i.e. when the job starts (thread is created) and when the job is completed (thread is done working).
I've seen several people suggest using the Transaction Controller in similar situations but that, unless I'm misunderstanding, gives me the total response time for all the requests in the "transaction" which doesn't help me.
This is what I have setup so far in JMeter:
Which actually works great, I make the initial request to submit the job and extract the job id. In a while loop I check the status of the job using the extracted id every 10 seconds (Constant Timer) until the job is complete.
This is what the aggregate report looks like for 5 concurrent users, I can also make the labels be the same so that it's compacted further but none of this information tells me how long a thread took. From the number of samples I can surmise that half the threads took roughly 10 seconds to complete and the others I can multiply by 10 seconds (sleep timer) and get a rough estimate how long it took to complete but that would be difficult to do (or at least time intensive) for a couple hundred threads. I was really hoping JMeter had something out of the box that would give me this information in a nice report format.
I've also seen suggestions that the only way to get this type of information is to parse logs, was just wondering if anyone has solved a similar problem.
Your question contains the answer, just measure it
Add JSR223 Sampler to the beginning of your Thread Group and put the following code into "Script" area:
SampleResult.setIgnore()
vars.putObject('startTime', System.currentTimeMillis())
the first line tells JMeter to not to store the JSR223 sampler result (as I believe you don't need this) and the second line saves current timestamp into ${startTime} JMeter Variable
Add another JSR223 Sampler to the end of your Thread Group and use the following code there:
SampleResult.setIgnore()
def end = System.currentTimeMillis()
def start = vars.getObject('startTime')
log.info('Thread ' + (ctx.getThreadNum() + 1) + ' elapsed time: ' + (end - start))
here we get the current timestamp after the job ended and subtract it from the previous timestamp store in the first JSR223 Sampler. The delta is printed to jmeter.log file however you might rather want to store it into another JMeter Variable and expose it to the results via Sample Variables property so it would be added to .jtl results file
Demo:
See Top 8 JMeter Java Classes You Should Be Using with Groovy to learn more about what these SampleResult, vars, and ctx shorthands mean
with jmeter performance testing. How we can know the no of users taken maximum time in summery report.As we can just know one of the sample taken taken this maximum time but we can not find the no of users or samples faced this maximum time?
For this you can generate a dashboard report using JMeter Command Line : Generating-Dashboard. Using either of the following commands, depending upon whether you want to generate after the test completes or at one go.
jmeter -n -t <path_to.jmx> -l <log.jtl> -e -o <dashboard_folder>
or
jmeter -g <log.jtl> -o <dashboard_folder>
Then Check:
Response Time Over Time Graph:
It seems that you're looking for Response Time vs Threads chart which allows analysis of the correlation of increasing number of threads (virtual users) with increasing response time per request/transaction:
You can install Response Time vs Threads chart as a part of KPI vs KPI Graphs bundle using JMeter Plugins Manager