Local DesignFirst in the local design Apache JMeter test plan, you can refer to the "Interface Test JMeter", here no longer repeat.
Server ConfigurationEnsure that the server has installed the JDK and
Python。
Create a folder on the server side
Mkdir/data/loadtest Cd/data/loadtest |
To upload the test plan to this folder, take QA2.JMX as an example.
download Apache JMeter to current folderwget Http://mirrors.hust.edu.cn/apache//jmeter/binaries/apache-jmeter-3.2.zip
UnzipUnzip Apache-jmeter-3.2.zip
Create a folder to save the results file and report filesmkdir Report Result
Add a scriptVim execloadtest.sh content is as follows:
#! /BIN/SH # Perform performance test Su-C '/data/loadtest/apache-jmeter-3.2/bin/jmeter-n-t/data/loadtest/qa2.jmx-l/data/load test/result/$ (date +%y%m%d%h%m%s). Csv-e-o/data/loadtest/report/$ (date +%y%m%d%h%m%s)/' |
(use ROOT to execute Apache JMeter, output and report to the corresponding folder)
Add Execute Permissionschmod +x execloadtest.sh
perform tests, generate reportsExecutes the script./execloadtest.sh into the Report folder CD reports start a 8000 port HTTP service nohup python-m simplehttpserver & Open Link http://{you IP address of the server used}:8000 Click the link to view the test report
Set timed executionAdd the following scheduled tasks in Crontab Crontab-e adds one line: 0 7 * * */DATA/LOADTEST/EXECLOADTEST.SH (7 points per day) Here we complete the interface test to automate and generate the report settings, however , this is not a big ending, interface testing is a need for long-term maintenance work, we also have to periodically increase or decrease the interface, to avoid interface testing and system disconnect. Http://www.51testing.com/html/49/n-3722149.html
Turn: Use JMeter to do interface test under Linux