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

Steps for building Jmeter performance testing environment

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains the steps of building a Jmeter performance testing environment, which interested friends may wish to take a look at. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of building a Jmeter performance testing environment.

I. Environmental configuration

Linux environment

At this point, you can use vim / etc/profile to modify global variables

Add export PATH=$PATH:/home/jmeter/apache-jmeter-4.0-performance/bin

Then enter: wq save exit, execute source / etc/profile to make the configuration effective

Then give the jmeter file execution permission under the / home/jmeter/apache-jmeter-4.0-performance/bin path. First, cd / home/jmeter/apache-jmeter-4.0-performance/bin enters the bin directory.

Execute chmod 777 jmeter

After the execution, execute jmeter-v to see the following figure, which proves that the global variable configuration is successful, and you can use the command to perform the performance test.

Windows environment

When the configuration is complete, click OK. Enter jmeter-v on the cmd command line and the following figure appears, indicating that the configuration is successful.

First create a system variable named JMETER_HOME with a value of D:\ apache-jmeter-4.0-performance (filled in according to the actual path)

Then add% JMETER_HOME%\ bin to the system variable path, as shown in the following figure

It is recommended that the jmeter installation package be placed in the home directory of the disk, not on disk C, as shown below

Enter the jmeter directory and use the rz command to upload the compressed jmeter test software

Use unzip apache-jmeter-4.0-performance.zip to extract the uploaded compressed package

After the decompression is completed, the apache-jmeter-4.0-performance directory will be generated in the current directory

The jmeter4.0 used this time needs jdk1.8 or above to support it.

Log in to the linux system using the root user, enter the / home path, and execute mkdir jmeter to create the jmeter directory

Installation package placement path

Configure global variables

Create a directory

Upload Jmeter installation package

Configure global variables

II. Script development

After the case development is complete, save the case to the result directory

Case development and debugging are completed, and the devops system is packaged and uploaded to the / home/jmeter/project path of linux.

Enter rz enter, the system will pop up a prompt box, you can select the uploaded file

Then use the unzip devops system .zip command to extract it

First, add a user-defined variable, define a variable as path, the value as the relative path format.. / data/name.csv, and the path format as linux environment (windows is compatible with linux format, so that linux and windwos environments can be synchronously compatible)

First, add a new csv data file, change the file name to ${path}, select UFT-8 for the file encoding, and enter the variable name to be referenced. The name is the column name of the parameter file name.csv, ignoring the first line and selecting true. Other values default.

Add a new file named name.csv in the data directory, and then define the parameter name and parameter value

By referencing the parameter method, the system can call the variable by changing it to ${name} and ${description} in the variable that needs to call the parameter value.

Use the mkdir project command to create the project directory under / home/jmeter

Create a folder named after the system locally

Date created under devops

Then create three subfolders under this file: data, result, and script

Then create log and summary_report folders under result to save logs and aggregate reports, respectively.

Catalogue maintenance

Parametric settin

Package upload

III. Case execution

Use the command cd / home/jmeter/project/devops system / 20180703/script

To enter the script path, be sure to enter the script directory so that you can use the relative path instead of entering a long absolute path.

The command is as follows: jmeter-n-t new check. JMX-l. / result/summary_report/ new check _ 10_10min.jtl-j.. / result/log/ new check _ 10_10min.log

Using this command to call jmeter for performance testing,-t is followed by the name of the script to be executed,-l is followed by the aggregate report save path,-j is followed by the log save path, 10 is the number of concurrent users, and 10min is the duration of the scene

After execution, the file will be generated under two paths

At this point, I believe you have a deeper understanding of the "Jmeter performance testing environment building steps", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Internet Technology

Wechat

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

12
Report