JMeter beginner tutorial

This tutorial performance test the RESTFul web service we created ealier as part of the “RESTful Web Service Tutorial with Apache CXF, Maven, and Eclipse” with JMeter. JMeter is an opensource performance testing tool.

Step 1: Download latest release version of Apache JMeter from “http://jmeter.apache.org/download_jmeter.cgi“, and unzip it into c:\tools folder or folder of your choice. Double click on jmeter.bat under the bin folder. For e.g. C:\TOOLS\apache-jmeter-2.11\bin\jmeter.bat

Step 2: Make sure that the RESTful web service is deployed to Tomcat and running as per the instructions on the tutorial “”RESTful Web Service Tutorial with Apache CXF, Maven, and Eclipse”.” The simpleWeb war file needs to be deployed and the Tomcat server needs to be started. The RESTful URL to be performance tested is shown below.

jmeter-tut-pre-1

Step 3: Open JMeter by double clicking on C:\TOOLS\apache-jmeter-2.11\bin\jmeter.bat. Right mouse click to bring up the contextual menu. Set up the number of concurrent threads to run.

jmeter-tut-1

Step 4: Set up the thread group to concurrently fire load on the RESTful webservice. Let’s use 10 threads here.

jmeter-tut-2

Step 5: Set up the default HTTP request settings for all the “HTTP Request” sampler(s). This can be overridden at the “HTTP Request” sampler level.

jmeter-tut-3

Step 6: Create the “HTTP Request” sampler.

jmeter-tut-4

Step 7: This will pick up the host and port details from the “HTTP Default” config. Just only provide the URI path “simpleWeb/rest/simple/Arul“.

jmet-tut-5

Step 8: The results of the run needs to be captured. This is done via the listeners to provide different reports.

jmeter-tut-6

Step 9: We will use a listener to view the results in a table.

jmeter-tut-7

Step 10: You can save the job as a “.jmx” file, and then run the “ThreadGroup” with Run —> start from the main menu, or clicking on the play icon highlighted below.

jmeter-tut-8

You can try running with more load by increasing the number of threads in the thread group, also add more listeners to try different types of reports. You can also try opening the JMX file from a notepad.

I will cover more industrial strength snippets for advanced JMeter jobs.


800+ Java Interview Q&As Menu

Top