Seminar 2: Setting Up JMeter and Create a Test Plan containing Different User Groups
Goal: In this practical Session, we are going to set up JMeter. We will also create a Test Plan of three different Thread Groups (user groups) running three different algorithms having complexity of the order of O(ni), where i = 2,3 etc. Then the test needs to be run on JMeter Client and JMeter Server. The test results or logs need to be generated in a .csv file. We intend to use this log file in the next seminar session to extract different performance metrics like arrival time, Utilization, throughput, average response time etc. Another goal of this practical session is to give a brief idea of Client-Server architecture and Master-Slave architecture.
Definitions and Other Documentation: Let us get acquainted about JMeter and other things like what is a JMeter and What is a JMeter TestPlan from here.
Prerequisites: JDK.
Exercise:
- To Set up JMeter:.
- Please download the Apache JMeter from here. You can either download the binaries or source based on your convenience or whatever suits you better.
- Download jythoninstaller and put it in apache-jmeter/lib folder
- Download jythonstandlone and put it in apachejmeter/lib folder
- Create a JMeter TestPlan. Check the video on how to create a TestPlan and how to add different Threadgroups and JSR223 Sampler to the respective threadgroups.
- Download the code layout here (.jmx file) (Code). Three ThreadGroups have been added to the code and have been named as BubbleSort, InsertionSort and TOH and the JSR223 Sampler has been added to the respective thread groups.
- Add the scripts of bubble sort, Insertion sort and Tower of Hanoi to the ThreadGroups in the .jmx file namely BubbleSort, InsertionSort and TOH respectively.
- The scripts need to be added in JSR223 Sampler. Watch the Video on how to add scrips to different threadgroups.
- Run the Test Plan on JMeter Client (locally):
- Open terminal/Command Prompt and set the current working directory to jmeter/bin
- Execute the following command:
$ jmeter -n -t "Seminar2_Code.jmx" -l "Seminarresults.csv"
- If you receive an error regrading rmi.keystroke.jks:
- In jmeter.properties file which is present in /bin folder, go to line containing server.rmi.ssl.disable and set this to true: server.rmi.ssl.disable=true. Also uncomment this line.
- It is more preferable to create the rmi.keystroke.jks using create-rmi-keystroke.bat. In this case you don't need to disable the SSL.
- If you receive an error regrading rmi.keystroke.jks:
- Run the Test on JMeter Server:
- Open the terminal and run the command:
$ jmeter-server
Add the jmeter server IP address in the jmeter.properties file. The command can still run but it is a good practice to add your JMeter Server IP to the jmeter.properties file. This way you can remote test even from the JMeter GUI.
- On another terminal, run the following command (X.X.X.X denotes jmeter-server IP):
$ jmeter -n -t "Seminar2_Code.jmx" -l "Seminarresults.csv" -R "X.X.X.X"
- The results of the test can be found in the jmeter/bin folder.
NOTE: Watch the video if something is not clear.
Deliverables: Zip file containing the test code file (.jmx) and the JMeter Log File(s) (.csv file).