Jmeter is the simplest to use

Source: Internet
Author: User

Http://marshal.easymorse.com/archives/3127

Jmeter is the simplest to use

Jmeter is a test tool under the Apache Jakarta project. For details, see:

Http://jakarta.apache.org/jmeter/

It can be used for function testing, load testing, and stress testing. It is an essential test tool for server development. I have written a complete document before and have not posted it on my blog. It has been lost for a long time. For the latest test, it is necessary to write multiple log records.

Download jmeter:

Http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi

The installation is simple. Extract the package. Jmeter is written in Java. Therefore, ensure that JRE is installed before running jmeter.

Run jmeter in graphical and command line modes. First, let's talk about the graphic method. In Windows:

Double-click jmeterw. cmd.

 

After jmeter is started, you can see the following:

Add the required nodes to the test plan entry. Right-click:

Add a thread group first:

When a thread group node appears, on its attribute tab:

Set the number of cycles to always. According to the above configuration, there will be a thread in the thread group. After the end of the test task is executed (which will be set later), the thread group will be executed again at an interval of 1 second.

Adding a cookie manager does not need to be set, but it is useless now. It can manage cookies so that the client and server can maintain the session through cookie data. For example, if you log on to the task in the future, the server will allow access to authorized resources through the maintained session after the task is successful.

Add an HTTP request:

On the attribute page of the newly added HTTP request node:

Only the server address is added. If the port is 80, you can leave it empty.

In fact, it is now a testing plan that can be run. However, you do not know the effect after running the test. Add an aggregation report:

Used to count the total number of visits and the success rate.

Press Ctrl + R or:

Start the task.

 

 

 

 

Then, the monitoring aggregation report:

We can see that numbers are constantly changing.

You can press Ctrl + period or the menu to close the test.

To clear aggregate reports or Customize multiple monitoring data, you can:

Clear only clears data of the current node. Clear all data.

The test plan can be saved as follows:

As shown in the figure in this article, it is saved.

The file is an XML text file. The test plan script is stored in the file:

It can be saved and loaded. You can save a test plan and distribute it to multiple users to load the test plan script on different machines. Run the test at the same time.

Now we can customize the above aggregation report:

Write monitoring data to a file.

The test script can also be executed in the command line without relying on the graphic interface. For example:

C: \ tools \ jakarta-jmeter-2.4 \ bin> jmeter-n-t .. \ plan \ test plan. JMX-l a. jtl

The monitoring information for the test will be printed to the. jtl file, with the same content as the above monitoring file.

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.