How to generate Transactions per Second graph, with the transaction controller only without including the child request - jmeter

I have run a JMeter script in the command line and exported the result in the .jtl format. I have multiple samples under Transaction Controller, when I imported the .jtl in the aggregate report, and saved the table data in CSV, it is showing individual samples instead of showing the overall response time of the transaction controller.
I wanted to generate the graph for Transactions per Second, with the transaction controller only without including the child request.
I have tried:
JMeterPluginsCMD.bat --generate-png E:\Outcode\ProtocolNow\Data\Jmeterlog\test-result-1.png --input-jtl E:\Outcode\ProtocolNow\Data\Jmeterlog\scriptresults.jtl --plugin-type TransactionsPerSecond --width 800 --height 600
It generated the graph as shown below which is hardly understandable.
I have the script structured as following:

I think you need to named parent transaction controler with a pattern like :
P01_SIGN-IN
P02_ADMIN_DASHBOARD
P03_APPLY
Then filtred with a regular expression P[0-9]+.* (start with 'P' and 1 or more digit and '' and others characters) and include-label-regex true
JMeterPluginsCMD.bat --generate-png E:\Outcode\ProtocolNow\Data\Jmeterlog\test-result-1.png --include-labels P[0-9]+_.* --include-label-regex true --input-jtl E:\Outcode\ProtocolNow\Data\Jmeterlog\scriptresults.jtl --plugin-type TransactionsPerSecond --width 1024--height 800

Just add --include-labels parameter and list all your Transaction Controller names there:
--include-labels sign-in,admin-dashboard,apply
full command just in case:
JMeterPluginsCMD.bat --generate-png E:\Outcode\ProtocolNow\Data\Jmeterlog\test-result-1.png --include-labels sign-in,admin-dashboard,apply --input-jtl E:\Outcode\ProtocolNow\Data\Jmeterlog\scriptresults.jtl --plugin-type TransactionsPerSecond --width 800 --height 600
More information:
JMeterPluginsCMD Command Line Tool Usage and Parameters
How to Use the JMeterPluginsCMD Command Line
Wouldn't it be easier to generate HTML Reporting Dashboard instead?

Related

What is the default location for JMeter report file?

Objective: I want to generate the Jmeter report file in CSV/XML format (irrespective of GUI or NON GUI mode, is it different?) with Avg, Std Dev,75th, 90th, 95th & 99th percentile included in. How to do it ? And where would be the default location of this file? Can it be changed mean the location of this report file?
JMeter's .jtl results file doesn't contain "Avg, Std Dev,75th, 90th, 95th & 99th percentile" and so on
If you want to create a file with results for both GUI and non-GUI executions - you need to use a listener, i.e. Simple Data Writer and set the filename and the desired path to the file there:
Once you have the file you can generate CSV version of the Aggregate Report listener using JMeter Plugins Command Line Tool like:
JMeterPluginsCMD.bat --generate-csv report.csv --input-jtl /path/to/your/test/result.jtl --plugin-type AggregateReport

Jmeter command line option issue

I am running a load test using jmeter command line and saving the result into csv file using -l command line option. After the test is completed, i see the data in the csv and while i upload it to a view result tree and try to check the failure response data in the response section, i dont see any response data noted in there. Is there something am missing here?
i have the following command
<path to jmeter bat> -n -t <jmx loc> -l <loc of result.csv> -j <path to jmeterlog> -Gparam1 -Gparam2 -Gparam3 -Gjmeter.save.saveservice.output_format=csv -Gjmeter.save.saveservice.output_format=csv -Gjmeter.save.saveservice.assertion_results_failure_message=true -Gjmeter.save.saveservice.data_type=true -Gjmeter.save.saveservice.label=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.successful=true -Gjmeter.save.saveservice.thread_name=true -Gjmeter.save.saveservice.time=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.successful=true -Gjmeter.save.saveservice.thread_name=true -Gjmeter.save.saveservice.time=true -Gjmeter.save.saveservice.connect_time=true -Gjmeter.save.saveservice.assertions=true -Gjmeter.save.saveservice.latency=true -Gjmeter.save.saveservice.connect_time=true -Gjmeter.save.saveservice.thread_counts=true -Gjmeter.save.saveservice.response_data=true -Gjmeter.save.saveservice.response_data.on_error=true -Gjmeter.save.saveservice.response_message=true -Gjmeter.save.saveservice.samplerData=true -Gjmeter.save.saveservice.requestHeaders=true -e -o <Reportpath>
By default JMeter uses CSV format for saving test metrics
CSV format is not suitable for storing response data due to eventual delimiters and line breaks. Moreover as per Reducing resource requirements chapter it's not recommended to store response data.
If you really need to save response data you need to switch JMeter's .jtl file format to XML and instruct JMeter to store it, it's controllable via the following properties:
jmeter.save.saveservice.output_format - defaulting to csv
jmeter.save.saveservice.response_data - defaulting to false
So you need to amend your command line to override these properties like:
<path to jmeter bat> -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true ......
in order to make the changes permanent add the corresponding lines to user.properties file
More information:
Results file configuration
Configuring JMeter
Apache JMeter Properties Customization Guide
Another option is adding a separate Listener like Simple Data Writer and configure it to save response data into a separate file:

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

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

How to print 95 and 99 Percentiles in the jmeter aggregate report command line?

I am trying to print 95 Percentile and 99 Percentile response times in the jmeter aggregate report from the command line
For this, I have tried the solution mentioned in here: Jmeter: Generating aggregate report through commnd line is not including 95% and 99% line in generated report
but that didn't work. I have tried editing the jmeter.properties file too.
Also, the other solution that I came across is to generate the ResponseTimesPercentiles graph using CMDRunner.jar in csv format but that gives all the values from 0-99.9 which I don't need. So is there a way I can customize the csv file to just have ReponseTimesPercentiles for desired values?
Also tried this command:
java -jarCMDRunner.jar --tool Reporter --generate-csv test.csv --input-jtl results.jtl --include-labels aggregate_report_99%_line --plugin-type AggregateReport
which didn't work.
So, is there any way that I can generate the 95% and 99 Percentiles in the aggregate report
The functionality is available by default starting from JMeter version 2.13
The behavior is controllable via the following properties:
aggregate_rpt_pct1=90
aggregate_rpt_pct2=95
aggregate_rpt_pct3=99
If you don't see percentiles like at the above image in your Aggregate Report - add the above lines to user.properties file.
NB:
The approach won't work on JMeter versions earlier than 2.13
JMeter restart will be required to pick the properties up, dynamic changes won't work.
You can do it from CMD, First make the plan using GUI, then in the bin folder of Jmeter, open CMD and run the following command.
jmeter -n -t "[PATH-FOR-PLAN]\myplan.jmx" -l "[PATH-OF-RESULT]\results.csv" -e -o "[PATH-OF-OUTPUT]\output"
The output folder will have a webpage with the aggregate report

Resources