- Target server: the server runs and being tested.
- Monitor server: the server runs the script and JMeter to kick off tests, and collect metrics.
- To simplify step2~3 and enable jmeter dashboard since version 3.0, latest jmeter binary with modified properties files have been included.
- You can trigger test by "sh go.sh" which leverages docker image "xiangming/java8:node6" which has java8 and node6 inside.
- You can still start test by "sh start_test.sh". Further, now you can run e.g. "sh start_test.sh 100"
-
Install and run MySQL on monitor server.
Install and run Node.js on monitor server (http://ask.xmodulo.com/install-node-js-linux.html) -
Download and unzip JMeter to monitor server (download binaries version 3.0 from http://mirror.symnds.com/software/Apache//jmeter/binaries/apache-jmeter-3.0.tgz). One can test it by opening /path/to/apache-jemeter-3.0/bin/jmeter .
-
Download Jmeter Standard plugin 1.3.1 to monitor server (http://jmeterplugins.com/downloads/index.html), unzip it. Put everything inside the /path/to/JMeterPlugins-Standard-1.3.1/lib/ext folder into /path/to/apache-jemeter-3.0/lib/ext (create the folder if not exists).
-
Download PerfMon Server Agent 2.2.1 (http://jmeter-plugins.org/downloads/file/ServerAgent-2.2.1.zip), unzip it, and put it on target server.
-
Copy the jar of SocketIO sampler to target server. (cp performance/jmeter-socket.io/target/ApacheJmeter_socket_io-0.1.0-SNAPSHOT-jar-with-dependencies.jar apache-jmeter-3.0/lib/ext/)
-
Create a database called performance (or other name) in MySQL. One way is to execute "mysqladmin -h host -u username -p create performance" and enter the password. Remeber to specify the correct host and username. If the command is executed on monitor server, "-h host" can be neglected.
-
Import the database (perf.sql) on monitor server by executing "mysql -u username -p -h host performance < perf.sql". Make sure you are either in the same directory with perf.sql, or specify the complete path to perf.sql. Similarly, remeber to specify the correct host and username. If the command is executed on monitor server, "-h host" can be neglected. This step can be verified by seeing four tables "test", "run_log", "run_detail", and "run_metrics" under the "performance" database.
-
Set up parameters in env.sh: SCRIPT: the path to the directory of performance/start_test.sh JMETER_PATH: the path to bin/jmeter.sh JMETER_SRC: the path to /performance/TestPlan JMETER_RESULT: the path to /performance/TestResult/${DATE}${TIMESTAMP} Note: at this point, please keep the "/${DATE}${TIMESTAMP}" in JMETER_RESULT. JMETER_TEST_DATA: the path to /performance/TestData
JMETER_HOST: hostname of the target server JMETER_PORT: port used for on the target server JMETER_PORT_AGENT: port used to kick off PerfMon Server Agent on target server. By default this is 4444.
JMETER_START_TIME: the start period (in seconds) for JMeter to kick off the number of threads specified. JMETER_LOAD_TIME: the load period (in seconds) for JMeter to maintain the number of threads specified. JMETER_SHUT_TIME: the shut period (in seconds) for JMeter to shut down the number of threads specified. Note: the total number of tests will be JMETER_START_TIME + JMETER_LOAD_TIME + JMETER_SHUT_TIME.
MYSQL_HOST: the hostname of MySQL database. MYSQL_USERNAME: the username of MySQL. MYSQL_PASSWORD: the password of MySQL. MYSQL_DATABASE: the database used for performance test. "performance" by default.
The remaining settings are subject to change at each test, and will be explained in the "How to kick off a test" part.
- Make sure server, MySQL, and Redis are running on target server.
- Get PIDs of server, MySQL and Redis, and configured them in MYSQL_PROCESS_ID, SERVER_PROCESS_ID, REDIS_PROCESS_ID in evn.sh.
- Set the TEST_PLAN and LOAD_COUNT in env.sh. TEST_PLAN is a list of strings denoting the test plan file names excluding the ".jmx" extension separated by space in a parenthesis. E.g. ("Login") or ("Login" "ContactList" "ContactOrg" "SearchUser"). LOAD_COUNT is a list of integers denoting the number of threads (users) each test to run. E.g. (10) or (10 50 70 100 130 170).
- Run PerfMon Server Agent on target server by executing /path/to/ServerAgent-2.2.1/startAgent.sh .
- Make sure the CSV files in TestData folder are properly configured.
- Run start_test.sh.
- Terminate the PerfMon Server Agent by CRTL + C or kill -9 PID (replace PID with the PID of PerfMon Server Agent).
- Copy and paste a similar test plan in the TestPlan folder, and rename it to a meaningful name.
- Run the JMeter GUI by opening /path/to/apache-jemeter-3.0/bin/jmeter .
- Open the new test plan file through the GUI.
- Modify the "Path" and "Parameters" in the "HTTP Request".
- Modify the "Patterns to Test" in the "Response Assertion" following the "HTTP Request".
- Create a new actione file under package net.unit8.jmeter.protocol.socket_io.util and name if XXXAction, e.g. NewAction.
- Put the action name "New" in SocketIOActionTablePanel.ACTIONS.
- Extends NewAction from SocketIOAsyncActionBase and implements run().
- User Manual: http://jmeter.apache.org/usermanual/index.html
- A good example of building a web test plan: http://jmeter.apache.org/usermanual/build-web-test-plan.html