Jmeter start test run from command line and get result - jmeter

I want to execute jmeter from command line and get the result on screeen. I am using following command for this,
jmeter -n -t "D:\\apache-jmeter-4.0\\bin\\Test.jmx" -l result.jtl
This command displays the result on screen on summary format like below,
summary + 1 in 2s = 0.5/s Avg: 1917 Min: 1917 Max: 1917 Err: 0 (0.00%) Active: 10 Started: 10 Finished: 0
summary + 99 in 6s = 17.9/s Avg: 482 Min: 203 Max: 2009 Err: 0 (0.00%) Active: 0 Started: 10 Finished: 10
summary = 100 in 6s = 18.1/s Avg: 497 Min: 203 Max: 2009 Err: 0 (0.00%)
And data in result.jtl is
2018/06/05 20:34:58.307,1917,Home Page,200,OK,Thread Group 1-9,text,true,138969,629
2018/06/05 20:34:58.278,2001,Home Page,200,OK,Thread Group 1-5,text,true,138969,658
......
I read in document that Jmeter calculates the summary from this data to display on screen and raw data is directed and stored to result.jtl file. But I want to get the same raw data on console which I may pick for further custom checks and calculation. Is it possible to get the result.jtl data on screen ? if yes, please suggest me how it can be achieved.
Thanks

If you want just to print .jtl file contents into terminal you can use type or more commands like:
type result.jtl
You might also be interested in JMeterPluginsCMD Command Line Tool which allows generation of different tables and charts basing on .jtl results file from command line.
Also be aware that according to JMeter Best Pratices you should always use the latest JMeter version (JMeter 4.0 as of now) as newer versions normally contain bug fixes, performance improvements and new features and JMeter 2.11 is 4+ years old. For example since JMeter 3.0 it is possible to generate HTML Reporting Dashboard.

Related

In jmeter 5.4.3 v have used stoptest.sh command. Now am not able to run any Test suite . can someone help to solve it

error Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
on linux
We are not able to provide a comprehensive answer without:
Knowing whether it is standalone or distributed mode
What does STDOUT say
What does jmeter.log say on all machines
If the Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445 message is absolutely normal, it's just an information that JMeter is listening for shutdown or dump signals
You should also see Summariser output once per 30 seconds with some baseline statistical metrics looking like:
summary + 5 in 00:00:26 = 0.2/s Avg: 246 Min: 59 Max: 498 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0
summary + 1 in 00:00:10 = 0.1/s Avg: 128 Min: 128 Max: 128 Err: 0 (0.00%) Active: 0 Started: 1 Finished: 1
Demo:

Jmter stays in Tidying up state end of run and it takes around 2 hours to generated the HTML report for a large volume of results

Using below command I ran a Jmter plan per 2 hours in Centos 7 environment.
nohup jmeter -n -t HTTP_BasicPlan.jmx -l GrafanaTestSummaryreport.csv -j mylog.log -e -o TestResultReportFolder > myprogram.out & 2>&1
At the end of the exaction . TO generate the HTML report, it takes another 2 hours and then generates the HTML report.
summary = 177532912 in 02:15:14 = 21878.8/s Avg: 5 Min: 0 Max: 933392 Err: 13 (0.00%)
Tidying up ... # Thu Oct 07 08:33:22 UTC 2021 (1633595602066)
... end of run
Anyway to speed up the report generation? Thank you.

Jmeter run in ubuntu server none gui mode not show nothing result

I try to run command ./jmeter.sh -n -t ../../apache-jmeter-4.0/test-case-2018/jmeter_cron.jmx and i got log message :
Starting the test # Mon Jul 09 17:44:48 ICT 2018 (1531133088159)
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 ... # Mon Jul 09 17:44:48 ICT 2018 (1531133088762)
... end of run
It's seem nothing run .
PS: But i run in my desktop ( Windows 10) it's show result as normal . it's the log message from my desktop :
Starting the test # Mon Jul 09 17:09:03 ICT 2018 (1531130943233)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port
4445 summary + 1 in 00:00:01 = 1.4/s Avg: 346 Min: 346
Max: 346 Err: 1 (100.00%) Active: 1 Started: 1 Finished: 0
summary + 6 in 00:00:01 = 5.1/s Avg: 179 Min: 176 Max:
184 Err: 0 (0.00%) Active: 0 Started: 2 Finished: 2 summary =
7 in 00:00:02 = 3.7/s Avg: 203 Min: 176 Max: 346 Err: 1
(14.29%) Tidying up ... # Mon Jul 09 17:09:05 ICT 2018
(1531130945291) ... end of run
Could anyone can help me ?
CSV Data Set Config filename can be tricky in different environments,
Notice you can use absolute path (not in distributed test) but it may be specific for each OS.
You can use Relative path according to path of the active test plan
Notice that Linux can be case sensitive so make sure driven_data.csv all in lower case
Filename Name of the file to be read. Relative file names are resolved with respect to the path of the active test plan. For distributed testing, the CSV file must be stored on the server host system in the correct relative directory to where the JMeter server is started. Absolute file names are also supported, but note that they are unlikely to work in remote mode, unless the remote server has the same directory structure. If the same physical file is referenced in two different ways - e.g. csvdata.txt and ./csvdata.txt - then these are treated as different files. If the OS does not distinguish between upper and lower case, csvData.TXT would also be opened separately.
Double check that:
The file /data/driven_data.csv exists, you will have to copy it from the master node as JMeter doesn't do this automatically
The user account has read access to the /data/driven_data.csv path, if not - grant it using the following command:
sudo chmod -R a+rX /data/driven_data.csv
See online chmod manual page or type man chmod in your terminal to get full help on the command.
Just FYI: the easiest way to implement the data-driven distributed testing in JMeter is using HTTP Simple Table Server which allows sharing the same data file between multiple slave instances so you will not have to copy the file to the remote slaves.
You can install HTTP Simple Table Server using JMeter Plugins Manager

How do you make a threadGroup time not be taken in consideration of the total time

I have the following scenario:
Thread group1 - this sends requests to a server (lots of threads and iterations)
HTTP Request
Thread group2 - 1 thread 1 iterations
JSR223 sampler (has a while loop which periodically check if a number is 0) and collects some times
The scenario ends when threadgroup 2 finishes
I run the above scenario using the non GUI mode and i am interested in the RPS. (as shown below 222.0/s), but only for the first threadGroup.
summary = 50002 in 00:03:29 = 222.0/s Avg: 4151 Min: 38 Max: 797601 Err: 0 (0.00%)
Now, when the last threadGroup ends i will have:
summary = 50003 in 00:09:12 = 90.7/s Avg: 4136 Min: 38 Max: 797601 Err: 0 (0.00%)
The RPS is now low only because the last threadGroup takes very long to finish.
Is there any way the time from the last threadGroup can not be taken into consideration of the total time ? Or maybe another approach to this problem.
You can use jmeter.reportgenerator.sample_filter property in order to exclude your JSR223 Sampler from the report.
Run your test in command-line non-GUI mode like:
jmeter -n -t test.jmx -l result.jtl
The command to generate FULL results would look like:
jmeter -g result.jtl -o ALL-RESULTS
It will create ALL-RESULTS folder holding information on all the samplers
The command to generate results WITHOUT JSR223 Sampler would be:
jmeter -Jjmeter.reportgenerator.sample_filter="^((?!JSR223 Sampler).)*$" -g result.jtl -o FILTERED-RESULTS
It will create FILTERED-RESULTS folder with HTTP Request sampler only (or whatever else samplers, only JSR223 Sampler(s) will be excluded.
More information:
Generating Report Dashboard
Configuring JMeter
Apache JMeter Properties Customization Guide

Jmeter Distributed Environment : Active Threads Over Time : total not displayed

I have a JMeter distributed environment (localhost and host1)
localhost (master and slave)
host1 (slave).
I have a thread group in my test plan with 10 users and 50 loops.
Running the test as bellow :
jmeter.bat -t myscript.jmx -n -r -l results.csv
My test runs successfully and I get a total of 20 threads as displayed on the output
summary + 800 in 30,2s = 26,5/s Avg: 580 Min: 33 Max: 2315 Err: 0 (0,00%) Active: 20 Started: 20 Finished: 0
But when I try to graph "jp#gc - Active Threads Over Time" with data in results.CSV , I just get the number of active threads = 10 .
My question is how can I get a Grape with all 20 threads running?
The main problem is that I suspect that result.csv is not complete and does not contain all performance information such as response time etc.
For JMeter version < 5.0 :
This is because you need to add a unique ID per injector in Thread Group name as per documentation:
https://jmeter-plugins.org/wiki/ActiveThreadsOverTime/
For example:
If running only 1 JMeter per machine:
${__machineName()}_My Threadgroup name
If running multiple injectors per machine::
${__P(JVM_ID,1)}_My Threadgroup name
For version >= JMETER 5.0:
It will work correctly Out Of The Box as per this fix:
https://bz.apache.org/bugzilla/show_bug.cgi?id=62684

Resources