JMeter MergeResults is not handling timeStamp label correctly (millis) - jmeter

Created two dummy sample projects as (dummy1.jmx and dummy2.jmx) and executed below commands with default settings (JMeter 5.3 default installation with all required plugins installed).
#> jmeter.bat -n -t dummy1.jmx -l dummy1.csv -j dummy1-jmeter.log to execute load
Generated report and timestamps look perfect both in dashboard and graphs
**#> jmeter.bat -g dummy1.csv -o dummy1 -j dummy1-report-jmeter.
#> jmeter.bat -n -t dummy2.jmx -l dummy2.csv -j dummy2-jmeter.log to execute load
Generated report and timestamps look perfect both in dashboard and graphs
#> jmeter.bat -g dummy2.csv -o dummy2 -j dummy2-report-jmeter.log
Used MergeResults plugin to merge the above CSV files to a single file and generated HTML report
#> JMeterPluginsCMD.bat --generate-csv dummy1-dummy2.csv --input-jtl merge.properties --plugin-type MergeResults
Found merged timeStamp label is not valid and also generated report shows invalid DateTime.
#> jmeter.bat -g dummy1-dummy2.csv -o merged -j merged-report-jmeter.log
Is this a bug or am I missing configuration? Even adding jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss.SSS to user.properties didn't help
merge.properties
inputJtl1=dummy1.csv
prefixLabel1=TEST1:
includeLabels1=.*
excludeLabelsl=
includeLabelRegex1=true
excludeLabelRegex1=
startOffset1=
endOffset1=
inputJtl2=dummy2.csv
prefixLabel2=TEST2:
includeLabels2=.*
excludeLabels2=
includeLabelRegex2=true
excludeLabelRegex2=
startOffset2=
endOffset2=

Unfortunately we cannot help without:
Seeing your merge.properties file contents
Knowing what do you expect
In the meantime I can only tell you where did this 2000-01-01 date came from:
It's declared here:
private static final long REF_START_TIME = 946681200000L;
And being added to the original SampleResult timestamp here:
res.setTimeStamp(res.getTimeStamp() - startTimeRef + REF_START_TIME);
I don't know whether it is a bug or it's designed to work like this (however the crazy logic of substraction of sampler start time from its timestamp is beyond my limited understanding), it's better to check at JMeter Plugins support forum
In the meantime you can use services like BM.Sense for comparing different test runs resutls

Related

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

Jmeter: HTML report generation after tests

These are the steps that I followed to generate reports:
I have the .jtl file
I copy paste given sample configuration to my user.properties file located at apache-jmeter-5.0\bin
I convert .jtl to aggregate report using CMDRunner.jar
java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
Convert csv file got from step#3 to HTML reports
I tried (1) jmeter -g Demo17Results.csv -o htmlReports/
Error: csv' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly when generating report
An error occurred: Mismatch between expected number of columns:17 and columns in CSV file:11, check your jmeter.save.saveservice.* configuration or check line is complete
I tried (2) jmeter -n -t Demo17Run.jmx -l Demo17Results.csv -e -o htmlReports/
Creating summariser <summary>
Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:Demo17Results.csv is not empty
after emptying the csv file
Creating summariser <summary>
Created the tree successfully using Demo17Run.jmx
Starting the test
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up ...
Error generating the report: org.apache.jmeter.report.core.SampleException: Could not read metadata !
... end of run
What am I doing wrong to generate Jmeter HTML dashboard reports?
You don't need step 2, JMeter default configuration is just fine for dashboard generation
You don't need step 3, the dashboard needs to be created from the Demo17Results.jtl file which contains full raw results, not statistics table
Try re-running your test scenario with forcing deletion of the previous result file via -f argument:
jmeter -n -f -t Demo17Run.jmx -l Demo17Results.jtl -e -o htmlReports/
If nothing helps double check you have not modified required results file configuration settings and increase JMeter logs verbosity for report.dashboard package by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.report.dashboard" level="debug" />
I was getting a similar error when I was trying to generate the HTML dashboard report after the test run. Even though the path to the .jtl file was correct (and there were no spaces in the directory names), I was getting that error “Mismatch between expected number of columns...” I was pointing the command to a copy of the .jtl file I had made in another directory. I changed the command to pick up the .jtl file that was in JMeter\bin and that worked… no more error and the reports were generated. So, the command (run from JMeter\bin) that worked was: jmeter –g log.jtl –o C:\HTML_Reports.
Also, the output folder that is specified must not exist (JMeter will create it) or if it does exist, it must be empty.

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

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