JMeter 5.1.1 - Performance Metrics appears different during execution in Non-GUI console and later in GUI Listener for the same Test - jmeter

Look at the results in Non-GUI Console
Look at the results in GUI Listener
It's very strange, I see different results for the same test.
The Average Response Time on Non-GUI Console displays as: 368 ms, whereas it displays 578 ms on Listener
Likewise, the Maximum Response Time on Non-GUI Console displays as: 4524 ms, whereas it displays 9999 ms on Listener
It appears to be happening on Jmeter 5.1.1 version, can someone help me out.

In the Summariser:
summary = 9377
In the Summary Report:
TOTAL = 11941
My expectation is that the inconsistency is being caused by extra ~2500 sample results in the .jtl results file, to wit you're appending the results of the current test run to the results of the previous test run. JMeter's summariser considers only current session and when you load the .jtl file in the Listener - it calculates the average from all entries in the file.
Consider passing -f command-line argument to your JMeter startup command line like:
jmeter -f -n -t test.jms -l result.jtl
this way you should get "clean" results and Summariser output will be in line with the Listener output

Thanks #Dmitri for pointing out the deviation of Sample size in Summariser and Listener which was causing the other Performance Metrics.
It all worked when I edited the below configuration in the Jmeter.properties file
Thanks

Related

How to ignore the test results during the ramp-up and ramp-down period

I would like to remove the test results during the ramp-up and ramp-down periods. This will help me to get test results during constant workloads. Also, it will remove outliers during the ramping time.
The solution shall be integrated with the JMeter script (JMX) itself. Removing the test results from the test result files (jtl,csv,xml) adds some extra work.
Synthesis Report plugin could help to a certain extent. But it needs manual intervention and has limited reporting capability. Synthesis Report is a mix between Summary Report and Aggregate Report:
Just remove the ramp-up and ramp-down phases from the .jtl results file, the options are in:
Filter Results Tool which provides --start-offset and --end-offset parameters so you can "cut" the ramp-up and ramp-down phases
JMeterPluginsCMD Command Line Tool which you seem to be using already as you're mentioning Synthesis Report:
JMeterPluginsCMD --generate-csv report.csv --input-jtl /path/to/your/result.jtl --start-offset your-ramp-up-period-in-seconds --end-offset your-ramp-down-period-in-seconds --plugin-type SynthesisReport
I have created a Test Fragment with a JSR223 Post Processor and placed it just after the Test Plan component to ensure it is applied to all the Samplers in the Test Plan.
Add the following arguments into the Parameters
${__P(ignore_ramping_time_results,true)} ${__P(testResultToIgnoreBeforeInMin,5)} ${__P(testResultToIgnoreAfterInMin,65)}
arg[0] - Set true to ignore the result and false to include the result
arg[1] - Set the ramp-up time in minutes. If you set 2, test results during the first two minutes will be ignored
arg[2] - Set the ramp-down start time in minutes. If you set it to 10, all the results after 10 minutes will be ignored.
if(args[0].toBoolean()){
int testResultToIgnoreBeforeInMin=args[1].toInteger()
int testResultToIgnoreAfterInMin=args[2].toInteger()
long testResultToIgnoreBeforeInMillis=testResultToIgnoreBeforeInMin*60*1000
long testResultToIgnoreAfterInMillis=testResultToIgnoreAfterInMin*60*1000
long startTimeInMillis=vars.get("TESTSTART.MS").toLong()
long currentTimeInMillis = new Date().getTime()
long currentTestDurationInMillis=currentTimeInMillis-startTimeInMillis
log.info("currentTestDurationInMillis ${currentTestDurationInMillis}")
if(currentTestDurationInMillis< testResultToIgnoreBeforeInMillis || currentTestDurationInMillis >testResultToIgnoreAfterInMillis){
prev.setIgnore()
log.info("Test result is ignored")
}
}
Pre-Defined Property
TESTSTART.MS - test start time in milliseconds
is used in the script to get the test start time.

JMeter test works differently from CLI than GUI - why?

I'm creating a small test using JMeter. So far I have one Thread Group that executes an HTTP request, waits for 10 seconds, then executes an other HTTP Request and checks what was returned. If I start 100 such threads with 1 second ramp-up period from the JMeter GUI, it works fine, I get the expected values and the whole test finishes in 22 seconds. However, when I start the very same jmx file from the command line, the test runs for more than 120 seconds and some threads (at the last run, 36 out of the 100) don't get the expected value. This might indicate a bug in the system I test, but I don't understand why the test takes that long time from the CLI and why I get errors from the CLI. What is the difference between running the test from the GUI and from the CLI? Does the CLI run the tests "more parallel"? By the way, this is the command line I'm using:
/home/nar/apache-jmeter-3.3/bin/jmeter -n -t test_transactions.jmx -l test_transactions.out
I'm afraid I cannot share the test plan, but I can share the "outline":
+ Thread Group
+ CSV Data Set Config
+ HTTP Request
| + JSON Extractor
+ Constant timer
+ HTTP Request
| + JSON Extractor
| + Response Assertion
+ View Results Tree
+ Save Responses to a file
+ View Results in Table
+ Summary Report
The Constant timer waits for 10 seconds. The first HTTP Request sends in some data and initiates a computation, the second checks the result.
I think you should disable the following listeners in non gui test:
View Results Tree
Save Responses to a file
View Results in Table
Summary Report
After disable you still have result using -l test_transactions.out which you can later view using GUI mode with Browse button in your Listener
In non GUI you can also generate dashboard report if you want by adding -e -o /path/dashboardfolder
It actually does indicate the bug in the system under test. The reason is that you must run JMeter in non-GUI mode as GUI creates huge overhead in terms of resources consumption, especially when you're using Listeners, especially if one of them is View Results Tree.
So my expectation is that in non-GUI mode you're basically creating more immense load which your application cannot handle. You can check this out using i.e. Active Threads Over Time and Transactions Per Second listeners.

How can i see the summary or aggregate values in jmeter jtl file

Am running recorded jmeter performance script (by adding summary and aggrgate listners), in non-gui mode using Maven. After running am getting .jtl file, but am not seeing the values for summary and aggregate values.
how can i see the summary or aggregate report in .jtl file, without opening Jmeter GUI.
We are planneing to run through jenkins on daily basis. Once jtl file is generated the other script has to look the values for summary / aggregate values and show it on the dashboard.
Can anybody please help me regarding this.
Typically I set the results file int the Summary Report Listener and select the fields I want to get back. When you run the test via non-gui (ie through Jenkins) you will get the summary results file and it should be in your workspace.
Here is my JMX file, testing some mobile APIs. JMeter Test Plan and Results
Also to note is the Generate Summary Results Listener. Per the docs
In Non-GUI mode by default a Generate Summary Results listener named "summariser" is configured,
This will not show up in the JTL but will show up in your log file and will generate lines such as
2015/08/28 15:14:33.305 INFO - jmeter.reporters.Summariser: summary = 2200 in 169s = 13.0/s Avg: 17 Min: 2 Max: 5129 Err: 0 (0.00%)
The values you're used to see in Aggregate Report / Summary Report listeners are being calculated from the following metrics:
timestamp
elapsed
success
bytes
latency
For instance:
Average metric is sub of "elapsed" times for all the samplers divided by samplers count.
Median metric is a common statistical measurement basically 50% percentile
90%, 95%, 99% - are also percentiles like median
etc.
Depending on your skills set you can check i.e. Calculator.java class code to see how JMeter calculates averages, percentiles, throughput, etc. and implement some form of postprocessor, use MS Excel, LibreOffice Calc or equivalent on .jtl CSV results file.
If you need to get these results after JMeter run the easiest option are:
Vanilla Jmeter:
if you launch JMeter via Ant Task or Maven Plugin - you'll get HTML results file like:
For more information on configuring Ant and/or Maven integration refer above links or Five Ways To Launch a JMeter Test without Using the JMeter GUI guide.
Using JMeter plugins:
Console Status Logger - which prints quick stats information to stdout and jmeter.log file
0 Threads: 27/5000 Samples: 1 Latency: 5 Resp.Time: 5 Errors: 0%
1 Threads: 2350/5000 Samples: 142 Latency: 19 Resp.Time: 19 Errors: 0%
2 Threads: 4500/5000 Samples: 130 Latency: 51 Resp.Time: 51 Errors: 0%
3 Threads: 5000/5000 Samples: 153 Latency: 81 Resp.Time: 81 Errors: 0%
Loadosophia.org Uploader - which uploads your test results to Loadosophia.org cloud service where you can perform analysis, see graphs, charts, export report as PDF, etc.

how to get the response time of web pages in jmeter?

How to generte csv file and load csv using response time graph listener?
Can any one help me in detail that how we find response time in jmeter ?
If you run JMeter in command-line non-GUI mode as follows:
jmeter -n -t /path/to/your/test_plan.jmx -l /path/to/results_file.jtl
your results_file.jtl content will look like:
1409124780902,182,Logon,200,OK,Thread Group 1-1,text,true,214,0
1409124781219,153,Logout,200,OK,Thread Group 1-1,text,true,110,0
where second column is page response time in milliseconds.
Other values are:
"1409124780902" - current time stamp in ms
"182" - page response time
"Logon" - sampler name
"200" - Response Code
"OK" - Response Message
"Thread Group 1-1" - Parent Thread Group name, thread number and iteration.
"text" - response data type
"214" - response data size in bytes
"0" - latency
Once your test run is done you can open JMeter GUI and load this results_file.jtl into the listener of your choice.
You might also be interested in JMeter Plugins Extras Set which is capable of generating nice looking and easy understandable response-time related graphs to wit:
Response Times vs Threads
Response Times Distribution
Response Times Percentiles
You can get it by adding Reporters.
Please keep in mind Reporters is cpu and memory intensive components and thus should not be used while actual load test.
But for sample testing you can use it and for load test run you can get response time, average,throughput etc by saving output to jtl file in JMeter.
For normal/sample run
Aggregate report gives Average response time, min, max, median etc.
Summary report also gives the same with less details,
While performing actual run you can save output of these reporters in a jtl file. After the test results can be analyzed from jtl files.

JMeter - Response time keeps increasing

I am using JMeter for load testing. I have noticed that the response time it shows keeps increasing until the test plan has finished running.
I have 3 thread groups with the following settings:
Number of threads: 900, 180, 180
Rampup: 0
Loop count: 20
Each of the threads has a constant throughput controller with the following settings:
Throughput: 900, 180, 180
Jmeter Test Plan http://cl.ly/UPhC/jmeter_test_plan.png
I don't understand why the response time keeps increasing from the beginning until the end of the test plan execution.
Maybe the system under test is creating objects and provoking garbage collections. That won't be a problem at first, but will get worst as the test progresses. Do a profiling of the JVM of the system under test with Visual VM or similar.
The problem could be the target system.
But if you are running your plan in GUI mode then it can explain your issue particularly View Results Tree listener which exists for DEBUGGING Test plan and absolutely not for GUI Load Test.
Read this:
http://www.ubik-ingenierie.com/blog/jmeter_performance_tuning_tips/
So fix is:
- Run your test in NON GUI mode and keep only Summary report
You can after test reload result file.
You may also see this:
http://www.ubik-ingenierie.com/blog/automatically-generating-nice-graphs-at-end-of-your-load-test-with-apache-jmeter-and-jmeter-plugins/

Resources