WO2020253079A1 - Jmeter-based distributed performance test method and apparatus, device, and storage medium - Google Patents

Jmeter-based distributed performance test method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2020253079A1
WO2020253079A1 PCT/CN2019/119070 CN2019119070W WO2020253079A1 WO 2020253079 A1 WO2020253079 A1 WO 2020253079A1 CN 2019119070 W CN2019119070 W CN 2019119070W WO 2020253079 A1 WO2020253079 A1 WO 2020253079A1
Authority
WO
WIPO (PCT)
Prior art keywords
jmeter
node
slave node
master node
test
Prior art date
Application number
PCT/CN2019/119070
Other languages
French (fr)
Chinese (zh)
Inventor
李润妮
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020253079A1 publication Critical patent/WO2020253079A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application relates to the field of cloud testing, and discloses a Jmeter-based distributed performance test method and apparatus, a device, and a storage medium. The Jmeter-based distributed performance test method comprises: deploying a Jmeter mirror image of a prediction version to distributed nodes, wherein the distributed nodes comprise one master node and at least one slave node; when the master node receives a test start instruction, the master node transmitting a respective corresponding test script to each slave node; when each slave node receives the respective corresponding test script, each slave node performing respective performance tests, and acquiring respective corresponding test results; each slave node transmitting the respective corresponding test results to the master node; and the master node counting the respective corresponding test results, and acquiring a performance test result. The present application performs version control on a Jmeter mirror image, and uses container-based distributed nodes to deploy the Jmeter mirror image to perform performance test. Deployment is simple and quick, thereby improving the efficiency of test.

Description

基于Jmeter的分布式性能测试方法、装置、设备及存储介质Jmeter-based distributed performance testing method, device, equipment and storage medium
本申请要求于2019年06月17日提交中国专利局、申请号为201910523487.4、发明名称为“基于Jmeter的分布式性能测试方法、装置、设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 17, 2019, the application number is 201910523487.4, and the invention title is "Jmeter-based distributed performance testing methods, devices, equipment and computer-readable storage media". , Its entire content is incorporated in the application by reference.
技术领域Technical field
本申请涉及云测试领域,尤其涉及基于Jmeter的分布式性能测试方法、装置、设备及存储介质。This application relates to the field of cloud testing, and in particular to Jmeter-based distributed performance testing methods, devices, equipment, and storage media.
背景技术Background technique
服务器端性能测试的主流工具有Jmeter和LoadRunner,原理都是通过中间代理,监控收集并发客户端发送的指令,生成脚本发送到应用服务器,再监控服务器反馈的结果。The mainstream tools for server-side performance testing are Jmeter and LoadRunner. The principle is to monitor and collect instructions sent by concurrent clients through intermediate agents, generate scripts and send them to the application server, and then monitor the results of the server.
对应用程序做接口性能测试时,由于单机CPU和内存的限制,单机部署的Jmeter无法满足测试需求,需要使用Jmeter分布式部署。传统的应用部署方式是通过插件或脚本来安装应用,这样做的缺点是应用程序的运行、配置、管理、所有生存周期将与当前操作系统绑定,发明人意识到这样做并不利于应用的升级更新和版本回滚等操作。When testing the interface performance of the application, due to the limitations of the single-machine CPU and memory, the single-machine deployment of Jmeter cannot meet the test requirements, and Jmeter distributed deployment is required. The traditional application deployment method is to install the application through plug-ins or scripts. The disadvantage of this is that the operation, configuration, management, and all life cycles of the application will be bound to the current operating system. The inventor realizes that this is not conducive to the application. Operations such as upgrade updates and version rollbacks.
通过创建虚拟机的方式部署Jmeter时,则部署过程复杂,效率低,并不利于可移植性,同时发明人发现,基于大量虚拟机的Jmeter集群有个缺点,就是不方便管理,比如需要重启Jmeter服务,还需要连接到每个虚拟机上进行操作,而且安装部署不方便,也不方便将集群封装成整体应用对外提供服务。When deploying Jmeter by creating a virtual machine, the deployment process is complicated, inefficient, and not conducive to portability. At the same time, the inventor found that a Jmeter cluster based on a large number of virtual machines has a disadvantage that is inconvenient to manage, such as the need to restart Jmeter The service also needs to be connected to each virtual machine for operation, and it is not convenient to install and deploy, and it is not convenient to package the cluster into a whole application to provide services to the outside.
发明内容Summary of the invention
本申请的主要目的在于解决单机部署Jmeter无法满足测试需求,而采用虚拟机部署Jmeter过程复杂、效率低和移植性差的问题,同时解决了测试脚本对版本控制支持不友好的问题。The main purpose of this application is to solve the problem that Jmeter deployed on a stand-alone machine cannot meet the test requirements, but the process of deploying Jmeter using a virtual machine is complicated, low in efficiency and poor portability, and at the same time solves the problem of unfriendly version control support for test scripts.
为实现上述目的,本申请第一方面提供了一种基于Jmeter的分布式性能测试方法,包括:将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;当所述主节点接收到启动测试指令 时,通过所述主节点向各个从节点发送各自对应的测试脚本;当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;通过各个从节点将各自对应的测试结果发送到所述主节点;通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。In order to achieve the above objectives, the first aspect of the present application provides a Jmeter-based distributed performance test method, including: deploying a predicted version of the Jmeter image to a distributed node. The distributed node includes a master node and at least one slave node. Node; when the master node receives the start-up test instruction, the master node sends the corresponding test script to each slave node; when each slave node receives the respective corresponding test script, the test script is performed by each slave node The performance test obtains the respective corresponding test results; each slave node sends the respective corresponding test results to the master node; and the master node counts the respective corresponding test results to obtain the performance test results.
可选的,在本申请第一方面的第一种实现方式中,所述将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点包括:从镜像仓库中选择预测版本的Jmeter镜像;通过弹性计算服务ECS实例设置所述分布式节点,所述分布式节点包括所述一个主节点和所述至少一个从节点;判断所述主节点和各个从节点是否同时存在所述预测版本的Jmeter镜像;若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果;若所述主节点和各个从节点同时存在所述预测版本的Jmeter镜像,则确定部署成功。Optionally, in the first implementation manner of the first aspect of the present application, the deployment of the predicted version of the Jmeter image to a distributed node, where the distributed node includes a master node and at least one slave node includes: slave mirror Select the predicted version of the Jmeter image in the warehouse; set up the distributed node through an ECS instance of the elastic computing service, the distributed node including the one master node and the at least one slave node; determine the master node and each slave node Whether the Jmeter image of the predicted version exists at the same time; if the Jmeter image of the predicted version does not exist at the same time on the master node and each slave node, deploy the Jmeter image of the predicted version in a preset manner to obtain the deployment result; if If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, it is determined that the deployment is successful.
可选的,在本申请第一方面的第二种实现方式中,所述若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果包括:若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则将所述预测版本的Jmeter镜像部署到所述ECS实例上,得到Jmeter应用;通过容器docker运行所述Jmeter应用;将各个从节点对应的配置信息添加到所述主节点的控制列表中,所述各个从节点对应的配置信息包括各自对应的IP地址和各自对应的端口;重启所述主节点的所述Jmeter应用,得到部署结果。Optionally, in the second implementation manner of the first aspect of the present application, if the master node and each slave node do not simultaneously have a Jmeter image of the predicted version, the predicted version is deployed in a preset manner The Jmeter image obtained by the deployment result includes: if the predicted version of the Jmeter image does not exist in the master node and each slave node at the same time, deploy the predicted version of the Jmeter image to the ECS instance to obtain the Jmeter application; Run the Jmeter application through the container docker; add the configuration information corresponding to each slave node to the control list of the master node, and the configuration information corresponding to each slave node includes its corresponding IP address and its corresponding port; restart The Jmeter application of the master node obtains the deployment result.
可选的,在本申请第一方面的第三种实现方式中,所述若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果之后,所述基于Jmeter的分布式性能测试方法还包括:判断所述部署结果是否为目标值,所述目标值用于指示成功部署所述预测版本的Jmeter镜像;若所述部署结果不为所述目标值,则重新部署;若所述部署结果为所述目标值,则确定部署成功。Optionally, in the third implementation manner of the first aspect of the present application, if the master node and each slave node do not simultaneously have a Jmeter image of the predicted version, the predicted version is deployed in a preset manner After the deployment result is obtained, the Jmeter-based distributed performance testing method further includes: determining whether the deployment result is a target value, the target value being used to indicate successful deployment of the predicted version of the Jmeter image; if If the deployment result is not the target value, then redeploy; if the deployment result is the target value, it is determined that the deployment is successful.
可选的,在本申请第一方面的第四种实现方式中,所述当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本包括:将所述主节点设置为远程方法调用RMI的客户端;将各个从节点设置为所述RMI的服务器端;当所述主节点接收到启动测试指令时,通过所述主节点执行测试计划,所述测试计划包括总测试数据和测试脚本;解析所述主节点的控制列表,得到所述各个从节点对应的配置信息;根据所述各个从 节点对应的配置信息对所述总测试数据进行拆分,得到各个从节点对应的测试数据;根据所述各个从节点对应的测试数据替换所述测试脚本中的关键字,得到所述各自对应的测试脚本;通过所述主节点以所述RMI方式向各个从节点推送所述各自对应的测试脚本。Optionally, in the fourth implementation manner of the first aspect of the present application, when the master node receives the start test instruction, sending the corresponding test script to each slave node through the master node includes: The master node is set as the client of remote method invoking RMI; each slave node is set as the server side of the RMI; when the master node receives the start test instruction, the test plan is executed through the master node, the The test plan includes total test data and test scripts; parsing the control list of the master node to obtain configuration information corresponding to each slave node; splitting the total test data according to the configuration information corresponding to each slave node, Obtain the test data corresponding to each slave node; replace the keywords in the test script according to the test data corresponding to each slave node to obtain the respective corresponding test script; send the corresponding test script to each slave node in the RMI manner through the master node Push the respective corresponding test scripts from the node.
可选的,在本申请第一方面的第五种实现方式中,所述当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果还包括:当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点解析所述各自对应的测试脚本,得到各自对应的测试请求;通过各个从节点执行所述各自对应的测试请求,得到所述各自对应的测试结果;通过各个从节点记录所述各自对应的测试结果。Optionally, in the fifth implementation manner of the first aspect of the present application, when each slave node receives the respective corresponding test script, each slave node performs a performance test to obtain the corresponding test result. Including: when each slave node receives the respective corresponding test script, analyze the respective corresponding test script through each slave node to obtain the respective corresponding test request; execute the respective corresponding test request through each slave node, Obtain the respective corresponding test results; record the respective corresponding test results through each slave node.
可选的,在本申请第一方面的第六种实现方式中,所述将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点之前,所述基于Jmeter的分布式性能测试方法还包括:将所述预测版本的Jmeter镜像上传到所述镜像仓库;通过打标签方式对所述预测版本的Jmeter镜像进行版本管理。Optionally, in the sixth implementation manner of the first aspect of the present application, before the Jmeter image of the predicted version is deployed to a distributed node, the distributed node includes a master node and at least one slave node, the The Jmeter-based distributed performance testing method further includes: uploading the predicted version of the Jmeter image to the mirror warehouse; and performing version management on the predicted version of the Jmeter image by tagging.
本申请第三方面提供了一种基于Jmeter的分布式性能测试设备,包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互联;所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行上述第一方面所述的方法。A third aspect of the present application provides a Jmeter-based distributed performance test equipment, including: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected by wires; The at least one processor invokes the instructions in the memory, so that the Jmeter-based distributed performance testing device executes the method described in the first aspect.
本申请的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。The fourth aspect of the present application provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the method described in the first aspect.
从以上技术方案可以看出,本申请具有以下优点:It can be seen from the above technical solutions that this application has the following advantages:
本申请提供的技术方案中,将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本;当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;通过各个从节点将各自对应的测试结果发送到所述主节点;通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。本申请实施例中,通过镜像仓库对Jmeter镜像进行版本控制,采用基于容器的分布式节点部署Jmeter镜像并进行性能测试,容器之间进程不会相互影响,能区分计算资源,同时相对于虚拟机,容器部署过程简单化,提 高测试效率。In the technical solution provided by this application, the predicted version of the Jmeter image is deployed to a distributed node. The distributed node includes a master node and at least one slave node; when the master node receives a start test instruction, the The master node sends each corresponding test script to each slave node; when each slave node receives the respective corresponding test script, the performance test is performed through each slave node to obtain the corresponding test result; each slave node corresponds to each The test result of is sent to the master node; the master node counts the respective corresponding test results to obtain the performance test result. In the embodiment of the application, the Jmeter image is version controlled through the mirror warehouse, and the Jmeter image is deployed and performance tested using container-based distributed nodes. The processes between the containers will not affect each other, and the computing resources can be distinguished, and compared to the virtual machine , The container deployment process is simplified and testing efficiency is improved.
附图说明Description of the drawings
图1为本申请实施例中基于Jmeter的分布式性能测试方法的一个实施例示意图;FIG. 1 is a schematic diagram of an embodiment of a Jmeter-based distributed performance testing method in an embodiment of the application;
图2为本申请实施例中基于Jmeter的分布式性能测试方法的另一个实施例示意图;2 is a schematic diagram of another embodiment of a Jmeter-based distributed performance testing method in an embodiment of the application;
图3为本申请实施例中基于Jmeter的分布式性能测试装置的一个实施例示意图;Fig. 3 is a schematic diagram of an embodiment of a Jmeter-based distributed performance testing device in an embodiment of the application;
图4为本申请实施例中基于Jmeter的分布式性能测试装置的另一个实施例示意图;4 is a schematic diagram of another embodiment of a Jmeter-based distributed performance testing device in an embodiment of the application;
图5为本申请实施例中基于Jmeter的分布式性能测试设备的另一个实施例示意图。Fig. 5 is a schematic diagram of another embodiment of a Jmeter-based distributed performance test device in an embodiment of the application.
具体实施方式Detailed ways
本申请提供一种基于Jmeter的分布式性能测试设备。This application provides a distributed performance test equipment based on Jmeter.
参阅图1,图1为本申请实施例中基于Jmeter的分布式性能测试方法的一个实施例包括:Referring to FIG. 1, FIG. 1 is an embodiment of a Jmeter-based distributed performance testing method in an embodiment of the application, including:
101、将预测版本的Jmeter镜像部署到分布式节点,该分布式节点包括一个主节点和至少一个从节点;101. Deploy the Jmeter image of the predicted version to a distributed node, where the distributed node includes a master node and at least one slave node;
服务器将预测版本的Jmeter镜像部署到分布式节点,该分布式节点包括一个主节点和至少一个从节点,主节点和从节点都采用容器docker。docker是一个开源的应用容器引擎,docker完全使用沙箱机制,相互之间不会有任何接口,docker使用客户端-服务器C/S架构模式。The server deploys the predicted version of the Jmeter image to the distributed node. The distributed node includes a master node and at least one slave node. Both the master node and the slave node use container docker. Docker is an open source application container engine. Docker completely uses a sandbox mechanism without any interfaces between them. Docker uses a client-server C/S architecture model.
需要说明的是,服务器从镜像仓库中选择预测版本的Jmeter镜像。服务器通过Jmeter镜像,则没必要再去设置诸如Java虚拟机和属性文件的环境,而只需要专注于创建测试脚本和测试资源,如数据文件便可。一个Jmeter镜像包含测试任务中所有的脚本,根据测试任务和测试脚本名字的对应关系,选择某一版本的Jmeter镜像作为预测版本的Jmeter镜像。Jmeter镜像并不过滤任何Jmeter的命令参数,允许多种运行模式,在基于容器的分布式模式下,该镜像可以被用来建立容器集群。It should be noted that the server selects the predicted version of the Jmeter mirror from the mirror warehouse. The server is mirrored by Jmeter, there is no need to set up environments such as Java virtual machine and property files, but only need to focus on creating test scripts and test resources, such as data files. A Jmeter mirror contains all the scripts in the test task. According to the corresponding relationship between the test task and the test script name, a certain version of the Jmeter mirror is selected as the predicted version of the Jmeter mirror. The Jmeter image does not filter any Jmeter command parameters and allows multiple operating modes. In the container-based distributed mode, the image can be used to build a container cluster.
102、当主节点接收到启动测试指令时,通过主节点向各个从节点发送各自对应的测试脚本;102. When the master node receives the start test instruction, it sends the corresponding test script to each slave node through the master node;
当主节点接收到启动测试指令时,服务器通过主节点向各个从节点发送各自对应的测试脚本。具体的,服务器将主节点设置为远程方法调用RMI的客户端;服务器将各个从节点设置为RMI的服务器端;当主节点接收到启动测试指令时,服务器通过主节点执行测试计划,该测试计划包括总测试数据和测试脚本;服务器解析主节点的控制列表,得到各个从节点对应的配置信息;服务器根据各个从节点对应的配置信息对总测试数据进行拆分,得到各个从节点对应的测试数据;服务器根据各个从节点对应的测试数据替换测试脚本中的关键字,得到各自对应的测试脚本;服务器通过主节点以RMI方式向各个从节点推送各自对应的测试脚本。When the master node receives the start test instruction, the server sends the corresponding test script to each slave node through the master node. Specifically, the server sets the master node as the client of remote method invocation RMI; the server sets each slave node as the server side of RMI; when the master node receives the start test instruction, the server executes the test plan through the master node, and the test plan includes Total test data and test scripts; the server parses the control list of the master node to obtain the configuration information corresponding to each slave node; the server splits the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node; The server replaces the keywords in the test script according to the test data corresponding to each slave node to obtain the corresponding test script; the server pushes the corresponding test script to each slave node in the RMI manner through the master node.
需要说明的是,远程方法调用(remote method invocation,RMI)是一种用于实现远程过程调用的应用程序编程接口,支持客户机上运行的程序可以调用远程服务器上的对象,也就是存储于不同地址空间的程序级对象之间彼此进行通信,RMI特性支持在网络环境中分布式操作。RMI包括运行远程方法调用服务的服务器和运行远程方法调用服务的客户端。It should be noted that remote method invocation (RMI) is an application programming interface used to implement remote procedure invocation, which supports programs running on the client to call objects on the remote server, that is, stored in different addresses The program-level objects in the space communicate with each other, and the RMI feature supports distributed operations in a network environment. RMI includes a server that runs a remote method call service and a client that runs a remote method call service.
103、当各个从节点接收到各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;103. When each slave node receives its corresponding test script, perform a performance test through each slave node to obtain respective corresponding test results;
当各个从节点接收到各自对应的测试脚本时,服务器通过各个从节点进行性能测试,得到各自对应的测试结果。具体的,当各个从节点接收到各自对应的测试脚本时,服务器通过各个从节点解析各自对应的测试脚本,得到各自对应的测试请求;通过各个从节点执行各自对应的测试请求,得到各自对应的测试结果;服务器通过各个从节点记录各自对应的测试结果。When each slave node receives its corresponding test script, the server performs a performance test through each slave node to obtain the corresponding test result. Specifically, when each slave node receives its corresponding test script, the server parses its corresponding test script through each slave node to obtain its corresponding test request; through each slave node executes its corresponding test request, obtains its corresponding test script. Test result: The server records the corresponding test result through each slave node.
需要说明的是,性能测试指标包含并发数、平均响应时长、请求成功率、每秒钟请求或者事务数量的并发数,即QPS/TPS。其中,QPS/TPS与并发数和平均响应时长的关系为QPS/TPS等于并发数与平均响应时间相除。It should be noted that the performance test indicators include the number of concurrency, average response time, request success rate, and the number of concurrent requests or transactions per second, namely QPS/TPS. Among them, the relationship between QPS/TPS and the number of concurrencies and the average response time is that QPS/TPS is equal to the number of concurrencies divided by the average response time.
104、通过各个从节点将各自对应的测试结果发送到主节点;104. Send the corresponding test results to the master node through each slave node;
服务器通过各个从节点将各自对应的测试结果发送到主节点。具体的,服务器通过各个从节点接收各自对应的测试结果,服务器通过各个从节点以RMI服务方式将各自对应的测试结果发送到主节点,同时各个从节点记录各自对应的测试结果,该各自对应的测试结果为同一测试计划下的测试请求,但是各自对应的测试结果并不相同,该各自对应的测试结果包括正常测试数据结果和异常测试数据结果。The server sends the corresponding test results to the master node through each slave node. Specifically, the server receives the corresponding test result through each slave node, the server sends the corresponding test result to the master node through each slave node in the RMI service mode, and each slave node records its corresponding test result. The test results are test requests under the same test plan, but the respective test results are not the same, and the respective test results include normal test data results and abnormal test data results.
105、通过主节点统计各自对应的测试结果,得到性能测试结果。105. Obtain performance test results through the statistics of the respective corresponding test results by the master node.
服务器通过主节点统计各自对应的测试结果,得到性能测试结果。具体 的,服务器通过主节点接收各个从节点的各自对应的测试结果,服务器根据预置的统计脚本对各个从节点的各自对应的测试结果进行计算和分类,得到性能测试结果。The server counts the corresponding test results through the master node, and obtains the performance test results. Specifically, the server receives the respective test results of each slave node through the master node, and the server calculates and classifies the respective test results of each slave node according to a preset statistical script to obtain the performance test result.
本申请实施例中,通过镜像仓库对Jmeter镜像进行版本控制,支持版本回滚,同时采用基于容器的分布式节点部署Jmeter镜像并进行性能测试,容器之间进程不会相互影响,能区分计算资源,并且相对于虚拟机,容器能快速部署。由于容器与底层设施和机器文件系统是解耦的,能在不同云和不同版本操作系统间进行迁移,部署过程简单化,提高测试效率。In the embodiment of the application, the Jmeter image is version controlled through the mirror warehouse, and version rollback is supported. At the same time, the container-based distributed node is used to deploy the Jmeter image and perform performance testing. The processes between the containers will not affect each other and can distinguish computing resources. , And compared to virtual machines, containers can be deployed quickly. Because the container is decoupled from the underlying facilities and the machine file system, it can be migrated between different clouds and different versions of operating systems, simplifying the deployment process and improving test efficiency.
参阅图2,图2为本申请实施例中基于Jmeter的分布式性能测试方法的另一个实施例包括:Refer to FIG. 2, which is another embodiment of the Jmeter-based distributed performance testing method in the embodiment of the application, including:
201、从镜像仓库中选择预测版本的Jmeter镜像;201. Select the predicted version of the Jmeter mirror from the mirror warehouse;
服务器从镜像仓库中选择预测版本的Jmeter镜像,镜像是一个包含了软件及必要配置的弹性云服务器模板,至少包含操作系统,还可以包含应用软件和私有软件,例如,应用软件包括数据库软件。镜像分为公共镜像和私有镜像,公共镜像为系统默认提供的镜像,私有镜像为用户创建的镜像。The server selects the predicted version of the Jmeter image from the image warehouse. The image is an elastic cloud server template that contains software and necessary configurations. It contains at least the operating system, and can also contain application software and proprietary software. For example, application software includes database software. Mirrors are divided into public mirrors and private mirrors. The public mirror is the mirror provided by the system by default, and the private mirror is the mirror created by the user.
需要说明的是,服务器从镜像仓库中选择预测版本的Jmeter镜像。服务器通过Jmeter镜像,则没必要再去设置诸如Java虚拟机和属性文件的环境,而只需要专注于创建测试脚本和测试资源,如数据文件便可。一个Jmeter镜像包含测试任务中所有的脚本,根据测试任务和测试脚本名字的对应关系,选择某一版本的Jmeter镜像作为预测版本的Jmeter镜像。Jmeter镜像并不过滤任何Jmeter的命令参数,允许多种运行模式,在基于容器的分布式模式下,该镜像可以被用来建立容器集群。It should be noted that the server selects the predicted version of the Jmeter mirror from the mirror warehouse. The server is mirrored by Jmeter, there is no need to set up environments such as Java virtual machine and property files, but only need to focus on creating test scripts and test resources, such as data files. A Jmeter mirror contains all the scripts in the test task. According to the corresponding relationship between the test task and the test script name, a certain version of the Jmeter mirror is selected as the predicted version of the Jmeter mirror. The Jmeter image does not filter any Jmeter command parameters and allows multiple operating modes. In the container-based distributed mode, the image can be used to build a container cluster.
可选的,服务器将预测版本的Jmeter镜像上传到镜像仓库,该镜像仓库是存储docker镜像的仓库,不局限于Jmeter镜像,分为公有仓库和私有仓库;服务器通过打标签方式对预测版本的Jmeter镜像进行版本管理,版本管理就是对不同测试任务的Jmeter镜像根据预置规则打标签,同一测试任务根据测试脚本的不同,也可以有不同的分支和标签,同时Jmeter镜像部署之后还支持版本回滚,使测试部署更加方便快捷。Optionally, the server uploads the predicted version of the Jmeter image to the mirror warehouse. The mirror warehouse is a warehouse that stores docker images. It is not limited to the Jmeter image and is divided into public and private warehouses; the server uses tags to label the predicted version of Jmeter. Image version management, version management is to label Jmeter images of different test tasks according to preset rules. The same test task can have different branches and tags according to different test scripts. At the same time, Jmeter image deployment also supports version rollback. , Making test deployment more convenient and faster.
202、通过弹性计算服务ECS实例设置分布式节点,该分布式节点包括一个主节点和至少一个从节点;202. Set up a distributed node through an ECS instance of the elastic computing service, where the distributed node includes a master node and at least one slave node;
服务器通过弹性计算服务ECS实例设置分布式节点,该分布式节点包括一个主节点和至少一个从节点。该分布式节点是由一组通过网络进行通信、为了完成共同的任务而协调工作的计算机节点组成的系统。分布式节点的出 现是为了用廉价的并且普通的机器完成单个计算机无法完成的计算、存储任务。The server sets up a distributed node through an ECS instance of the elastic computing service, and the distributed node includes a master node and at least one slave node. The distributed node is a system composed of a group of computer nodes that communicate through a network and coordinate work to complete common tasks. The emergence of distributed nodes is to use cheap and ordinary machines to complete calculation and storage tasks that a single computer cannot complete.
需要说明的是,在实际部署时,服务器根据性能测试指标的并发数,动态调整从节点数量,例如,性能测试指标的并发数为1000,每个从节点最大的并发数为200,那么至少需要5个从节点。It should be noted that in actual deployment, the server dynamically adjusts the number of slave nodes according to the number of concurrent performance test indicators. For example, if the number of concurrent performance test indicators is 1000, and the maximum number of concurrent slave nodes is 200, then at least 5 slave nodes.
203、判断主节点和各个从节点是否同时存在预测版本的Jmeter镜像;203. Determine whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node;
服务器判断主节点和各个从节点是否同时存在预测版本的Jmeter镜像,具体的,服务器判断主节点和各个从节点指定目录中是否包含目标镜像安装文件,若主节点和各个从节点指定目录中不包含目标镜像安装文件,则确定不同时存在预测版本的Jmeter镜像;若主节点和各个从节点指定目录中包含目标镜像安装文件,则读取目标镜像安装文件,得到版本号;判断版本号是否与预测版本的Jmeter镜像的版本号匹配,若Jmeter镜像安装文件的版本号与预测版本的Jmeter镜像的版本号匹配,则确定存在预测版本的Jmeter镜像;若版本号与预测版本的Jmeter镜像的版本号不匹配,则确定不同时存在预测版本的Jmeter镜像。The server judges whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node. Specifically, the server judges whether the target mirror installation file is contained in the designated directory of the master node and each slave node. If the designated directory of the master node and each slave node does not contain If the target mirror installation file does not exist at the same time, the predicted version of the Jmeter mirror is determined; if the target mirror installation file is contained in the designated directory of the master node and each slave node, the target mirror installation file is read to obtain the version number; to determine whether the version number matches the forecast The version number of the Jmeter image of the version matches. If the version number of the Jmeter image installation file matches the version number of the predicted version of the Jmeter image, it is determined that there is a predicted version of the Jmeter image; if the version number does not match the version number of the predicted version of the Jmeter image Match, it is determined that there is no Jmeter mirror of the predicted version at the same time.
204、若主节点和各个从节点不同时存在预测版本的Jmeter镜像,则通过预置方式部署预测版本的Jmeter镜像,得到部署结果;204. If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image through a preset method to obtain the deployment result;
若主节点和各个从节点不同时存在预测版本的Jmeter镜像,则通过预置方式部署预测版本的Jmeter镜像,得到部署结果,具体的,若主节点和各个从节点不同时存在预测版本的Jmeter镜像,则服务器将预测版本的Jmeter镜像部署到ECS实例上,得到Jmeter应用;服务器通过容器docker运行Jmeter应用;服务器将各个从节点添加到主节点的控制列表中;服务器重启主节点的Jmeter应用,得到部署结果。其中,一个ECS实例等同于一台虚拟机,包含CPU、内存、操作系统、网络和磁盘等基础的计算组件,根据业务场景和使用场景,ECS实例可以分为多种规格族。同一业务场景下,还可以选择新旧多种规格族。同一个规格族里,根据CPU和内存的配置,可以分为多种不同的规格。ECS实例规格定义了实例的CPU和内存的配置,包括CPU型号和主频等。If the master node and each slave node do not have the predicted version of the Jmeter mirror at the same time, the predicted version of the Jmeter mirror is deployed through the preset method, and the deployment result is obtained. Specifically, if the master node and each slave node do not have the predicted version of the Jmeter mirror at the same time , The server deploys the predicted version of the Jmeter image to the ECS instance to obtain the Jmeter application; the server runs the Jmeter application through the container docker; the server adds each slave node to the control list of the master node; the server restarts the Jmeter application of the master node to get Deployment results. Among them, an ECS instance is equivalent to a virtual machine, including basic computing components such as CPU, memory, operating system, network, and disk. According to business scenarios and usage scenarios, ECS instances can be divided into multiple specification families. In the same business scenario, you can also choose a variety of new and old specification families. According to the configuration of CPU and memory, the same specification family can be divided into many different specifications. The ECS instance specification defines the configuration of the CPU and memory of the instance, including the CPU model and main frequency.
可选的,服务器判断部署结果是否为目标值,目标值指示成功部署预测版本的Jmeter镜像;若部署结果不为目标值,则服务器重新部署预测版本的Jmeter镜像;若部署结果为目标值,则确定部署成功。具体的,服务器通过kubernetes平台查询部署Jmeter镜像的状态,并据此判断该Jmeter镜像部署是否成功。其中,kubernetes是一个开源的容器编排引擎,它支持自动化部署、 大规模可伸缩和应用容器化管理。在生产环境中部署一个应用程序时,通常要部署该应用的多个实例以便对应用请求进行负载均衡。Optionally, the server determines whether the deployment result is the target value, and the target value indicates the successful deployment of the predicted version of the Jmeter image; if the deployment result is not the target value, the server redeploys the predicted version of the Jmeter image; if the deployment result is the target value, then Confirm that the deployment was successful. Specifically, the server queries the status of deploying the Jmeter image through the kubernetes platform, and judges whether the Jmeter image deployment is successful based on this. Among them, kubernetes is an open source container orchestration engine that supports automated deployment, large-scale scalability, and application container management. When deploying an application in a production environment, multiple instances of the application are usually deployed to load balance application requests.
205、若主节点和各个从节点同时存在预测版本的Jmeter镜像,则确定部署成功;205. If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, it is determined that the deployment is successful;
若主节点和各个从节点同时存在预测版本的Jmeter镜像,则服务器确定部署成功。具体的,服务器循环遍历部署预测版本的Jmeter镜像到主节点和各个从节点,并逐个排查部署结果,直到全部部署成功后,执行步骤206。If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, the server determines that the deployment is successful. Specifically, the server loops through the deployment of the predicted version of the Jmeter image to the master node and each slave node, and checks the deployment results one by one, until all deployments are successful, and then execute step 206.
206、当主节点接收到启动测试指令时,通过主节点向各个从节点发送各自对应的测试脚本;206. When the master node receives the start test instruction, it sends the corresponding test script to each slave node through the master node;
当主节点接收到启动测试指令时,服务器通过主节点向各个从节点发送各自对应的测试脚本。具体的,服务器将主节点设置为远程方法调用RMI的客户端;服务器将各个从节点设置为RMI的服务器端;当主节点接收到启动测试指令时,服务器通过主节点执行测试计划,该测试计划包括总测试数据和测试脚本;服务器解析主节点的控制列表,得到各个从节点对应的配置信息;服务器根据各个从节点对应的配置信息对总测试数据进行拆分,得到各个从节点对应的测试数据;服务器根据各个从节点对应的测试数据替换测试脚本中的关键字,得到各自对应的测试脚本。其中,主节点与各个从节点之间进行通讯,但是各个从节点之间互相之间并不进行通讯。When the master node receives the start test instruction, the server sends the corresponding test script to each slave node through the master node. Specifically, the server sets the master node as the client of remote method invocation RMI; the server sets each slave node as the server side of RMI; when the master node receives the start test instruction, the server executes the test plan through the master node, and the test plan includes Total test data and test scripts; the server parses the control list of the master node to obtain the configuration information corresponding to each slave node; the server splits the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node; The server replaces the keywords in the test script according to the test data corresponding to each slave node to obtain the corresponding test script. Among them, the master node communicates with each slave node, but each slave node does not communicate with each other.
需要说明的是,远程方法调用(remote method invocation,RMI)是一种用于实现远程过程调用的应用程序编程接口,支持客户机上运行的程序可以调用远程服务器上的对象,也就是存储于不同地址空间的程序级对象之间彼此进行通信,RMI特性支持在网络环境中分布式操作。RMI包括运行远程方法调用服务的服务器和运行远程方法调用服务的客户端。It should be noted that remote method invocation (RMI) is an application programming interface used to implement remote procedure invocation, which supports programs running on the client to call objects on the remote server, that is, stored in different addresses The program-level objects in the space communicate with each other, and the RMI feature supports distributed operations in a network environment. RMI includes a server that runs a remote method call service and a client that runs a remote method call service.
207、当各个从节点接收到各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;207. When each slave node receives its corresponding test script, perform a performance test through each slave node to obtain respective corresponding test results;
当各个从节点接收到各自对应的测试脚本时,服务器通过各个从节点进行性能测试,得到各自对应的测试结果。具体的,当各个从节点接收到各自对应的测试脚本时,服务器通过各个从节点解析各自对应的测试脚本,得到各自对应的测试请求;通过各个从节点执行各自对应的测试请求,得到各自对应的测试结果;服务器通过各个从节点记录各自对应的测试结果。When each slave node receives its corresponding test script, the server performs a performance test through each slave node to obtain the corresponding test result. Specifically, when each slave node receives its corresponding test script, the server parses its corresponding test script through each slave node to obtain its corresponding test request; through each slave node executes its corresponding test request, obtains its corresponding test script. Test result: The server records the corresponding test result through each slave node.
需要说明的是,性能测试指标包含并发数、平均响应时长、请求成功率、每秒钟请求或者事务数量的并发数,即QPS/TPS。其中,QPS/TPS与并发数和平均响应时长的关系为QPS/TPS等于并发数与平均响应时间相除。It should be noted that the performance test indicators include the number of concurrency, average response time, request success rate, and the number of concurrent requests or transactions per second, namely QPS/TPS. Among them, the relationship between QPS/TPS and the number of concurrencies and the average response time is that QPS/TPS is equal to the number of concurrencies divided by the average response time.
208、通过各个从节点将各自对应的测试结果发送到主节点;208. Send the corresponding test results to the master node through each slave node;
服务器通过各个从节点将各自对应的测试结果发送到主节点。具体的,服务器通过各个从节点接收各自对应的测试结果,服务器通过各个从节点以RMI服务方式将各自对应的测试结果发送到主节点,该各自对应的测试结果为同一测试计划下的测试请求,但是各自对应的测试结果并不相同。该测试结果包括正常测试数据和异常测试数据。The server sends the corresponding test results to the master node through each slave node. Specifically, the server receives the corresponding test results through each slave node, and the server sends the corresponding test results to the master node through each slave node in the RMI service mode. The respective test results are test requests under the same test plan. But the corresponding test results are not the same. The test results include normal test data and abnormal test data.
209、通过主节点统计各自对应的测试结果,得到性能测试结果。209. Obtain performance test results through the master node statistics of respective test results.
服务器通过主节点统计各自对应的测试结果,得到性能测试结果。具体的,服务器通过主节点接收各个从节点的各自对应的测试结果,服务器根据预置的统计脚本对各个从节点的各自对应的测试结果进行计算和分类,得到性能测试结果。进一步地,服务器通过主节点的Jmeter应用对性能测试结果进行展示。The server counts the corresponding test results through the master node, and obtains the performance test results. Specifically, the server receives the respective test results of each slave node through the master node, and the server calculates and classifies the respective test results of each slave node according to a preset statistical script to obtain the performance test result. Further, the server displays the performance test results through the Jmeter application of the master node.
需要说明的是,每个从节点的吞度量与用户请求对CPU的消耗紧密关联。单个用户请求对CPU消耗越高,每个从节点的吞吐能力越低,也就是处理的并发数越少。It should be noted that the throughput of each slave node is closely related to the CPU consumption of user requests. The higher the CPU consumption of a single user request, the lower the throughput of each slave node, that is, the smaller the number of concurrent processing.
本申请实施例中,通过镜像仓库对Jmeter镜像进行版本控制,支持版本回滚,同时采用基于容器的分布式节点部署Jmeter镜像并进行性能测试,容器之间进程不会相互影响,能区分计算资源,并且相对于虚拟机,容器能快速部署。由于容器与底层设施和机器文件系统是解耦的,能在不同云和不同版本操作系统间进行迁移,部署过程简单化,提高测试效率。In the embodiment of the application, the Jmeter image is version controlled through the mirror warehouse, and version rollback is supported. At the same time, the container-based distributed node is used to deploy the Jmeter image and perform performance testing. The processes between the containers will not affect each other and can distinguish computing resources , And compared to virtual machines, containers can be deployed quickly. Because the container is decoupled from the underlying facilities and the machine file system, it can be migrated between different clouds and different versions of operating systems, simplifying the deployment process and improving test efficiency.
参阅图3,图3为本申请实施例中基于Jmeter的分布式性能测试装置一个实施例包括:Referring to FIG. 3, FIG. 3 is an embodiment of a Jmeter-based distributed performance testing device in an embodiment of the application, including:
部署单元301,用于将预测版本的Jmeter镜像部署到分布式节点,该分布式节点包括一个主节点和至少一个从节点;The deployment unit 301 is configured to deploy the predicted version of the Jmeter image to a distributed node, and the distributed node includes a master node and at least one slave node;
控制单元302,当主节点接收到启动测试指令时,用于通过主节点向各个从节点发送各自对应的测试脚本;The control unit 302, when the master node receives the start test instruction, is used to send the corresponding test script to each slave node through the master node;
测试单元303,当各个从节点接收到各自对应的测试脚本时,用于通过各个从节点进行性能测试,得到各自对应的测试结果;The test unit 303, when each slave node receives its corresponding test script, is used to perform a performance test through each slave node to obtain respective test results;
发送单元304,用于通过各个从节点将各自对应的测试结果发送到主节点;The sending unit 304 is configured to send the corresponding test results to the master node through each slave node;
统计单元305,用于通过主节点统计各自对应的测试结果,得到性能测试结果。The statistics unit 305 is configured to count the respective test results corresponding to the master nodes to obtain the performance test results.
本申请实施例中,通过镜像仓库对Jmeter镜像进行版本控制,支持版本 回滚,同时采用基于容器的分布式节点部署Jmeter镜像并进行性能测试,容器之间进程不会相互影响,能区分计算资源,并且相对于虚拟机,容器能快速部署。由于容器与底层设施和机器文件系统是解耦的,能在不同云和不同版本操作系统间进行迁移,部署过程简单化,提高测试效率。In the embodiment of the application, the Jmeter image is version controlled through the mirror warehouse, and version rollback is supported. At the same time, the container-based distributed node is used to deploy the Jmeter image and perform performance testing. The processes between the containers will not affect each other and can distinguish computing resources , And compared to virtual machines, containers can be deployed quickly. Because the container is decoupled from the underlying facilities and the machine file system, it can be migrated between different clouds and different versions of operating systems, simplifying the deployment process and improving test efficiency.
参阅图4,图4为本申请实施例中基于Jmeter的分布式性能测试装置的另一个实施例包括:Referring to FIG. 4, FIG. 4 is another embodiment of the Jmeter-based distributed performance testing device in the embodiment of the application, including:
部署单元301,用于将预测版本的Jmeter镜像部署到分布式节点,该分布式节点包括一个主节点和至少一个从节点;The deployment unit 301 is configured to deploy the predicted version of the Jmeter image to a distributed node, and the distributed node includes a master node and at least one slave node;
控制单元302,当主节点接收到启动测试指令时,用于通过主节点向各个从节点发送各自对应的测试脚本;The control unit 302, when the master node receives the start test instruction, is used to send the corresponding test script to each slave node through the master node;
测试单元303,当各个从节点接收到各自对应的测试脚本时,用于通过各个从节点进行性能测试,得到各自对应的测试结果;The test unit 303, when each slave node receives its corresponding test script, is used to perform a performance test through each slave node to obtain respective test results;
发送单元304,用于通过各个从节点将各自对应的测试结果发送到主节点;The sending unit 304 is configured to send the corresponding test results to the master node through each slave node;
统计单元305,用于通过主节点统计各自对应的测试结果,得到性能测试结果。The statistics unit 305 is configured to count the respective test results corresponding to the master nodes to obtain the performance test results.
可选的,部署单元301还可进一步包括:Optionally, the deployment unit 301 may further include:
选择子单元3011,用于从镜像仓库中选择预测版本的Jmeter镜像;The selection subunit 3011 is used to select the predicted version of the Jmeter image from the image warehouse;
设置子单元3012,用于通过弹性计算服务ECS实例设置分布式节点,分布式节点包括一个主节点和至少一个从节点;The setting subunit 3012 is used to set up distributed nodes through the ECS instance of the elastic computing service, and the distributed nodes include a master node and at least one slave node;
第一判断子单元3013,用于判断主节点和各个从节点是否同时存在预测版本的Jmeter镜像;The first judging subunit 3013 is used to judge whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node;
部署子单元3014,若主节点和各个从节点不同时存在预测版本的Jmeter镜像,则用于通过预置方式部署预测版本的Jmeter镜像,得到部署结果;The deployment subunit 3014, if the master node and each slave node do not have the predicted version of the Jmeter image at the same time, it is used to deploy the predicted version of the Jmeter image in a preset manner to obtain the deployment result;
确认子单元3015,若主节点和各个从节点同时存在预测版本的Jmeter镜像,则用于确定部署成功。The confirmation sub-unit 3015 is used to determine that the deployment is successful if the Jmeter image of the predicted version exists at the same time on the master node and each slave node.
可选的,部署子单元3014还可以具体用于:Optionally, the deployment subunit 3014 may also be specifically used for:
若主节点和各个从节点不同时存在预测版本的Jmeter镜像,则将预测版本的Jmeter镜像部署到ECS实例上,得到Jmeter应用;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image to the ECS instance to obtain the Jmeter application;
通过容器docker运行Jmeter应用;Run Jmeter application through container docker;
将各个从节点对应的配置信息添加到主节点的控制列表中,各个从节点对应的配置信息包括各自对应的IP地址和各自对应的端口;Add the configuration information corresponding to each slave node to the control list of the master node, and the configuration information corresponding to each slave node includes its corresponding IP address and its corresponding port;
重启主节点的Jmeter应用,得到部署结果。Restart the Jmeter application of the master node to get the deployment result.
可选的,部署单元301还可进一步包括:Optionally, the deployment unit 301 may further include:
第二判断子单元3016,用于判断部署结果是否为目标值,该目标值用于指示成功部署预测版本的Jmeter镜像;The second judging subunit 3016 is used to judge whether the deployment result is a target value, and the target value is used to indicate the successful deployment of the predicted version of the Jmeter image;
第一处理子单元3017,若部署结果不为目标值,则用于重新部署;The first processing subunit 3017, if the deployment result is not the target value, is used for redeployment;
第二处理子单元3018,若部署结果为目标值,则用于确定部署成功。The second processing subunit 3018, if the deployment result is the target value, is used to determine that the deployment is successful.
可选的,控制单元302还可以具体用于:Optionally, the control unit 302 may also be specifically configured to:
将主节点设置为远程方法调用RMI的客户端;Set the master node as the client of remote method invocation RMI;
将各个从节点设置为RMI的服务器端;Set each slave node as the server side of RMI;
当主节点接收到启动测试指令时,通过主节点执行测试计划,该测试计划包括总测试数据和测试脚本;When the master node receives the start test instruction, the master node executes the test plan, which includes the total test data and the test script;
解析主节点的控制列表,得到各个从节点对应的配置信息;Parse the control list of the master node to obtain the configuration information corresponding to each slave node;
根据各个从节点对应的配置信息对总测试数据进行拆分,得到各个从节点对应的测试数据;Split the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node;
根据各个从节点对应的测试数据替换测试脚本中的关键字,得到各自对应的测试脚本;Replace the keywords in the test script according to the test data corresponding to each slave node to obtain the corresponding test script;
通过主节点以RMI方式向各个从节点推送各自对应的测试脚本。Push the corresponding test script to each slave node through the master node in RMI mode.
可选的,测试单元303还可以具体用于:Optionally, the test unit 303 may also be specifically used for:
当各个从节点接收到各自对应的测试脚本时,通过各个从节点解析各自对应的测试脚本,得到各自对应的测试请求;When each slave node receives its corresponding test script, each slave node analyzes its corresponding test script to obtain its corresponding test request;
通过各个从节点执行各自对应的测试请求,得到各自对应的测试结果。Each slave node executes its corresponding test request to obtain its corresponding test result.
可选的,基于Jmeter的分布式性能测试装置还可以进一步包括:Optionally, the Jmeter-based distributed performance testing device may further include:
上传单元306,用于将预测版本的Jmeter镜像上传到镜像仓库;The uploading unit 306 is used to upload the Jmeter image of the predicted version to the image warehouse;
管理单元307,用于通过打标签方式对预测版本的Jmeter镜像进行版本管理。The management unit 307 is configured to perform version management on the Jmeter image of the predicted version by tagging.
本申请实施例中,通过镜像仓库对Jmeter镜像进行版本控制,支持版本回滚,同时采用基于容器的分布式节点部署Jmeter镜像并进行性能测试,容器之间进程不会相互影响,能区分计算资源,并且相对于虚拟机,容器能快速部署。由于容器与底层设施和机器文件系统是解耦的,能在不同云和不同版本操作系统间进行迁移,部署过程简单化,提高测试效率。In the embodiment of the application, the Jmeter image is version controlled through the mirror warehouse, and version rollback is supported. At the same time, the container-based distributed node is used to deploy the Jmeter image and perform performance testing. The processes between the containers will not affect each other and can distinguish computing resources. , And compared to virtual machines, containers can be deployed quickly. Because the container is decoupled from the underlying facilities and the machine file system, it can be migrated between different clouds and different versions of operating systems, simplifying the deployment process and improving test efficiency.
上面图3和图4从模块化功能实体的角度对本申请实施例中的基于Jmeter的分布式性能测试装置进行详细描述,下面从硬件处理的角度对本申请实施例中基于Jmeter的分布式性能测试设备进行详细描述。The above figures 3 and 4 describe in detail the Jmeter-based distributed performance test device in the embodiment of the present application from the perspective of modular functional entities. The following describes the Jmeter-based distributed performance test device in the embodiment of the present application from the perspective of hardware processing Give a detailed description.
图5是本申请实施例提供的一种基于Jmeter的分布式性能测试设备的结 构示意图,该基于Jmeter的分布式性能测试设备500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)501(例如,一个或一个以上处理器)和存储器509,一个或一个以上存储应用程序509或数据509的存储介质508(例如一个或一个以上海量存储设备)。其中,存储器509和存储介质508可以是短暂存储或持久存储。存储在存储介质508的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对基于Jmeter的分布式性能测试中的一系列指令操作。更进一步地,处理器501可以设置为与存储介质508通信,在基于Jmeter的分布式性能测试设备500上执行存储介质508中的一系列指令操作。FIG. 5 is a schematic structural diagram of a Jmeter-based distributed performance testing device provided by an embodiment of the present application. The Jmeter-based distributed performance testing device 500 may have relatively large differences due to different configurations or performances, and may include one or One or more processors (central processing units, CPU) 501 (for example, one or more processors) and memory 509, one or more storage media 508 for storing application programs 509 or data 509 (for example, one or one storage device with a large amount of ). Among them, the memory 509 and the storage medium 508 may be short-term storage or persistent storage. The program stored in the storage medium 508 may include one or more modules (not shown in the figure), and each module may include a series of command operations in the Jmeter-based distributed performance test. Further, the processor 501 may be configured to communicate with the storage medium 508, and execute a series of instruction operations in the storage medium 508 on the Jmeter-based distributed performance testing device 500.
基于Jmeter的分布式性能测试设备500还可以包括一个或一个以上电源502,一个或一个以上有线或无线网络接口503,一个或一个以上输入输出接口504,和/或,一个或一个以上操作系统505。本领域技术人员可以理解,图5示出的基于Jmeter的分布式性能测试设备结构并不构成对基于Jmeter的分布式性能测试设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The distributed performance test equipment 500 based on Jmeter may also include one or more power supplies 502, one or more wired or wireless network interfaces 503, one or more input and output interfaces 504, and/or, one or more operating systems 505 . Those skilled in the art can understand that the structure of the Jmeter-based distributed performance test equipment shown in FIG. 5 does not constitute a limitation on the Jmeter-based distributed performance test equipment, and may include more or less components than shown, or Combining certain components, or different component arrangements.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质,其中,该计算机可读存储介质可以为非易失性存储介质,也可以为易失性存储介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program code Wherein, the computer-readable storage medium may be a non-volatile storage medium or a volatile storage medium.

Claims (20)

  1. 一种基于Jmeter的分布式性能测试方法,所述基于Jmeter的分布式性能测试方法包括以下步骤:A distributed performance test method based on Jmeter. The distributed performance test method based on Jmeter includes the following steps:
    将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;Deploying the predicted version of the Jmeter image to a distributed node, the distributed node including a master node and at least one slave node;
    当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本;When the master node receives the test start instruction, sending the corresponding test script to each slave node through the master node;
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;When each slave node receives the corresponding test script, perform a performance test through each slave node to obtain respective corresponding test results;
    通过各个从节点将所述各自对应的测试结果发送到所述主节点;Sending the respective corresponding test results to the master node through each slave node;
    通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。The respective corresponding test results are counted by the master node to obtain performance test results.
  2. 根据权利要求1所述的基于Jmeter的分布式性能测试方法,所述将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点包括:The Jmeter-based distributed performance testing method according to claim 1, wherein the deployment of the predicted version of the Jmeter image to a distributed node, the distributed node including a master node and at least one slave node includes:
    从镜像仓库中选择预测版本的Jmeter镜像;Select the predicted version of Jmeter mirror from the mirror warehouse;
    通过弹性计算服务ECS实例设置所述分布式节点,所述分布式节点包括所述一个主节点和所述至少一个从节点;Setting the distributed node through an ECS instance of the elastic computing service, the distributed node including the one master node and the at least one slave node;
    判断所述主节点和各个从节点是否同时存在所述预测版本的Jmeter镜像;Determine whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node;
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image in a preset manner to obtain the deployment result;
    若所述主节点和各个从节点同时存在所述预测版本的Jmeter镜像,则确定部署成功。If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, it is determined that the deployment is successful.
  3. 根据权利要求2所述的基于Jmeter的分布式性能测试方法,所述若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果包括:The Jmeter-based distributed performance testing method according to claim 2, wherein if the master node and each slave node do not have the predicted version of Jmeter mirror at the same time, deploy the predicted version of Jmeter in a preset manner Mirror, get deployment results including:
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则将所述预测版本的Jmeter镜像部署到所述ECS实例上,得到Jmeter应用;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image on the ECS instance to obtain a Jmeter application;
    通过容器docker运行所述Jmeter应用;Run the Jmeter application through the container docker;
    将各个从节点对应的配置信息添加到所述主节点的控制列表中,所述各个从节点对应的配置信息包括各自对应的IP地址和各自对应的端口;Adding configuration information corresponding to each slave node to the control list of the master node, where the configuration information corresponding to each slave node includes each corresponding IP address and each corresponding port;
    重启所述主节点的Jmeter应用,得到部署结果。Restart the Jmeter application of the master node to obtain the deployment result.
  4. 根据权利要求2所述的基于Jmeter的分布式性能测试方法,所述若 所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果之后,所述基于Jmeter的分布式性能测试方法还包括:The Jmeter-based distributed performance testing method according to claim 2, wherein if the master node and each slave node do not have the predicted version of Jmeter mirror at the same time, deploy the predicted version of Jmeter in a preset manner After the deployment result is obtained by mirroring, the Jmeter-based distributed performance testing method further includes:
    判断所述部署结果是否为目标值,所述目标值用于指示成功部署所述预测版本的Jmeter镜像;Determining whether the deployment result is a target value, where the target value is used to indicate successful deployment of the predicted version of the Jmeter image;
    若所述部署结果不为所述目标值,则重新部署;If the deployment result is not the target value, redeploy;
    若所述部署结果为所述目标值,则确定部署成功。If the deployment result is the target value, it is determined that the deployment is successful.
  5. 根据权利要求3所述的基于Jmeter的分布式性能测试方法,所述当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本包括:According to the Jmeter-based distributed performance testing method according to claim 3, when the master node receives a test start instruction, sending the corresponding test script to each slave node through the master node comprises:
    将所述主节点设置为远程方法调用RMI的客户端;Setting the master node as a client for remote method invocation RMI;
    将各个从节点设置为所述RMI的服务器;Setting each slave node as the RMI server;
    当所述主节点接收到启动测试指令时,通过所述主节点执行测试计划,所述测试计划包括总测试数据和测试脚本;When the master node receives a test start instruction, execute a test plan through the master node, the test plan including total test data and test scripts;
    解析所述主节点的控制列表,得到所述各个从节点对应的配置信息;Parse the control list of the master node to obtain configuration information corresponding to each slave node;
    根据所述各个从节点对应的配置信息对所述总测试数据进行拆分,得到各个从节点对应的测试数据;Split the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node;
    根据所述各个从节点对应的测试数据替换所述测试脚本中的关键字,得到所述各自对应的测试脚本;Replacing keywords in the test script according to the test data corresponding to each slave node to obtain the respective corresponding test script;
    通过所述主节点以所述RMI方式向各个从节点推送所述各自对应的测试脚本。Push the corresponding test script to each slave node through the master node in the RMI manner.
  6. 根据权利要求5所述的基于Jmeter的分布式性能测试方法,所述当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果包括:According to the Jmeter-based distributed performance testing method of claim 5, when each slave node receives the respective corresponding test script, performing a performance test through each slave node to obtain respective corresponding test results includes:
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点解析所述各自对应的测试脚本,得到各自对应的测试请求;When each slave node receives the respective corresponding test script, each slave node analyzes the respective corresponding test script to obtain the respective corresponding test request;
    通过各个从节点执行所述各自对应的测试请求,得到所述各自对应的测试结果;Obtain the respective corresponding test results by executing the respective corresponding test requests by each slave node;
    通过各个从节点记录所述各自对应的测试结果。Record the respective corresponding test results through each slave node.
  7. 根据权利要求1述的基于Jmeter的分布式性能测试方法,所述将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点之前,所述基于Jmeter的分布式性能测试方法还包括:The Jmeter-based distributed performance testing method according to claim 1, wherein the predicted version of Jmeter mirror is deployed to distributed nodes, and the distributed node includes a master node and at least one slave node. Distributed performance testing methods also include:
    将所述预测版本的Jmeter镜像上传到所述镜像仓库;Uploading the Jmeter image of the predicted version to the image warehouse;
    通过打标签方式对所述预测版本的Jmeter镜像进行版本管理。Perform version management on the predicted version of the Jmeter image by tagging.
  8. 一种基于Jmeter的分布式性能测试装置,所述基于Jmeter的分布式性能测试装置包括:A distributed performance testing device based on Jmeter, the distributed performance testing device based on Jmeter includes:
    部署单元,用于将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;A deployment unit for deploying the predicted version of the Jmeter image to a distributed node, the distributed node including a master node and at least one slave node;
    控制单元,当所述主节点接收到启动测试指令时,用于通过所述主节点向各个从节点发送各自对应的测试脚本;The control unit, when the master node receives a test start instruction, is configured to send respective corresponding test scripts to each slave node through the master node;
    测试单元,当各个从节点接收到所述各自对应的测试脚本时,用于通过各个从节点进行性能测试,得到各自对应的测试结果;The test unit, when each slave node receives the respective corresponding test script, is used to perform performance testing through each slave node to obtain respective corresponding test results;
    发送单元,用于通过各个从节点将所述各自对应的测试结果发送到所述主节点;A sending unit, configured to send the respective corresponding test results to the master node through each slave node;
    统计单元,用于通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。The statistical unit is configured to count the respective corresponding test results through the master node to obtain performance test results.
  9. 如权利要求8所述的基于Jmeter的分布式性能测试装置,所述部署单元用于:The Jmeter-based distributed performance testing device according to claim 8, wherein the deployment unit is used for:
    从镜像仓库中选择预测版本的Jmeter镜像;Select the predicted version of Jmeter mirror from the mirror warehouse;
    通过弹性计算服务ECS实例设置所述分布式节点,所述分布式节点包括所述一个主节点和所述至少一个从节点;Setting the distributed node through an ECS instance of the elastic computing service, the distributed node including the one master node and the at least one slave node;
    判断所述主节点和各个从节点是否同时存在所述预测版本的Jmeter镜像;Determine whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node;
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image in a preset manner to obtain the deployment result;
    若所述主节点和各个从节点同时存在所述预测版本的Jmeter镜像,则确定部署成功。If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, it is determined that the deployment is successful.
  10. 如权利要求9所述的基于Jmeter的分布式性能测试装置,所述部署单元还用于:According to the Jmeter-based distributed performance testing device of claim 9, the deployment unit is further configured to:
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则将所述预测版本的Jmeter镜像部署到所述ECS实例上,得到Jmeter应用;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image on the ECS instance to obtain a Jmeter application;
    通过容器docker运行所述Jmeter应用;Run the Jmeter application through the container docker;
    将各个从节点对应的配置信息添加到所述主节点的控制列表中,所述各个从节点对应的配置信息包括各自对应的IP地址和各自对应的端口;Adding configuration information corresponding to each slave node to the control list of the master node, where the configuration information corresponding to each slave node includes each corresponding IP address and each corresponding port;
    重启所述主节点的Jmeter应用,得到部署结果。Restart the Jmeter application of the master node to obtain the deployment result.
  11. 如权利要求9所述的基于Jmeter的分布式性能测试装置,所述装置 还包括判断单元,具体用于:The Jmeter-based distributed performance testing device according to claim 9, wherein the device further comprises a judging unit, specifically configured to:
    判断所述部署结果是否为目标值,所述目标值用于指示成功部署所述预测版本的Jmeter镜像;Determining whether the deployment result is a target value, where the target value is used to indicate successful deployment of the predicted version of the Jmeter image;
    若所述部署结果不为所述目标值,则重新部署;If the deployment result is not the target value, redeploy;
    若所述部署结果为所述目标值,则确定部署成功。If the deployment result is the target value, it is determined that the deployment is successful.
  12. 如权利要求10所述的基于Jmeter的分布式性能测试装置,所述控制单元用于:According to the Jmeter-based distributed performance testing device of claim 10, the control unit is used for:
    将所述主节点设置为远程方法调用RMI的客户端;Setting the master node as a client for remote method invocation RMI;
    将各个从节点设置为所述RMI的服务器;Setting each slave node as the RMI server;
    当所述主节点接收到启动测试指令时,通过所述主节点执行测试计划,所述测试计划包括总测试数据和测试脚本;When the master node receives a test start instruction, execute a test plan through the master node, the test plan including total test data and test scripts;
    解析所述主节点的控制列表,得到所述各个从节点对应的配置信息;Parse the control list of the master node to obtain configuration information corresponding to each slave node;
    根据所述各个从节点对应的配置信息对所述总测试数据进行拆分,得到各个从节点对应的测试数据;Split the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node;
    根据所述各个从节点对应的测试数据替换所述测试脚本中的关键字,得到所述各自对应的测试脚本;Replacing keywords in the test script according to the test data corresponding to each slave node to obtain the respective corresponding test script;
    通过所述主节点以所述RMI方式向各个从节点推送所述各自对应的测试脚本。Push the corresponding test script to each slave node through the master node in the RMI manner.
  13. 如权利要求12所述的基于Jmeter的分布式性能测试装置,所述测试单元用于:The Jmeter-based distributed performance testing device according to claim 12, wherein the testing unit is used for:
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点解析所述各自对应的测试脚本,得到各自对应的测试请求;When each slave node receives the respective corresponding test script, each slave node analyzes the respective corresponding test script to obtain the respective corresponding test request;
    通过各个从节点执行所述各自对应的测试请求,得到所述各自对应的测试结果;Obtain the respective corresponding test results by executing the respective corresponding test requests by each slave node;
    通过各个从节点记录所述各自对应的测试结果。Record the respective corresponding test results through each slave node.
  14. 一种基于Jmeter的分布式性能测试设备,所述基于Jmeter的分布式性能测试设备包括存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互联;所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行以下的步骤:A distributed performance test device based on Jmeter. The distributed performance test device based on Jmeter includes a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected by wires The at least one processor invokes the instructions in the memory, so that the Jmeter-based distributed performance testing equipment executes the following steps:
    将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;Deploying the predicted version of the Jmeter image to a distributed node, the distributed node including a master node and at least one slave node;
    当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发 送各自对应的测试脚本;When the master node receives the test start instruction, sending the corresponding test script to each slave node through the master node;
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;When each slave node receives the corresponding test script, perform a performance test through each slave node to obtain respective corresponding test results;
    通过各个从节点将所述各自对应的测试结果发送到所述主节点;Sending the respective corresponding test results to the master node through each slave node;
    通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。The respective corresponding test results are counted by the master node to obtain performance test results.
  15. 如权利要求14所述的基于Jmeter的分布式性能测试设备,所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行所述基于Jmeter的分布式性能测试程序被所述处理器执行实现所述将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点的步骤时,还执行如下步骤:The Jmeter-based distributed performance testing device according to claim 14, wherein the at least one processor invokes the instructions in the memory, so that the Jmeter-based distributed performance testing device executes the Jmeter-based When the distributed performance test program is executed by the processor to implement the step of deploying the predicted version of the Jmeter image to the distributed node, and the distributed node includes a master node and at least one slave node, the following steps are also executed:
    从镜像仓库中选择预测版本的Jmeter镜像;Select the predicted version of Jmeter mirror from the mirror warehouse;
    通过弹性计算服务ECS实例设置所述分布式节点,所述分布式节点包括所述一个主节点和所述至少一个从节点;Setting the distributed node through an ECS instance of the elastic computing service, the distributed node including the one master node and the at least one slave node;
    判断所述主节点和各个从节点是否同时存在所述预测版本的Jmeter镜像;Determine whether the Jmeter mirror of the predicted version exists at the same time on the master node and each slave node;
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image in a preset manner to obtain the deployment result;
    若所述主节点和各个从节点同时存在所述预测版本的Jmeter镜像,则确定部署成功。If the Jmeter image of the predicted version exists at the same time on the master node and each slave node, it is determined that the deployment is successful.
  16. 如权利要求15所述的基于Jmeter的分布式性能测试设备,所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行所述若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果的步骤时,还执行如下步骤:The Jmeter-based distributed performance testing device according to claim 15, wherein the at least one processor invokes the instructions in the memory, so that the Jmeter-based distributed performance testing device executes the The master node and each slave node do not have the predicted version of the Jmeter image at the same time, then the predicted version of the Jmeter image is deployed in a preset manner, and when the deployment result is obtained, the following steps are also performed:
    若所述主节点和各个从节点不同时存在所述预测版本的Jmeter镜像,则将所述预测版本的Jmeter镜像部署到所述ECS实例上,得到Jmeter应用;If the master node and each slave node do not have the predicted version of the Jmeter image at the same time, deploy the predicted version of the Jmeter image on the ECS instance to obtain a Jmeter application;
    通过容器docker运行所述Jmeter应用;Run the Jmeter application through the container docker;
    将各个从节点对应的配置信息添加到所述主节点的控制列表中,所述各个从节点对应的配置信息包括各自对应的IP地址和各自对应的端口;Adding configuration information corresponding to each slave node to the control list of the master node, where the configuration information corresponding to each slave node includes each corresponding IP address and each corresponding port;
    重启所述主节点的Jmeter应用,得到部署结果。Restart the Jmeter application of the master node to obtain the deployment result.
  17. 如权利要求15所述的基于Jmeter的分布式性能测试设备,所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行所述若所述主节点和各个从节点不同时存在所述预测版 本的Jmeter镜像,则通过预置方式部署所述预测版本的Jmeter镜像,得到部署结果的步骤之后,还执行如下步骤:The Jmeter-based distributed performance testing device according to claim 15, wherein the at least one processor invokes the instructions in the memory, so that the Jmeter-based distributed performance testing device executes the The master node and each slave node do not have the predicted version of the Jmeter image at the same time, then the predicted version of the Jmeter image is deployed in a preset manner, and after the step of obtaining the deployment result, the following steps are performed:
    判断所述部署结果是否为目标值,所述目标值用于指示成功部署所述预测版本的Jmeter镜像;Determining whether the deployment result is a target value, where the target value is used to indicate successful deployment of the predicted version of the Jmeter image;
    若所述部署结果不为所述目标值,则重新部署;If the deployment result is not the target value, redeploy;
    若所述部署结果为所述目标值,则确定部署成功。If the deployment result is the target value, it is determined that the deployment is successful.
  18. 如权利要求16所述的基于Jmeter的分布式性能测试设备,所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行所述当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本的步骤时,还执行如下步骤:16. The Jmeter-based distributed performance testing device according to claim 16, wherein the at least one processor calls the instructions in the memory so that the Jmeter-based distributed performance testing device executes the current When the master node receives the start test instruction, when the master node sends the corresponding test script to each slave node through the master node, the following steps are also performed:
    将所述主节点设置为远程方法调用RMI的客户端;Setting the master node as a client for remote method invocation RMI;
    将各个从节点设置为所述RMI的服务器;Setting each slave node as the RMI server;
    当所述主节点接收到启动测试指令时,通过所述主节点执行测试计划,所述测试计划包括总测试数据和测试脚本;When the master node receives a test start instruction, execute a test plan through the master node, the test plan including total test data and test scripts;
    解析所述主节点的控制列表,得到所述各个从节点对应的配置信息;Parse the control list of the master node to obtain configuration information corresponding to each slave node;
    根据所述各个从节点对应的配置信息对所述总测试数据进行拆分,得到各个从节点对应的测试数据;Split the total test data according to the configuration information corresponding to each slave node to obtain the test data corresponding to each slave node;
    根据所述各个从节点对应的测试数据替换所述测试脚本中的关键字,得到所述各自对应的测试脚本;Replacing keywords in the test script according to the test data corresponding to each slave node to obtain the respective corresponding test script;
    通过所述主节点以所述RMI方式向各个从节点推送所述各自对应的测试脚本。Push the corresponding test script to each slave node through the master node in the RMI manner.
  19. 如权利要求18所述的基于Jmeter的分布式性能测试设备,所述至少一个处理器调用所述存储器中的所述指令,以使得所述基于Jmeter的分布式性能测试设备执行所述当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果的步骤时,还执行如下步骤:The Jmeter-based distributed performance testing device according to claim 18, wherein the at least one processor calls the instructions in the memory, so that the Jmeter-based distributed performance testing device executes each slave When the nodes receive the respective corresponding test scripts, perform the performance test through each slave node, and obtain the respective corresponding test results, they also perform the following steps:
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点解析所述各自对应的测试脚本,得到各自对应的测试请求;When each slave node receives the respective corresponding test script, each slave node analyzes the respective corresponding test script to obtain the respective corresponding test request;
    通过各个从节点执行所述各自对应的测试请求,得到所述各自对应的测试结果;Obtaining the respective corresponding test results by executing the respective corresponding test requests by each slave node;
    通过各个从节点记录所述各自对应的测试结果。Record the corresponding test results through each slave node.
  20. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:A computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
    将预测版本的Jmeter镜像部署到分布式节点,所述分布式节点包括一个主节点和至少一个从节点;Deploying the predicted version of the Jmeter image to a distributed node, the distributed node including a master node and at least one slave node;
    当所述主节点接收到启动测试指令时,通过所述主节点向各个从节点发送各自对应的测试脚本;When the master node receives the test start instruction, sending the corresponding test script to each slave node through the master node;
    当各个从节点接收到所述各自对应的测试脚本时,通过各个从节点进行性能测试,得到各自对应的测试结果;When each slave node receives the corresponding test script, perform a performance test through each slave node to obtain respective corresponding test results;
    通过各个从节点将所述各自对应的测试结果发送到所述主节点;Sending the respective corresponding test results to the master node through each slave node;
    通过所述主节点统计所述各自对应的测试结果,得到性能测试结果。The respective corresponding test results are counted by the master node to obtain performance test results.
PCT/CN2019/119070 2019-06-17 2019-11-18 Jmeter-based distributed performance test method and apparatus, device, and storage medium WO2020253079A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910523487.4A CN110417613B (en) 2019-06-17 2019-06-17 Distributed performance testing method, device, equipment and storage medium based on Jmeter
CN201910523487.4 2019-06-17

Publications (1)

Publication Number Publication Date
WO2020253079A1 true WO2020253079A1 (en) 2020-12-24

Family

ID=68359200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119070 WO2020253079A1 (en) 2019-06-17 2019-11-18 Jmeter-based distributed performance test method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN110417613B (en)
WO (1) WO2020253079A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596750A (en) * 2020-12-28 2021-04-02 上海安畅网络科技股份有限公司 Application testing method and device, electronic equipment and computer readable storage medium
CN112817858A (en) * 2021-02-05 2021-05-18 深圳市世强元件网络有限公司 Method and computer equipment for batch generation of test data based on Jmeter
CN113204410A (en) * 2021-05-31 2021-08-03 平安科技(深圳)有限公司 Container type localized deployment method, system, equipment and storage medium
CN113704358A (en) * 2021-09-02 2021-11-26 湖南麒麟信安科技股份有限公司 Distributed task cooperative processing method and device and computer equipment
CN114546852A (en) * 2022-02-21 2022-05-27 北京百度网讯科技有限公司 Performance test method and device, electronic equipment and storage medium
EP4155942A3 (en) * 2021-11-29 2023-04-26 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for load testing, and corresponding storage medium
CN117234827A (en) * 2023-11-14 2023-12-15 武汉凌久微电子有限公司 Multi-platform automatic test method and system based on domestic graphic processor

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417613B (en) * 2019-06-17 2022-11-29 平安科技(深圳)有限公司 Distributed performance testing method, device, equipment and storage medium based on Jmeter
CN110727570A (en) * 2019-10-11 2020-01-24 重庆紫光华山智安科技有限公司 Concurrent pressure measurement method and related device
CN111078516A (en) * 2019-11-26 2020-04-28 支付宝(杭州)信息技术有限公司 Distributed performance test method and device and electronic equipment
CN111400192A (en) * 2020-04-02 2020-07-10 北京达佳互联信息技术有限公司 Service program performance testing method and device, electronic equipment and storage medium
CN111817913B (en) * 2020-06-30 2022-05-17 北京红山信息科技研究院有限公司 Distributed network performance test method, system, server and storage medium
CN111858352B (en) * 2020-07-22 2024-04-05 中国平安财产保险股份有限公司 Method, device, equipment and storage medium for automatic test monitoring
CN112346979A (en) * 2020-11-11 2021-02-09 杭州飞致云信息科技有限公司 Software performance testing method, system and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130019242A1 (en) * 2011-07-13 2013-01-17 Institute For Information Industry Cloud-Based Test System and Method and Computer-Readable Storage Medium with Computer Program to Execute the Method
CN106936636A (en) * 2017-03-15 2017-07-07 无锡华云数据技术服务有限公司 A kind of implementation method of the cloud computing test platform of rapid deployment containerization
CN108038013A (en) * 2017-11-30 2018-05-15 海尔优家智能科技(北京)有限公司 Distributed performance test method and device and computer-readable recording medium
CN109739744A (en) * 2018-12-05 2019-05-10 北京奇艺世纪科技有限公司 A kind of test macro and method
CN110417613A (en) * 2019-06-17 2019-11-05 平安科技(深圳)有限公司 Distributed performance test method, device, equipment and storage medium based on Jmeter

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471675A (en) * 2015-11-20 2016-04-06 浪潮电子信息产业股份有限公司 Method and system of testing nodes in batches
CN107688526A (en) * 2017-08-25 2018-02-13 上海壹账通金融科技有限公司 Performance test methods, device, computer equipment and the storage medium of application program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130019242A1 (en) * 2011-07-13 2013-01-17 Institute For Information Industry Cloud-Based Test System and Method and Computer-Readable Storage Medium with Computer Program to Execute the Method
CN106936636A (en) * 2017-03-15 2017-07-07 无锡华云数据技术服务有限公司 A kind of implementation method of the cloud computing test platform of rapid deployment containerization
CN108038013A (en) * 2017-11-30 2018-05-15 海尔优家智能科技(北京)有限公司 Distributed performance test method and device and computer-readable recording medium
CN109739744A (en) * 2018-12-05 2019-05-10 北京奇艺世纪科技有限公司 A kind of test macro and method
CN110417613A (en) * 2019-06-17 2019-11-05 平安科技(深圳)有限公司 Distributed performance test method, device, equipment and storage medium based on Jmeter

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596750A (en) * 2020-12-28 2021-04-02 上海安畅网络科技股份有限公司 Application testing method and device, electronic equipment and computer readable storage medium
CN112596750B (en) * 2020-12-28 2022-04-26 上海安畅网络科技股份有限公司 Application testing method and device, electronic equipment and computer readable storage medium
CN112817858A (en) * 2021-02-05 2021-05-18 深圳市世强元件网络有限公司 Method and computer equipment for batch generation of test data based on Jmeter
CN112817858B (en) * 2021-02-05 2024-04-19 深圳市世强元件网络有限公司 Method and computer equipment for batch generation of test data based on Jmeter
CN113204410A (en) * 2021-05-31 2021-08-03 平安科技(深圳)有限公司 Container type localized deployment method, system, equipment and storage medium
CN113204410B (en) * 2021-05-31 2024-01-30 平安科技(深圳)有限公司 Container type localization deployment method, system, equipment and storage medium
CN113704358A (en) * 2021-09-02 2021-11-26 湖南麒麟信安科技股份有限公司 Distributed task cooperative processing method and device and computer equipment
EP4155942A3 (en) * 2021-11-29 2023-04-26 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for load testing, and corresponding storage medium
CN114546852A (en) * 2022-02-21 2022-05-27 北京百度网讯科技有限公司 Performance test method and device, electronic equipment and storage medium
CN114546852B (en) * 2022-02-21 2024-04-09 北京百度网讯科技有限公司 Performance test method and device, electronic equipment and storage medium
CN117234827A (en) * 2023-11-14 2023-12-15 武汉凌久微电子有限公司 Multi-platform automatic test method and system based on domestic graphic processor
CN117234827B (en) * 2023-11-14 2024-02-13 武汉凌久微电子有限公司 Multi-platform automatic test method and system based on domestic graphic processor

Also Published As

Publication number Publication date
CN110417613B (en) 2022-11-29
CN110417613A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2020253079A1 (en) Jmeter-based distributed performance test method and apparatus, device, and storage medium
US11914486B2 (en) Cloning and recovery of data volumes
US11593149B2 (en) Unified resource management for containers and virtual machines
US11422853B2 (en) Dynamic tree determination for data processing
US9971823B2 (en) Dynamic replica failure detection and healing
CN107229520B (en) Data center operating system
CN112099918A (en) Live migration of clusters in containerized environments
US9996593B1 (en) Parallel processing framework
US20060095435A1 (en) Configuring and deploying portable application containers for improved utilization of server capacity
KR20170051471A (en) Methods and systems for portably deploying applications on one or more cloud systems
JP2009519523A (en) Method, system, and computer program for monitoring the performance of a target virtual operating system within a virtual data center complex
US20080189713A1 (en) System and Method for Performing Systems Management on IT-Resources Using Web Services
CN110365762B (en) Service processing method, device, equipment and storage medium
US10289441B1 (en) Intelligent scale-out federated restore
CN103430150A (en) Technique for resource creation in a cloud computing system
WO2015149505A1 (en) Sdn application integration, management and control method, system and device
US20190272224A1 (en) Establishing and monitoring programming environments
US11588698B2 (en) Pod migration across nodes of a cluster
JP6607963B2 (en) Data store for aggregated metrics measurements
US7979870B1 (en) Method and system for locating objects in a distributed computing environment
US20210224102A1 (en) Characterizing operation of software applications having large number of components
US7313786B2 (en) Grid-enabled ANT compatible with both stand-alone and grid-based computing systems
Tang et al. Application centric lifecycle framework in cloud
CN112351098B (en) Copying service cluster system, control method, device and medium
US20220382601A1 (en) Configuration map based sharding for containers in a machine learning serving infrastructure

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19934051

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19934051

Country of ref document: EP

Kind code of ref document: A1