How to generate the total time required for the entire test plan in Jmeter - jmeter

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

Related

jmeter running more tests than in CSV list

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

How to to get multiple output files with non-gui JMeter?

I need to have 2 output files, one with successes only and another one with failed status. First file must be in CSV format and another in XML (it must contain response data with response body). The solution must be in the non gui mode.
My current solution with one file:
jmeter.bat -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true -n -t JMeterFile.jmx -l OutputFile.jtl
I don't know how to make two output files with different content.
For the default .jtl file in CSV (for example suitable for generating HTML Reporting Dashboard) format run JMeter in command-line non-GUI mode like:
jmeter.bat -n -t JMeterFile.jmx -l OutputFile.jtl
For getting another file with detailed information on errors add a Listener, i.e. Simple Data Writer would be a good choice and configure it like:
This way you will get 2 files:
OutputFile.jtl - in CSV format with all metrics for all Samplers
Errors.xml - in XML format for failed samplers only having response data (you can tick other boxes as well if you want more details)
More information: How to Save Response Data in JMeter

Jmeter - Run .jmx file through command line and get the summary report in a html, csv as well as XML output - All three

Currently, I am giving below on the command line. When I add CSV, it doesn't give output in csv format. Can you please provide complete command for all three outputs.
Sample 1:
!JMeter -Jjmeter.save.saveservice.samplerData=true -Jjmeter.save.saveservice.response_data=true -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.responseHeaders=true -Jjmeter.save.saveservice.requestHeaders=true -n -t ProgramServices.jmx -l JmeterReports\TestReport.xml -j JmeterReports\jmeter.log
Sample 2:
JMeter -n -t Creation_SLW.jmx -l JmeterReports/TestReport.csv -e -o JmeterReports/htmlReport/ -j JmeterReports/jmeter.log
As per Generating Report Dashboard documentation
The dashboard generator is a modular extension of JMeter. Its default behavior is to read and process samples from CSV files to generate HTML files containing graph views. It can generate the report at end of a load test or on demand.
So as of latest JMeter 5.4.1 you can only generate the HTML dashboard from .jtl file which is in CSV format and the contents of the file has to be inline with the Result File Configuration
I would recommend reverting your changes and going for CSV + HTML Reporting Dashboard with the default configuration (or with your necessary amendments)
If you need XML with the full data as well - you can add i.e. Simple Data Writer to your test plan and specify the desired file name and the metrics which you want to store:
More information: How to Save Response Data in JMeter

How to get the result csv file in between the test run during performance testing using Jmeter?

I am using Jmeter Version 4. For example I am running test for four hours, And during the test run, I want the result file for the test ran from 2nd to 3rd hour.Is it possible to get the result file like that?
I know that we can get the result file from starting to 3rd hour.But I want from 2nd to 3rd hour.
Can I get that.Please suggest?
The easiest option is going for Filter Results Tool which has --start-offset and --end-offset parameters specifying how to "cut" the original .jtl file (in seconds) so you could do something like:
FilterResults --output-file from2ndto3rd_hour.jtl --input-file /path/to/large/result.jtl --start-offset 7200 --end-offset 10800
Filter Results Tool can be installed using JMeter Plugins Manager:
Ideally, you should use this solution that allows you to have live results:
https://jmeter.apache.org/usermanual/realtime-results.html
But if you want to work with CSV, your best bet would be to modify the timestamp format by adding to user.properties :
jmeter.save.saveservice.timestamp_format=yyyyMMddHHmmss
And ensure JMeter flushes on every write to avoid having partial lines:
jmeter.save.saveservice.autoflush=true
And then use grep, for example to take results between 15 and 16h on 26 january 2019
grep "2019012615" results.csv > filter.csv
If you don't want to rely on grep, then you can take the whole file and generate the HTML report using :
jmeter -Jjmeter.reportgenerator.start_date=20190126150000 -Jjmeter.reportgenerator.end_date=20190126160000 -g results.csv -o reportfolder

create summany report in jmeter from command line

I am using Jmeter version : 2.10. I test has couple of Http samplers. When i run the test from command line
jmeter.bat -n -t "C:\Jmeter Projects\TestSuite.jmx" -l "C:\Jmeter Projects\testResult.xml"
the result of the test creates "testResult.xml" but when i open it the data is in cvs format
1384844043490,1527,HTTP Request-1,200,OK,Thread Group 1-1,text,true,2776,1527
1384844045046,350,HTTP Request-2,200,OK,Thread Group 1-1,text,true,395,350
1384844045411,4890,HTTP Request-3,200,OK,Thread Group 1-1,text,true,977530,4888
1384844050304,286,HTTP Request-5 ,200,OK,Thread Group 1-1,text,true,4091,28
There is no header. I do not mind csv format if i can get the table header or the .jtl format.
I think it was since JMeter 2.8 that the default JTL format is CSV as opposed to XML. I didn't try this myself, but this should work for you:
-Jjmeter.save.saveservice.output_format=xml
Just make the changes as suggested by Alon and execute your test plan. Saving report as .jtl file.
jmeter.bat -n -t "C:\Jmeter Projects\TestSuite.jmx" -l "C:\Jmeter Projects\testResult.jtl"
Then using JMeter plugins generate the kind of report you wish for.

Resources