Jmeter Performance Testing Tools
: http://jmeter.apache.org/download_jmeter.cgi
Windows under Use
Here we choose binaries Package, JMeter does not need to install the direct decompression use, but need to configure the Java environment
Install the JDK and don't say it here.
To configure a Java environment variable:
Win7 system
Computer--Advanced system setting--advanced--environment variable--system variable--new
Variable name: java_home
Variable Value: C:\ProgramFiles (x86) \java\jre1.8.0_101 #java路径
Click New again
Variable name: jmeter_home
Variable Value: D:\apache-jmeter-3.1 #jmeter存放路径
Click New again
Variable name: CLASSPATH
Variable Value:%java_home%/lib/dt.jar;%java_home%/lib/tools.jar;%jmeter_home%\lib\ext\apachejmeter_core.jar;%jmeter_home %\lib\jorphan.jar;%jmeter_home%\lib\logkit-2.0.jar;
Locate the path in the system variable, click Edit, and in the variable value, add
%java_home%/bin;%java_home%/jre/bin; # If there is no ";" need to be added, such as:;%java_home%/bin;%java_home%/jre/bin;
Click OK
Web Performance test:
Open Apache-jmeter-3.1/bin/jmeter.bat
When opened there will be two windows, jmeter Command window and jmeter graphical operation interface, can not close the command window
1 , test Plan-right-click or edit-add--threads (Users)--setup thread Group (create a thread set, group name can be modified)
2 , Setup Thread group--right button or click Edit-add--sampler--http request
3 , Setup Thread Group-Right button or click Edit-add-listener--aggregategraph
4 , Setup Thread Group--Right click or edit--add--listener--view result Count
5 , click Setup Thread Group, configure some parameters
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8B/F2/wKioL1hc9b6jUo0uAAA_lsNJLlc536.png-wh_500x0-wm_3 -wmp_4-s_533010003.png "title=" 2.png "alt=" Wkiol1hc9b6juo0uaaa_lsnjllc536.png-wh_50 "/>
a ) Number of threads: generally we use to indicate how many users, that is, the number of users we test
b ) ramp-up Period (in Seconds): Indicates the delay time per user initiated, the above I set to 1 seconds, indicating that the system will start 1 seconds before the end of the 1000 users I set, if set to 1000 seconds, Then the system will start the 1000 users before the end of 1000 seconds, the start user's delay is 1 seconds, if I set to 0 seconds, it means to start all users immediately.
C ) Number of cycles: if you want to limit the number of loops to Ten times, you can cancel the last tick, and then fill in the text box in the back Ten Here we tick forever, indicating that if you do not stop or the time limit will continue to be executed, is to facilitate the invocation of the scheduler.
D ) Scheduler: We tick the scheduler and the following options appear
e ) Duration: indicates the duration of the script running, in seconds, such as if you want to keep the user constantly logged in 1 hours, you can fill in a text box 3600 . If within 1 hours, the end time has arrived, it will overwrite the end time and continue execution.
F ) Start delay: indicates the time that the script delayed startup, after clicking Start, if the start time has arrived, but there is no time to start delay, then the startup delay will be will overwrite the startup time, wait until the start delay time arrives, and then run the system.
g start time: Indicates when we start the script, when you do not want to start the script test immediately, but the time to start the script will not be next to the computer, you can set a startup time, and then run there click to start, the system will not run immediately, but will wait until you fill in the time to start running.
h end time: Corresponds to the start time, indicating the time at which the script ended running.
6 , click HTTP Request
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/F2/wKioL1hc9d7DSOZRAABQv5-IMys722.png-wh_500x0-wm_3 -wmp_4-s_3750418613.png "title=" 3.png "alt=" Wkiol1hc9d7dsozraabqv5-imys722.png-wh_50 "/>
1 ) Name: Can be arbitrarily taken, we can be named according to the path of the recording script
2 ) Note: You can make a brief introduction to the interface
3 server name or IP: The address of our server or IP.
4 Port number: I'm using Tomcat, so it's 8080, and the timeout definition behind it can be used without filling it out.
5 implementation: Here we record when the default is filled with Java, the protocol is filled with: HTTP, method: GET
6 ) Content encoding: encoding can be used without filling in
7 path: That is, the path of the page, we choose here/; The following redirection options can be checked as needed, where we keep the recording unchanged.
8 ) Parameters parameter: The parameters and files that are sent along with the path
9 The following proxy server can be ignored and filled out as required.
7 , click Setup Threadgroup, modifying the number of threads and number of cycles
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/8B/F5/wKiom1hc9fuTq1nLAAAPJZrQPzY578.png-wh_500x0-wm_3 -wmp_4-s_142261569.png "title=" 4.png "alt=" Wkiom1hc9futq1nlaaapjzrqpzy578.png-wh_50 "/>
8 , click Start above, will prompt the test results to save the file location
9 , click Aggregate Graph
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/F6/wKiom1hc9hfAQrvhAAAcEb6CuoQ901.png-wh_500x0-wm_3 -wmp_4-s_612380917.png "title=" 5.png "alt=" Wkiom1hc9hfaqrvhaaaceb6cuoq901.png-wh_50 "/>
1 Label: Each jmeter element (for example, HTTP Request) has a Name property, and the label displays the value of the Name property.
2) #Samples: Indicates how many requests you made in this test, if you simulate 10 users, each user iterates 10 times, then 100 is shown here, and now 10000 is shown because I have configured 100 respectively.
3
4 ) Median: Median, which is the response time of 50% users.
5 ) 90% line:90% the user's response time.
6 min: Minimum response time.
7) Max: Maximum response time.
8) error%: The total number of requests/requests that have errors in this test.
9) Throughput: Throughput--By default indicates the number of requests completed per second (request per Second), when the transaction controller is used, It is also possible to represent transaction per second similar to LoadRunner.
kb/sec: The amount of data received per second from the server side.
After the Web server adjusts the parameters, you can test again to see the results before and after the comparison.
Database Performance Testing
Need to install the JDBC driver
Mariadb :
Https://mariadb.com/download_file/connector/java/mariadb-java-client-1.5.4.jar
Mysql (to compress a package, just use the jar package in the package):
http://dev.mysql.com/downloads/connector/j/
1 , test Plan-right-click or edit-add--threads (Users)--setup thread Group (create a thread set, group name can be modified)
2 , Setup Thread group--Add--Configure Components--JDBC Connection Configuration
3 , click JDBC Connection configuration, the parameters in this key must be configured, cannot be empty, otherwise it will affect the use of other test projects
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/F2/wKioL1hc9jXAFu7kAABWy2MAe0E951.png-wh_500x0-wm_3 -wmp_4-s_1550005656.png "title=" 6.png "alt=" Wkiol1hc9jxafu7kaabwy2mae0e951.png-wh_50 "/>
Modified configuration:
Variable Name : Mariadb
Database URL : Jdbc:mariadb://172.16.10.167:3306/caolei
JDBC Driverclass : Org.mariadb.jdbc.Driver
Username : Root
Password : ******
Driverclassname and URLs for several common databases
MAIRADB:
DriverClassName:org.mariadb.jdbc.Driver
Url:jdbc:mariadb://localhost:3306/test
DB2:
DriverClassName:com.ibm.db2.jcc.DB2Driver
Url:jdbc:db2://localhost:50000/sample
Oracle:
DriverClassName:oracle.jdbc.driver.OracleDriver
Url:jdbc:oracle:thin: @localhost: 1521:ORCL
Mysql:
DriverClassName:com.mysql.jdbc.Driver
Url:jdbc:mysql://localhost:3306/test
4 , Setup Thread group--add--sampler--jdbc Request
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/8B/F2/wKioL1hc9lWCFSUVAABzRs_H_EI317.png-wh_500x0-wm_3 -wmp_4-s_3557669528.png "title=" 7.png "alt=" Wkiol1hc9lwcfsuvaabzrs_h_ei317.png-wh_50 "/>
Variable Name : Mariadb
Insert a query statement
5 , Setup Thread Group-Right button or click Edit-add-listener--aggregategraph
6 , Setup Thread Group--Right click or edit--add--listener--view result Count
7 , test Plan-Browse below (add the downloaded JDBC Jar package here to add multiple)
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/F2/wKioL1hc9oPAIj9LAAAdLh7Zd-8695.png-wh_500x0-wm_3 -wmp_4-s_4118795600.png "title=" 8.png "alt=" Wkiol1hc9opaij9laaadlh7zd-8695.png-wh_50 "/>
Click Start, if the amount of data is large, you need to wait for the stop key to turn gray, the startup key to brighten, the right time to stop to indicate the end of the test
Warning graphic to the right of time, click to display the test error details
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8B/F2/wKioL1hc9puy7AQwAAAJCvkeX64607.png-wh_500x0-wm_3 -wmp_4-s_1255571985.png "title=" 9.png "alt=" Wkiol1hc9puy7aqwaaajcvkex64607.png-wh_50 "/>
You can also set assertions, graphical displays, table displays, and more
Jmeter Plugins:
https://jmeter-plugins.org
There are only simple tests available, and more needs to be researched.
JMeter Service Performance Test Tool