jMeter Setup - acmeair-svt/acmeair-mainservice-java GitHub Wiki
https://github.com/blueperf/acmeair-driver
- This setup assumes the use of a VM (https://vlaunch.rtp.raleigh.ibm.com)
- We used Ubuntu 16 successfully with the ibmadmin user
- Download JDK (if not currently installed) and make sure $JAVA_HOME is set
- ex:
sudo apt-get update && apt-get upgrade
sudo apt-get install default-jre
sudo apt-get install default-jdk
nano ~/.bashrc
- Scroll to bottom and add
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
source .bashrc
- ex:
- Go to https://jmeter.apache.org/download_jmeter.cgi and download one of the jMeter binaries by copying the link and using curl on the VM. Then decompress jMeter into the directory of your choice. Add bin folder to $PATH
- At the time of this wiki, jMeter 5.3 was the newest version of jMeter available and was the one that was used
- ex (starting from ~):
curl -O http://mirror.cogentco.com/pub/apache//jmeter/binaries/apache-jmeter-5.3.tgz
- `tar -xzf apache-jmeter-5.3.tgz'
nano ~/.bashrc
- Scroll to bottom and add
export PATH=~/apache-jmeter-5.3/bin:$PATH
source .bashrc
- Clone repository
git clone https://github.com/blueperf/acmeair-driver.git
cd acmeair-driver
- Place acmeair-jmeter-2.0.0-SNAPSHOT.jar in <JMETER_DIR>/lib/ext/
- ex:
cp acmeair-jmeter-2.0.0-SNAPSHOT.jar ~/apache-jmeter-5.3/lib/ext/
- ex:
- Download the json-simple-1.1.1.jar and copy the jar to <JMETER_DIR>/lib/ext/
- ex:
cd ~/apache-jmeter-5.3/lib/ext
curl -O https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
- ex:
- Edit hosts.csv with the correct AcmeAir host name
- ex:
cd ~/acmeair-driver/acmeair-jmeter/scripts
nano hosts.csv
- Content:
127.0.0.1,aa-acmeair.apps.acmeair45.cp.fyre.ibm.com
- ex:
- Configure output to allow summary statistics to be printed on the console screen, as well as in the specified log file. <JMETER_DIR>/bin/jmeter.properties
- ex:
cd ~/apache-jmeter-5.3/bin/
nano jmeter.properties
- Find this section and add/uncomment the following:
- ex:
#---------------------------------------------------------------------------
# Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode)
#---------------------------------------------------------------------------
#
log_level.jmeter.reporters.Summariser=INFO
summariser.name=summary
summariser.interval=30
summariser.log=true
- Also change/uncomment this value to true in jmeter.properties
CookieManager.save.cookies=true
- Create folder to hold jMeter results
- ex:
cd
-
mkdir jmeter
- Make sure there is no text file in this folder every time before running jMeter
cd jmeter
-
mkdir acmeair_jmeter_results
- Make sure this folder is empty every time before running jMeter
- ex:
- Reload database either from website (recommended) or VM (not recommended)
- From AcmeAir website (Recommended):
- Go to Configure the Acme Air environment and Load the database
- Reload the database after making selections
- Should see messages ensuring that booking, customer, and flight are reloaded
- Troubleshooting: Flight loader from website may show a timeout error, but will keep adding flights regardless. Keeping refreshing config page until the number of flights stops increasing. All flights should be loaded at this point.
- From command line (Not recommended due to flight timeout):
curl http://HOSTNAME:PORT_NUMBER/booking/loader/load
-
curl http://HOSTNAME:PORT_NUMBER/flight/loader/load
- note: this may
fail
due to timeout issue. May have to wait few minutes to ensure all flights are loaded.
- note: this may
-
curl http://HOSTNAME:PORT_NUMBER/customer/loader/load?numCustomers=10000
- note : this will load 10,000 simulated user data
- From AcmeAir website (Recommended):
- Run jmeter from scripts folder with AcmeAir-microservices-mpJwt.jmx
- Also read next bullet if running a long test and want to run jmeter in the background
- ex:
cd ~/acmeair-driver/acmeair-jmeter/scripts
jmeter -n -t AcmeAir-microservices-mpJwt.jmx -DusePureIDs=true -JHOST=aa-acmeair.apps.acmeair45.cp.fyre.ibm.com -JPORT=80 -j jMeter-logName -JTHREAD=25 -JUSER=999 -JDURATION=7200 -JRAMP=0 -JDELAY=0 -l /home/ibmadmin/jmeter/acmeair_jmx_results.txt -e -o /home/ibmadmin/jmeter/acmeair_jmeter_results
- Replace
JHOST
,JPORT
,jMeter-logName
,JDURATION
- Replace
-l /home/ibmadmin/jmeter/acmeair_jmx_results.txt -e -o /home/ibmadmin/jmeter/acmeair_jmeter_results
- These are the folders created in the last step
- To run jMeter in background with capability to exit VM:
- Prepare to run jMeter
cd ~/acmeair-driver/acmeair-jmeter/scripts
screen
- Run jMeter command from above bullet
- Press
Ctrl a
+Ctrl d
to leave process (it will still be running in the background) - Can safely exit VM while process runs in background
exit
- Rejoin process by
screen -r
- After test is over, type
exit
to terminate screen process
- Prepare to run jMeter
- If no errors at end of test, should see this in console
- To see visual results
- Connect to VM and copy from jmeter folder on VM to jmeter folder on local machine in current directory
- Example run from local machine:
scp -r <user>@<host>:/home/ibmadmin/jmeter/ jmeter
- If no errors at end of test, should see this in index.html
- May also want to view jMeter-logName in scripts folder for debugging purposes if there are errors