Sunday, February 23, 2014

View Jmeter summary in non-GUI mode


I recently had to execute jmeter scripts on non GUI mode and wanted to view results while the test is executing.

Usually, on UI mode we can view the summary from “Summary Report” option.


But, when the test is executing through non GUI mode, usually we can not view the result rather waiting until the results written to particular file.

Below example shows how the jmeter scripts execute on non GUI mode.

 ./bin/jmeter.sh -n -t ~/jmeter/scripts/test1.jmx -l ~/jmeter/results/results1.jtl  

Note: test1.jmx file is the jmeter test plan. Result1.jtl is the result file generated.

When the test execution happening over long time and we need to view results during that period. For that we can use “Summariser” option.

Summariser is a special listener that only applies to non GUI mode. 
This option is provided in jmeter.properties file. (Actually $jmeter_home/bin).

jmeter.propertie contains special section for summariser options

 #---------------------------------------------------------------------------  
 # Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode)  
 #---------------------------------------------------------------------------  
 #  
 # Define the following property to automatically start a summariser with that name  
 # (applies to non-GUI mode only)  
 #summariser.name=summary  
 #  
 # interval between summaries (in seconds) default 3 minutes  
 #summariser.interval=180  
 #  
 # Write messages to log file  
 #summariser.log=true  
 #  
 # Write messages to System.out  
 #summariser.out=true  

What you need to do is uncomment the 4 options.

summariser.name=summary
summariser.interval=180 : Here you can define any time interval to display the results.
summariser.log=true

summariser.out=true

Now execute the same command and see the summary during test execution.

 ./bin/jmeter.sh -n -t ~/jmeter/scripts/test1.jmx -l ~/jmeter/results/results1.jtl  

Summary will be printed on the jmeter console:

 Creating summariser <summary>  
 Created the tree successfully using /home/ubuntu/jmeter/scripts/test1 .jmx  
 Starting the test @ Thu Feb 20 10:25:14 UTC 2014 (1392891914636)  
 Waiting for possible shutdown message on port 4445  
 summary + 99960 in  104s = 961.9/s Avg:  26 Min:   3 Max:  806 Err:   0 (0.00%) Active: 30 Started: 30 Finished: 0  
 summary + 306897 in  180s = 1704.5/s Avg:  17 Min:   3 Max:  297 Err:   0 (0.00%) Active: 30 Started: 30 Finished: 0  
 summary = 406857 in  284s = 1433.0/s Avg:  19 Min:   3 Max:  806 Err:   0 (0.00%)  
 summary + 298083 in  180s = 1655.7/s Avg:  17 Min:   3 Max:  322 Err:   0 (0.00%) Active: 30 Started: 30 Finished: 0  
 summary = 704940 in  464s = 1519.5/s Avg:  18 Min:   3 Max:  806 Err:   0 (0.00%)  
 summary + 264542 in  155s = 1704.9/s Avg:  16 Min:   3 Max:  304 Err:   0 (0.00%) Active: 0 Started: 30 Finished: 30  
 summary = 969482 in  619s = 1566.2/s Avg:  18 Min:   3 Max:  806 Err:   0 (0.00%)  
 Tidying up ...  @ Thu Feb 20 10:35:35 UTC 2014 (1392892535107)  

The main advantage of this is you can see what is happening during long running test. 











2 comments: