1. Installation
Official website: http://jmeter.apache.org/Download installation package. After decompression, run "Bin/jmeter.bat".
Jmeter is supported in Chinese, after starting Jmeter, click Options-> Choose Language to select language 2. Component Introduction
2.1. Test Plan
Test plan is the starting point for testing using jmeter and is a container for other test components.
(1) Name: You can take a meaningful name for your test plan.
(2) Note: A comment on the test plan.
(3) User-defined variables: Users can define variables themselves, which can be used in any of the following threads. ${variable name} reference.
(4) Add directory or jar to CLASSPATH: adds directories and jar packages to the classpath,%jmeter-home%\lib. 2.2. Threads (Users):
Threads (Users): Thread, child node only thread group. It can be understood that a thread group is a task process, for example, I want to create a test case, then add the following thread group, you can simulate multi-user concurrency behavior by setting the number of threads on the thread group.
(1) Name: Sets the name for the thread.
(2) Note: note
(3) Thread properties:
① Number of threads: Sets the number of users who send requests, that is, the number of concurrent.
② ramp-up Period (in second): the time interval between threads, in seconds. That is, how much time does all threads start.
③ Cycles: The number of repeated requests, if you select the following forever (default), then the request will continue, if you do not select forever and enter a number in the input box, the request will repeat the specified number of times, if you enter 1.
(4) Scheduler configuration:
① start time: test plan start time, start delay will overwrite it.
② End time: test Plan end time, duration will overwrite it.
③ Duration: The test plan duration will overwrite the end time.
④ Startup latency: How long the test plan is delayed starting, overwriting startup time. 2.3. Test Fragment:
A collection fragment that can be understood as a step. For example, if you store a part of a process (login) as test Fragment, you can refer to the fragment directly when other threads need to do the same (log in), without having to rewrite it. When the number of threads is large, it is easy to manage a critical step.