JMeter study notes--Meet jmeter (1)

Source: Internet
Author: User

To get an automated test tool, we should first understand what it can provide us (the most direct way is to get from the official website), the next step is to do a simple "functional testing" of this tool, of course, the functional test here is not to let you find its existence of the bug, but let yourself have a visual understanding of it , after the functional testing is also for the previous understanding to do the groundwork, then we rely on this principle to understand the next jmeter.

What is JMeter (mainly on the official website – http://jmeter.apach.org)

JMeter is a purely Java-written application that is primarily used for load and performance testing. The initial purpose of design jmeter is to test the Web application but has now expanded a lot of features. JMeter are often used for static or dynamic resources such as PHP, java,asp. NET, or Java Object, Data Bases and Queries, FTP server, etc.) for performance testing. It typically simulates a large amount of data to load test a server or a server Group network. The test results are then judged by analyzing the performance graphs it produces.

Installing JMeter

BadBoy (can be used to assist JMeter recording): Http://www.badboy.com.au/download/add

jmeter:http://jmeter.apache.org/download_jmeter.cgi

1. Extract the downloaded installation package to the specified directory, and then start JMeter "\apache-jmeter-2.12\bin\jmeter.bat" to see a JMeter GUI interface,

2. JMeter by default, the language of the system is selected to jmeter its own language, changing the JMeter language easily:

The component knows how much 1. Thread Group

Each test case must have one or more thread groups, if there is more than one thread group (when we execute the test, they are executing the sampler under the thread group at the same time)

There are three important parameters under each thread group:

    • Number of threads: is the number of JMeter virtual users, the number of threads set to simulate how many users.
    • Ramp-up Period (in Second): How long to run the number of these threads, for example, set the number of threads 100, set ramp-up Period (in Second) to 20, which means that 20 seconds to run out of these 100 threads, That is, 1 seconds to run 5 threads.
    • Number of cycles: how many times these threads are cycled, such as the number of threads set 100, and then the number of cycles set to 20, meaning that each thread executes 20 times, then 100 threads execute 100*20 times.

For Setup Thread Group and TearDown thread Group, if you have used JUnit, you should not be unfamiliar with setup and TearDown.

The SETUP thread group represents the actions that are performed before the thread group is executed;

The TearDown thread Group represents the action that is required after all the thread groups have been executed.

1.1There are two important controllers under the thread group

Logic controllers: Use logic that comes from defining JMeter (If-else, for loops, and so on) to determine when JMeter sends a request and how many times it repeats.

Sampler (Sampler): Sends a request to the server and waits for a response. Sampler has multiple types of responders, such as HTTP requests, JDBC requests, and so on, and different sampler send different requests to the server depending on the parameters set.

Configuring components (Configuration elements)

The configuration component is primarily used to maintain the configuration information required by the sampler, and modifies the requested content according to the actual need and set range (logical controller).

Timers (Timers)

By default, JMeter threads do not wait for each other to send requests, and we can control them with timers, and if there are multiple timers, the delay time is set by stacking.

Front processor and post processor (Pre-processors and post-processors)

It is primarily responsible for the work before and after the build request, which is used by the predecessor processor to modify the settings before the sampler request and the post processor to process the response data after the sampler run.

Assertion (assertions)

Assertions allow you to judge the expected results and to compare the data returned from the server, increasing the assertion to directly determine whether the data returned by the program you are testing is correct, equivalent to the LoadRunner checkpoint. It also has an important feature of isolating the problem domain and performing stress tests on the premise of ensuring that the function is functional.

Listener (Listeners)

Collect test results and show them in a different form.

JMeter Execution Order
    1. Configuring components (Configuration elements)
    2. Predecessor Processor (pre-processors)
    3. Timers (Timers)
    4. Sampling Device (Sampler)
    5. Post Processor (post-processors)
    6. Assertion (assertions)
    7. Listener (Listeners)

Note: Timers, assertions, pre-and post-processors are all applied around the sampler.

To illustrate this point, for example:

    • Controller

Post-processor 1

Sampler 1

Sampler 2

Timer 1

Assertion 1

Pre-processor 1

Timer 2

Post-processor 2

Order of execution:

Pre-processor 1

Timer 1

Timer 2

Sampler 1

Post-processor 1

Post-processor 2

Assertion 1

Pre-processor 1

Timer 1

Timer 2

Sampler 2

Post-processor 1

Post-processor 2

Assertion 1

JMeter study notes--Meet jmeter (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.