Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Tutorial on installation and simple configuration of Jemeter

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the "Jemeter installation and simple configuration tutorial" related knowledge, in the actual case operation process, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!

One, download Jmeter

Download address website official address http://jmeter.apache.org/; click the first to enter the download list

I downloaded both versions, but maybe it's because I'm a win7,64 bit system. Only the Binaries version above can be opened.

Jmeter is a green version and can be run directly. However, running jmeter requires the execution of JDK.

Students who do not have an installation can search the Internet for jdk, download, install and configure environment variables to run the jmter file.

After unpacking, open the bin folder. Run the jmeter.bat file. You can see the interface as shown in the figure

Second, simple configuration and use

At this point, we are ready to configure the program.

We need to configure the network address of 1.ping

two。 The content of the request sent

3. Analysis of test results.

Add thread group

And then we see the following interface.

Name won't say much on this picture.

Talk about the following three values

Number of Threads / / this is the number of threads running at the same time.

Ramp-Up Period (in seconds) / / this is the time when the number of threads starts. For example, start 1000 threads for 1 second. Then 1000 request requests will be made within 1 second. Maybe some requests will be wrong or something. If you don't write it, the default is 0.

Loop Count / / this is the number of times each thread runs in cycles. / / for example, this value is 2, thread 50, time 1s. Each thread runs twice. A total of 100 times.

two。 Add thread reuquest message

Server Name or IP: / / server ip address

Port name; / / server port

Protocol (http): / / enter http or https

Method: drop-down list. You can select requests such as post,get,put.

Path: write down the request address of the connection, such as / member/memberId.html, if it is a get request. / member/memberId.html? MemberId=8000001

If the content of the request is in json format, the data can be written in body Data.

3. Add request header

Then, write the quality content you want to request in it.

Because I uploaded the json request, and the format is I

Content-Type: application/json

4. Add result Analysis-result Tree

After the addition is complete, no configuration is required. At the end of the operation. Each request is a record.

5. Add aggregate report

In this picture, there are the following

Total number of requests made by samples

Average response time of Average

Error% error rate

And then we can run it.

If we want to figure out the results of the last execution, we can click run-> clear All to make clear the previous records.

Third, use random functions in json (1)

"orderId": "1 ${_ Random)}" > orderId ":" 1x ", the value of X is randomly taken from 0-9.

Then, after execution, we can see this result in request

The downside is that there may also be duplicate values. To continue to grope

Using random functions in json (2)

Use the csv file to import variables, and other files can do the same. It is best to pay attention to the format UTF-8.

For example, the above fields, I want orderId to increment in normal order. And change the login user name.

It is important to note that if the csv file has 500 records. The thread executes 500 times. Each record is called once. But if the thread is more than 500 times, the csv record will be resubmitted.

Let's add CSV components first

And then fill in the variables, and let's pay attention here. Variables need to be separated by commas

FileName is the address of the csv file C:\ tool\ json.csv, if you put the imported file in the bin directory of jmeter. You only need to fill in the import file name json.csv.

Because I only need to change 2 variables, I can only write 2 variables in the csv file. As shown in the picture

Then let's modify http's request request

So we can run it, review it. 1. Enter the required variables in http request. two。 Create a new csv file 3. Configure the csv Data set config module to point to the external csv file in the module, the variable name in the file

Using random functions in json (3)

It is also a random function using jmeter.

Variable Name is the name of the variable and is used as above. Call using ${orderId} in request

This is the end of the tutorial on installation and simple configuration of Jemeter. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report