[go: up one dir, main page]

CN113821386A - Performance testing method, apparatus, network device, and computer-readable storage medium - Google Patents

Performance testing method, apparatus, network device, and computer-readable storage medium Download PDF

Info

Publication number
CN113821386A
CN113821386A CN202010565158.9A CN202010565158A CN113821386A CN 113821386 A CN113821386 A CN 113821386A CN 202010565158 A CN202010565158 A CN 202010565158A CN 113821386 A CN113821386 A CN 113821386A
Authority
CN
China
Prior art keywords
data
split
splitting
script
load machines
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202010565158.9A
Other languages
Chinese (zh)
Inventor
蔡晓凌
李笑
陈玥
屈勇
周孝雅
王宇霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SF Technology Co Ltd
Original Assignee
SF Technology Co Ltd
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 SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN202010565158.9A priority Critical patent/CN113821386A/en
Publication of CN113821386A publication Critical patent/CN113821386A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请实施例公开了一种性能测试方法、装置、网络设备及计算机可读存储介质,本申请实施例中性能测试装置获取数据拆分请求,数据拆分请求包括待处理数据以及待处理数据的拆分方案;然后根据拆分方案对待处理数据进行拆分处理,得到N个拆分后数据;再将拆分后数据分别拷贝至N个负载机的指定路径下;并将待运行脚本中的数据引用路径调整为指定路径,得到调整后脚本;最后调用N个负载机,根据调整后脚本分别从指定路径下读取拆分后数据,使得N个负载机根据拆分后数据分别进行性能测试。本方案可以对数据进行拆分,并且可以通过修改待运行脚本,使得负载机正确获取到拆分后的数据并进行性能测试,故本方案可以提高数据多样化处理的能力。

Figure 202010565158

The embodiments of the present application disclose a performance testing method, apparatus, network device, and computer-readable storage medium. In the embodiments of the present application, the performance testing apparatus obtains a data splitting request, and the data splitting request includes the data to be processed and the data of the data to be processed. splitting scheme; then split and process the data to be processed according to the splitting scheme to obtain N split data; then copy the split data to the designated paths of the N load machines; The data reference path is adjusted to the specified path, and the adjusted script is obtained; finally, N load machines are called, and the split data is read from the specified path according to the adjusted script, so that the N load machines perform performance tests according to the split data. . This scheme can split the data, and by modifying the script to be run, the load machine can correctly obtain the split data and perform performance testing, so this scheme can improve the ability of data diversification processing.

Figure 202010565158

Description

Performance test method, device, network equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a performance testing method and apparatus, a network device, and a computer-readable storage medium.
Background
When performing a distributed load performance test, it is necessary to ensure that each load machine participating in the performance test has a piece of data for the script to normally run.
In order to realize some simulation test use scenarios closer to the actual user, there is a need for variability of performance test data on the load machine, such as: the performance test platform has the advantages that a piece of performance test data is provided, the performance test data cannot be repeated on different load machines, and the like, but the existing performance test platform has no capability of data diversification processing, and cannot well simulate the actual use scene of a user during performance test, so that the capability of data diversification processing of the performance test platform needs to be improved in order to better simulate the actual use field of the user.
Disclosure of Invention
The embodiment of the application provides a performance testing method, a performance testing device, network equipment and a computer readable storage medium, which can improve the capability of data diversification processing.
In a first aspect, an embodiment of the present application provides a performance testing method, including:
acquiring a data splitting request, wherein the data splitting request comprises data to be processed and a splitting scheme of the data to be processed;
splitting the data to be processed according to the splitting scheme to obtain N pieces of split data, wherein N is an integer greater than 1;
copying the split data to appointed paths of N load machines respectively;
adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script;
and calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
In some embodiments, the invoking N of the load machines, and reading the split data from the designated path according to the adjusted script respectively includes:
scheduling the adjusted scripts to the N load machines through a scheduling machine;
and calling N load machines, and respectively reading the split data from the specified path according to the adjusted script.
In some embodiments, before the adjusting the data reference path in the script to be executed to the specified path and obtaining the adjusted script, the method further includes:
acquiring a test scene type;
and determining the script to be operated from a preset script database according to the test scene type.
In some embodiments, after the obtaining the data split request, the method further comprises:
determining whether the number of preset load machines is not less than N;
the splitting the data to be processed according to the splitting scheme to obtain N split data, including:
and if the number of the preset load machines is not less than N, splitting the data to be processed according to the splitting scheme to obtain the N pieces of split data.
In some embodiments, after determining whether the preset number of load machines is not less than the number of data splits in the splitting scheme, the method further comprises:
and if the preset number of the load machines is less than N, sending out a reminding signal that the number of the load machines is insufficient.
In some embodiments, the splitting the to-be-processed data according to the splitting scheme to obtain N pieces of split data includes:
splitting the data to be split according to the splitting scheme to obtain N pieces of split data;
the respectively copying the split data to the designated paths of the N load machines includes: copying the split data and the non-split data to appointed paths of N load machines respectively;
the calling N load machines, respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data, including:
and calling the N load machines, and respectively reading the split data and the non-split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data and the non-split data.
In some embodiments, after the obtaining the data split request, the method further comprises:
determining whether the data length of the data to be split is larger than the shortest data length corresponding to the splitting scheme;
the splitting the data to be processed according to the splitting scheme includes:
and if the length of the data to be split is larger than the shortest data length, splitting the data to be split according to the splitting scheme.
In a second aspect, an embodiment of the present application further provides a performance testing apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a data splitting request which comprises to-be-processed data and a splitting scheme of the to-be-processed data;
the processing unit is used for splitting the data to be processed according to the splitting scheme to obtain N pieces of split data, wherein N is an integer greater than 1;
the copying unit is used for copying the split data to the appointed paths of the N load machines respectively;
the adjusting unit is used for adjusting the data reference path in the script to be run into the specified path to obtain an adjusted script;
and the reading unit is used for calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
In some embodiments, the reading unit is specifically configured to:
scheduling the adjusted scripts to the N load machines through a scheduling machine;
and calling N load machines, and respectively reading the split data from the specified path according to the adjusted script.
In some embodiments, the adjusting unit is specifically configured to:
acquiring a test scene type;
and determining the script to be operated from a preset script database according to the test scene type.
In some embodiments, the apparatus further comprises:
a first determination unit configured to determine whether a preset number of load machines is not less than N;
at this time, the processing unit is specifically configured to:
and if the number of the preset load machines is not less than N, splitting the data to be processed according to the splitting scheme to obtain the N pieces of split data.
In some embodiments, the processing unit is further specifically configured to:
and if the preset number of the load machines is less than N, sending out a reminding signal that the number of the load machines is insufficient.
In some embodiments, the data to be processed includes data to be split and data to be split-free, and the processing unit is further specifically configured to:
splitting the data to be split according to the splitting scheme to obtain N pieces of split data;
the copy unit is specifically configured to: copying the split data and the non-split data to the designated paths of the load machine respectively;
at this time, the reading unit is specifically configured to:
and calling the N load machines, and respectively reading the split data and the non-split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data and the non-split data.
In some embodiments, the apparatus further comprises:
a second determining unit, configured to determine whether a data length of the data to be split is greater than a shortest data length corresponding to the splitting scheme;
at this time, the processing unit is specifically configured to:
and if the length of the data to be split is larger than the shortest data length, splitting the data to be split according to the splitting scheme.
In a third aspect, an embodiment of the present application further provides a network device, which includes a memory and a processor, where the memory stores a computer program, and the processor executes, when calling the computer program in the memory, any step in any performance testing method provided in the embodiment of the present application.
In a fourth aspect, the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in any one of the performance testing methods provided by the present application.
In the embodiment of the application, a performance test device acquires a data splitting request, wherein the data splitting request comprises to-be-processed data and a splitting scheme of the to-be-processed data; then, according to the splitting scheme, splitting the data to be processed to obtain N pieces of split data, wherein N is an integer greater than 1; respectively copying the split data to the appointed paths of N load machines; adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script; and finally, calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data. The performance testing device in the scheme can split data, and can correctly acquire the split data and perform performance testing by modifying the script to be operated, so that the data diversification processing capacity can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a performance testing method provided in an embodiment of the present application;
FIG. 2 is another schematic flow chart diagram of a performance testing method provided in the embodiments of the present application;
FIG. 3 is a schematic interface diagram of a user setting a splitting scheme according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an interface for a user to determine a test scenario type according to an embodiment of the present application;
FIG. 5 is a schematic interactive flow chart of a performance testing method provided by an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a performance testing apparatus provided in an embodiment of the present application;
FIG. 7 is a schematic structural diagram of another performance testing apparatus provided in the embodiment of the present application;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may be implemented in hardware.
The principles of the present application may be employed in numerous other general-purpose or special-purpose computing, communication environments or configurations. Examples of well known computing systems, environments, and configurations that may be suitable for use with the application include, but are not limited to, hand-held telephones, personal computers, servers, multiprocessor systems, microcomputer-based systems, mainframe-based computers, and distributed computing environments that include any of the above systems or devices.
The terms "first", "second", and "third", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a performance testing method according to an embodiment of the present application. The execution main body of the performance testing method may be the performance testing apparatus provided in the embodiment of the present application, or a network device integrated with the performance testing apparatus, where the performance testing apparatus may be implemented in a hardware or software manner, and the network device may be a server in a performance testing platform, where the performance testing platform includes a server, a scheduler, and a load machine. The script running method can comprise the following steps:
101. the method comprises the steps of obtaining a data splitting request, wherein the data splitting request comprises data to be processed and a splitting scheme of the data to be processed.
In this embodiment, a server in a performance test platform obtains a data splitting request of a user, in some embodiments, the data to be processed includes data to be split, and in other embodiments, the data to be processed includes the data to be split and data to be not split.
In some embodiments, the splitting scheme in this embodiment may also be used to indicate which data in the data to be processed is to be split and which data is to-be-split data.
In some embodiments, the method further includes obtaining a test scenario type input by the user, and after obtaining the test scenario type, the server needs to store the data to be processed in the test scenario type for management, where the test scenario type is used to determine, from a preset scenario database, a type of a scenario to be executed for a subsequent loader to execute. The test scenario type includes a release scenario or a receiving scenario, and the specific type is not limited herein.
In some embodiments, the process of obtaining the data splitting request is specifically that a user uploads data to be processed to a corresponding test scenario type, and then the user sets an execution scheme on the server, where the execution scheme includes a number N of load machines (N is an integer greater than 1) required by the test and the data to be split in the data to be processed, where the number of required load machines corresponds to the number of split copies of the data to be split.
102. And splitting the data to be processed according to the splitting scheme to obtain N pieces of split data.
In this embodiment, after the server receives the splitting scheme and determines the data to be split in the data to be processed, the data to be processed is split according to the splitting scheme to obtain N pieces of split data, specifically, in some embodiments, the splitting scheme indicates that the data to be split is split averagely, at this time, the data lengths of the split data are the same, so that the workload balance of each subsequent running load machine can be ensured.
In some embodiments, after obtaining the data split request, the method further comprises: and determining whether the number of preset load machines is not less than N to determine whether the number of the load machines in the performance test platform is enough, and if so, splitting the data to be processed according to the splitting scheme to obtain the N split data. And if the preset number of the load machines is less than N, sending out a reminding signal that the number of the load machines is insufficient.
When the server needs to determine the load machines to be operated from the preset load machines according to the splitting scheme, the number of the load machines to be operated in this embodiment is N.
In some embodiments, after obtaining the data split request, the method further comprises: determining whether the data length of the data to be split is larger than the shortest data length corresponding to the splitting scheme; at this time, the splitting the to-be-processed data according to the splitting scheme includes: and if the length of the data to be split is larger than the shortest data length, splitting the data to be split according to the splitting scheme.
103. And copying the split data to the appointed paths of the N load machines respectively.
In this embodiment, the server copies the N pieces of split data to the designated paths of the N load machines, and at this time, each load machine stores one piece of split data.
In some embodiments, when the data to be processed includes the data to be split and the non-split data, at this time, in addition to copying the split data to the designated path of the loader, the non-split data needs to be completely copied to the designated path.
104. And adjusting the data reference path in the script to be run into an appointed path to obtain the adjusted script.
In this embodiment, after the split data (including the non-splitting data if the non-splitting data exists) is copied to the designated path of the load machine, in order to enable the subsequent load machine to read the data, the data reference path in the script to be run needs to be adjusted to the designated path of the load machine, so as to obtain the adjusted script. Namely, the server uniformly adjusts the reference path of the data file in the script to be operated into the appointed path of the data file on the load machine.
105. And calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
Specifically, the server starts the proxy service of all the load machines to be operated, then uses the scheduling service of the scheduling machine to distribute the adjusted script to all the load machines to be operated, each load machine to be operated can read the split data and the split-free data from the appointed path of the load machine according to the adjusted script, and at the moment, each load machine to be operated can perform performance test according to the split data.
In some embodiments, the server in the application may further obtain only non-splitting data, then completely copy the non-splitting data to the designated paths of the load machines, modify the data reference path of the script to be executed as the designated path, and distribute the modified script to be executed to each load machine through the scheduling service of the scheduling machine, so that each load machine reads the non-splitting data from the local, and performs a performance test according to the non-splitting data.
In the embodiment of the application, a performance test device acquires a data splitting request, wherein the data splitting request comprises to-be-processed data and a splitting scheme of the to-be-processed data; then, according to the splitting scheme, splitting the data to be processed to obtain N pieces of split data, wherein N is an integer greater than 1; respectively copying the split data to the appointed paths of N load machines; adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script; and finally, calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data. The performance testing device in the scheme can split data, and can correctly acquire the split data and perform performance testing by modifying the script to be operated, so that the data diversification processing capacity can be improved.
The performance test method described in the above embodiments is further described in detail below.
Referring to fig. 2, fig. 2 is another flow chart of the performance testing method according to the embodiment of the present disclosure. The performance testing method can be applied to a performance testing platform, wherein the performance testing platform comprises a server, a scheduling machine and a load machine.
As shown in fig. 2, the flow of the performance testing method may be as follows:
201. the server acquires a data splitting request, wherein the data splitting request comprises data to be processed and a splitting scheme of the data to be processed.
In some embodiments, the splitting scheme of the data to be processed may be used to indicate which data in the data to be processed is data to be split, which data is data to be split free, and to indicate how many shares the data to be split in the data to be processed is split.
In some embodiments, specifically, the server may obtain the data to be processed first, and then obtain the splitting scheme of the data to be processed.
Referring to fig. 3, fig. 3 is an interface schematic diagram of a splitting scheme set by a user in this embodiment, where the number of load machines in an execution parameter is equal to the number of split copies of data to be split, and a data file is a file to be processed, where a file before "split data" in the file to be processed is the data to be split, and a file that is not hooked is splitting-free data, and when the user clicks a "ok" button, the data is uploaded to a server.
202. The server obtains the test scene type.
In this embodiment, the server may obtain a test scenario type input by the user, where the test scenario type is used to determine a type of a script to be executed for subsequent load machine execution. The test scenario type includes a release scenario or a receiving scenario, and the specific type is not limited herein.
After the server determines the test scenario type, the test data uploads the acquired data file (e.g., data split request) to the environment of the corresponding test scenario type.
As shown in fig. 4, fig. 4 is an interface schematic diagram of the embodiment in which a user determines a test scenario type, and after the user clicks an "execute" button on the interface, the subsequent steps of the present scheme are automatically executed, data to be split is split according to a splitting scheme, and a loader performs performance testing and the like according to the split data.
It should be noted that step 202 may also be executed before step 201, or may also be executed simultaneously with step 201, and the specific execution order is not limited herein.
In some embodiments, after obtaining the data split request, the method further comprises: determining whether the data length of the data to be split is larger than the shortest data length corresponding to the splitting scheme; at this time, the splitting processing is performed on the data to be processed according to the splitting scheme, which includes: and if the length of the data is larger than the shortest data length, splitting the data to be split according to a splitting scheme.
203. And the server determines the script to be run from a preset script database according to the type of the test scene.
In this embodiment, the performance test platform may store a plurality of script data, that is, a preset script database, where a corresponding relationship between the script and the test scenario type is also stored in the script database, and after the server obtains the test scenario type set by the user, the server determines the script to be run from the preset script database according to the test scenario type.
204. The server determines whether the preset number of load machines is not less than N, if not, step 205 is executed, and if not, step 210 is executed.
In this embodiment, each piece of split data needs to be operated by one load machine, so how many load machines need to be operated when data is split, and if it is determined according to the splitting scheme of the data to be processed that the data to be split needs to be split into N pieces, it is determined whether the preset number of load machines is not less than N, where N is an integer greater than 1.
205. And the server splits the data to be split in the data to be processed according to the splitting scheme to obtain N pieces of split data.
When the server determines that the number of the load machines is not less than the number of the data to be split, namely, the number of the load machines in the performance test platform is enough to provide the split data for operation, at this moment, the server performs splitting processing on the data to be split in the data to be processed according to the splitting scheme to obtain N pieces of split data.
In some embodiments, the server performs average splitting on the data to be split according to the splitting scheme indication, and at this time, the data lengths of the split data are the same, so that the workload of each subsequent running load machine can be guaranteed to be balanced.
206. And the server copies the split data and the non-split data to the appointed paths of the N load machines respectively.
The specified path of the load machine, that is, the read path of the data when the load machine needs to operate to read data at the back, may be a preset path or a path allocated to the server, and is not limited herein.
After the data to be split is split into N parts, the N parts of split data are respectively copied to the designated paths of the N load machines, and the non-split data are also respectively copied to the designated paths of the N load machines, at this time, each load machine has one part of split data and one part of complete non-split data, and the diversification of the data is realized.
In some embodiments, the N load machines may be predetermined by the server from the load machines preset by the performance testing platform after the server determines that the number of load machines is not less than the number of the data to be split, or randomly selected from the load machines preset by the performance testing platform when the server copies the data.
207. And the server adjusts the data reference path in the script to be run into an appointed path to obtain the adjusted script.
In order to ensure that the data is successfully quoted from the quote path of the load machine when the load machine quotes the data subsequently, at this time, the script to be run needs to be modified, and the quote path of the data in the script to be run is adjusted to be the designated path, so as to obtain the adjusted script.
208. And the server schedules the adjusted script to the N load machines through the scheduling machine.
In this embodiment, before the load machines need to operate, the server starts the N previously determined load machines, and then distributes the adjusted scripts to the N load machines through the scheduling machine, where each of the N load machines stores the adjusted script.
Specifically, the server sends a scheduling instruction to the scheduling machine, and then the scheduling machine schedules the adjusted script to the N load machines according to the scheduling instruction.
209. And the server calls the N load machines, and reads the split data and the non-split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data and the non-split data.
In this embodiment, the server sends an operation instruction to the N load machines, and the N load machines respectively read the split data and the non-split data from the designated path according to the adjusted script according to the operation instruction, so that the N load machines respectively perform performance tests according to the split data and the non-split data.
210. The server sends out reminding signals that the number of the load machines is not enough.
When the server determines that the number of the load machines is smaller than the number of the data to be split, the number of the load machines in the performance test platform is insufficient, and the test cannot be supported, so that the server sends out a reminding signal indicating that the number of the load machines is insufficient at the moment to remind a user to change the splitting scheme, or the number of the load machines in the platform is increased, so that the number of the load machines is enough to support the test.
For ease of understanding, a specific operational scenario is illustrated here:
referring to fig. 5, a user uploads two data files to a server, where one is client address data given by a client and the other is standard address data of a system, and the user submits a test execution scheme, i.e., a splitting scheme, to the server, and then the server determines whether the two data files need to be split according to the scheme, and splits the data files that need to be split, and then copies the split data to a specified path of a load machine, and directly and completely copies the data files that do not need to be split to the specified path of the load machine.
In the scenario, the client address data needs to be split, the standard address data does not need to be split, then the server modifies a reference path in a test script (i.e. a script to be run) into the specified path, then the test is executed, the script is distributed to each load machine through the scheduling machine, so that the load machine runs the test by using a local data file (i.e. data copied to the specified path of the load machine before) in the running test, wherein the load machine can detect whether the client address data is correct or not (the client address data matched with the address in the standard address data is correct data, otherwise, the client address data is incorrect data), and the client address data is divided into multiple parts to be distributed to a plurality of load machines for running, so that the working efficiency of the performance test platform can be improved.
In the embodiment of the application, a performance test device acquires a data splitting request, wherein the data splitting request comprises to-be-processed data and a splitting scheme of the to-be-processed data; then, according to the splitting scheme, splitting the data to be processed to obtain N pieces of split data, wherein N is an integer greater than 1; respectively copying the split data to the appointed paths of N load machines; adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script; and finally, calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data. The performance testing device in the scheme can split data, and can correctly acquire the split data and perform performance testing by modifying the script to be operated, so that the data diversification processing capacity can be improved.
In order to better implement the performance testing method provided by the embodiment of the present application, the embodiment of the present application further provides a device based on the performance testing method. The terms are the same as those in the performance test method, and specific implementation details can be referred to the description in the method embodiment.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a performance testing apparatus according to an embodiment of the present disclosure, in which the performance testing apparatus 600 may include an obtaining unit 601, a processing unit 602, a copying unit 603, an adjusting unit 604, a reading unit 605, and the like. Wherein:
an obtaining unit 601, configured to obtain a data splitting request, where the data splitting request includes to-be-processed data and a splitting scheme of the to-be-processed data;
a processing unit 602, configured to split the to-be-processed data according to the splitting scheme, so as to obtain N pieces of split data, where N is an integer greater than 1;
a copying unit 603, configured to copy the split data to designated paths of N load machines, respectively;
an adjusting unit 604, configured to adjust a data reference path in the script to be run to the specified path, so as to obtain an adjusted script;
a reading unit 605, configured to call the N load machines, and read the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
In some embodiments, the reading unit 605 is specifically configured to:
scheduling the adjusted scripts to the N load machines through a scheduling machine;
and calling N load machines, and respectively reading the split data from the specified path according to the adjusted script.
In some embodiments, the adjusting unit 604 is specifically configured to:
acquiring a test scene type;
and determining the script to be operated from a preset script database according to the test scene type.
Referring to fig. 7, in some embodiments, the apparatus 600 further includes:
a first determining unit 606 for determining whether the preset number of load machines is not less than N;
at this time, the processing unit 602 is specifically configured to:
and if the number of the preset load machines is not less than N, splitting the data to be processed according to the splitting scheme to obtain the N pieces of split data.
In some embodiments, the processing unit 602 is further specifically configured to:
and if the preset number of the load machines is less than N, sending out a reminding signal that the number of the load machines is insufficient.
In some embodiments, the data to be processed includes data to be split and data to be split-free, and the processing unit 602 is further specifically configured to:
splitting the data to be split according to the splitting scheme to obtain N pieces of split data;
the copy unit is specifically configured to: copying the split data and the non-split data to the designated paths of the load machine respectively;
at this time, the reading unit 605 is specifically configured to:
and calling the N load machines, and respectively reading the split data and the non-split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data and the non-split data.
In some embodiments, the apparatus 600 further comprises:
a second determining unit 607, configured to determine whether the data length of the data to be split is greater than the shortest data length corresponding to the splitting scheme;
at this time, the processing unit 602 is specifically configured to:
and if the length of the data to be split is larger than the shortest data length, splitting the data to be split according to the splitting scheme.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
In this embodiment of the present application, an obtaining unit 601 obtains a data splitting request, where the data splitting request includes to-be-processed data and a splitting scheme of the to-be-processed data; then, the processing unit 602 performs splitting processing on the data to be processed according to the splitting scheme to obtain N split data, where N is an integer greater than 1; the copying unit 603 copies the split data to the designated paths of the N load machines respectively; the adjusting unit 604 adjusts the data reference path in the script to be run to the specified path to obtain an adjusted script; finally, the reading unit 605 calls the N load machines, and reads the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data. The performance testing device in the scheme can split data, and can correctly acquire the split data and perform performance testing by modifying the script to be operated, so that the data diversification processing capacity can be improved.
Referring to fig. 8, embodiments of the present application provide a server 800, which may include one or more processors 801 of a processing core, one or more memories 802 of a computer-readable storage medium, a Radio Frequency (RF) circuit 803, a power source 804, an input unit 805, and a display unit 806. Those skilled in the art will appreciate that the server architecture shown in FIG. 8 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 801 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 802 and calling data stored in the memory 802, thereby performing overall monitoring of the server. Alternatively, processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801.
The memory 802 may be used to store software programs and modules, and the processor 801 executes various functional applications and data processing by operating the software programs and modules stored in the memory 802.
The RF circuit 803 may be used for receiving and transmitting signals during transmission and reception of information.
The server also includes a power source 804 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 801 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
The server may also include an input unit 805, the input unit 805 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The server may also include a display unit 806, and the display unit 806 may be used to display information input by or provided to the user and various graphical user interfaces of the server, which may be made up of graphics, text, icons, video, and any combination thereof. Specifically, in this embodiment, the processor 801 in the server loads the executable file corresponding to the process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802, thereby implementing various functions as follows:
acquiring a data splitting request, wherein the data splitting request comprises data to be processed and a splitting scheme of the data to be processed;
splitting the data to be processed according to the splitting scheme to obtain N pieces of split data, wherein N is an integer greater than 1;
copying the split data to appointed paths of N load machines respectively;
adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script;
and calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the performance testing method, and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any of the performance testing methods provided by the embodiments of the present application. For example, the instructions may perform the steps of:
acquiring a data splitting request, wherein the data splitting request comprises data to be processed and a splitting scheme of the data to be processed;
splitting the data to be processed according to the splitting scheme to obtain N pieces of split data, wherein N is an integer greater than 1;
copying the split data to appointed paths of N load machines respectively;
adjusting a data reference path in the script to be run to the specified path to obtain an adjusted script;
and calling the N load machines, and respectively reading the split data from the designated path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium can execute the steps in any performance testing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any performance testing method provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
A performance testing method, a performance testing device, a network device, and a computer-readable storage medium provided in the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principles and implementations of the present application, and the description of the embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1.一种性能测试方法,其特征在于,包括:1. a performance testing method, is characterized in that, comprises: 获取数据拆分请求,所述数据拆分请求包括待处理数据以及所述待处理数据的拆分方案;obtaining a data splitting request, where the data splitting request includes data to be processed and a splitting scheme of the data to be processed; 根据所述拆分方案对所述待处理数据进行拆分处理,得到N个拆分后数据,所述N为大于1的整数;Splitting the data to be processed according to the splitting scheme to obtain N pieces of split data, where N is an integer greater than 1; 将所述拆分后数据分别拷贝至N个负载机的指定路径下;Copy the split data to the designated paths of the N load machines respectively; 将待运行脚本中的数据引用路径调整为所述指定路径,得到调整后脚本;Adjust the data reference path in the script to be run to the specified path, and obtain the adjusted script; 调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据,使得N个所述负载机根据所述拆分后数据分别进行性能测试。The N load machines are called, and the split data is respectively read from the specified path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data. 2.根据权利要求1所述的方法,其特征在于,所述调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据,包括:2 . The method according to claim 1 , wherein the calling N load machines and respectively reading the split data from the specified path according to the adjusted script, comprising: 2 . 通过调度机调度所述调整后脚本至所述N个负载机;Scheduling the adjusted script to the N load machines through a scheduling machine; 调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据。The N load machines are called, and the split data is read from the specified path according to the adjusted script. 3.根据权利要求1所述的方法,其特征在于,所述将待运行脚本中的数据引用路径调整为所述指定路径,得到调整后脚本之前,所述方法还包括:3. The method according to claim 1, wherein, before the data reference path in the script to be run is adjusted to the specified path, and before the adjusted script is obtained, the method further comprises: 获取测试场景类型;Get the test scene type; 根据所述测试场景类型从预置的脚本数据库中确定所述待运行脚本。The to-be-run script is determined from a preset script database according to the test scenario type. 4.根据权利要求1所述的方法,其特征在于,所述获取数据拆分请求之后,所述方法还包括:4. The method according to claim 1, wherein after the obtaining the data splitting request, the method further comprises: 确定预置的负载机数量是否不小于N;Determine whether the preset number of load machines is not less than N; 所述根据所述拆分方案对所述待处理数据进行拆分处理,得到N个拆分后数据,包括:According to the splitting scheme, the data to be processed is split to obtain N pieces of split data, including: 若所述预置的负载机数量不小于N,则根据所述拆分方案对所述待处理数据进行拆分处理,得到所述N个拆分后数据。If the preset number of load machines is not less than N, the data to be processed is split according to the split scheme to obtain the N pieces of split data. 5.根据权利要求4所述的方法,其特征在于,所述确定预置的负载机数量是否不小于所述拆分方案中的数据拆分数量之后,所述方法还包括:5. The method according to claim 4, wherein after determining whether the preset number of load machines is not less than the number of data splits in the splitting scheme, the method further comprises: 若所述预置的负载机数量小于N,则发出负载机数量不足提醒信号。If the preset number of load machines is less than N, a warning signal of insufficient number of load machines is sent out. 6.根据权利要求1至5中任一项所述的方法,其特征在于,所述待处理数据包括待拆分数据以及免拆分数据,所述根据所述拆分方案对所述待处理数据进行拆分处理,得到N个拆分后数据,包括:6. The method according to any one of claims 1 to 5, wherein the data to be processed comprises data to be split and data free from splitting, and the data to be processed is described according to the split scheme. The data is split and processed to obtain N split data, including: 根据所述拆分方案对所述待拆分数据进行拆分处理,得到N个拆分后数据;Perform splitting processing on the data to be split according to the splitting scheme to obtain N split data; 所述将所述拆分后数据分别拷贝至N个负载机的指定路径下,包括:将所述拆分后数据以及所述免拆分数据,分别拷贝至N个所述负载机的指定路径下;The step of copying the split data to the designated paths of the N load machines respectively includes: copying the split data and the split-free data to the designated paths of the N load machines respectively. Down; 所述调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据,使得N个所述负载机根据所述拆分后数据分别进行性能测试,包括:The N load machines are called, and the split data is read from the specified path according to the adjusted script, so that the N load machines respectively perform performance tests according to the split data ,include: 调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据以及所述免拆分数据,使得N个所述负载机根据所述拆分后数据以及所述免拆分数据分别进行性能测试。Invoke the N load machines, and read the split data and the split-free data respectively from the specified path according to the adjusted script, so that the N load machines are based on the split data. The data and the split-free data are separately tested for performance. 7.根据权利要求6所述的方法,其特征在于,所述获取数据拆分请求之后,所述方法还包括:7. The method according to claim 6, wherein after the obtaining the data splitting request, the method further comprises: 确定所述待拆分数据的数据长度是否大于所述拆分方案所对应的最短数据长度;Determine whether the data length of the data to be split is greater than the shortest data length corresponding to the splitting scheme; 所述根据所述拆分方案对所述待处理数据进行拆分处理,包括:The splitting processing of the data to be processed according to the splitting scheme includes: 若大于所述最短数据长度,则根据所述拆分方案对所述待拆分数据进行拆分处理。If it is greater than the shortest data length, the data to be split is split according to the split scheme. 8.一种性能测试装置,其特征在于,包括:8. A performance testing device, comprising: 获取单元,用于获取数据拆分请求,所述数据拆分请求包括待处理数据以及所述待处理数据的拆分方案;an obtaining unit, configured to obtain a data splitting request, where the data splitting request includes data to be processed and a splitting scheme of the data to be processed; 处理单元,用于根据所述拆分方案对所述待处理数据进行拆分处理,得到N个拆分后数据,所述N为大于1的整数;a processing unit, configured to perform splitting processing on the data to be processed according to the splitting scheme to obtain N pieces of split data, where N is an integer greater than 1; 拷贝单元,用于将所述拆分后数据分别拷贝至N个负载机的指定路径下;a copying unit, configured to copy the split data to the designated paths of the N load machines; 调整单元,用于将待运行脚本中的数据引用路径调整为所述指定路径,得到调整后脚本;an adjustment unit, configured to adjust the data reference path in the script to be executed to the specified path to obtain the adjusted script; 读取单元,用于调用N个所述负载机,根据所述调整后脚本分别从所述指定路径下读取所述拆分后数据,使得N个所述负载机根据所述拆分后数据分别进行性能测试。a reading unit, configured to call the N load machines, and read the split data from the specified path according to the adjusted script, so that the N load machines can read the split data according to the split data Perform performance tests separately. 9.一种网络设备,其特征在于,包括处理器和存储器,所述存储器中存储有计算机程序,所述处理器调用所述存储器中的计算机程序时执行如权利要求1至7任一项所述的性能测试方法。9. A network device, characterized in that it comprises a processor and a memory, wherein a computer program is stored in the memory, and when the processor invokes the computer program in the memory, the execution as claimed in any one of claims 1 to 7 is executed. the performance test method described. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1至7任一项所述的性能测试方法。10. A computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, and the instructions are adapted to be loaded by a processor to execute the method according to any one of claims 1 to 7. Performance testing methods.
CN202010565158.9A 2020-06-19 2020-06-19 Performance testing method, apparatus, network device, and computer-readable storage medium Pending CN113821386A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010565158.9A CN113821386A (en) 2020-06-19 2020-06-19 Performance testing method, apparatus, network device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010565158.9A CN113821386A (en) 2020-06-19 2020-06-19 Performance testing method, apparatus, network device, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN113821386A true CN113821386A (en) 2021-12-21

Family

ID=78924523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010565158.9A Pending CN113821386A (en) 2020-06-19 2020-06-19 Performance testing method, apparatus, network device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN113821386A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789410A (en) * 2012-06-29 2012-11-21 浪潮电子信息产业股份有限公司 Method for testing performance of storage system
CN107608893A (en) * 2017-09-22 2018-01-19 北京蓝海讯通科技股份有限公司 A kind of pressure test dispatching method, device, dispatch server and computing device
CN108038013A (en) * 2017-11-30 2018-05-15 海尔优家智能科技(北京)有限公司 Distributed performance test method and device and computer-readable recording medium
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
WO2019140567A1 (en) * 2018-01-17 2019-07-25 新联智慧信息技术(深圳)有限公司 Big data analysis method and system
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A distributed database cluster testing method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789410A (en) * 2012-06-29 2012-11-21 浪潮电子信息产业股份有限公司 Method for testing performance of storage system
CN107608893A (en) * 2017-09-22 2018-01-19 北京蓝海讯通科技股份有限公司 A kind of pressure test dispatching method, device, dispatch server and computing device
CN108038013A (en) * 2017-11-30 2018-05-15 海尔优家智能科技(北京)有限公司 Distributed performance test method and device and computer-readable recording medium
WO2019140567A1 (en) * 2018-01-17 2019-07-25 新联智慧信息技术(深圳)有限公司 Big data analysis method and system
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A distributed database cluster testing method, device and storage medium

Similar Documents

Publication Publication Date Title
CN113722020B (en) Interface calling method, device and computer readable storage medium
JP6571277B2 (en) Method and apparatus for loading terminal application
CN112767135B (en) Configuration method and device of rule engine, storage medium and computer equipment
CN109324962B (en) Method and equipment for testing application program based on cloud Internet of things technology
KR101520056B1 (en) Cloud-based mobile/online game server load test automation service method
CN105630683B (en) A kind of cloud testing architecture
CN110532182B (en) Automatic testing method and device for virtualization platform
CN114327846B (en) Cluster expansion method, device, electronic device and computer-readable storage medium
CN113434384B (en) Pressure testing method and device
US9158657B2 (en) Architecture for remote access to content state
CN114489989A (en) Method and system for parallel scheduling based on proxy client
CN114201449A (en) Log monitoring method and device, computer equipment and storage medium
CN108132832B (en) Application program starting method and device
CN113821386A (en) Performance testing method, apparatus, network device, and computer-readable storage medium
CN107734050A (en) A kind of load machine distribution method, computing device and load machine distribution system
CN115454576B (en) A virtual machine process management method, system and electronic device
CN109462491B (en) System, method and apparatus for testing server functionality
JP2025534940A (en) Information processing method, apparatus, and electronic device
CN112764837B (en) Data reporting method, device, storage medium and terminal
CN114490374A (en) Applied stress testing methods, electronic equipment, storage media and program products
WO2024060874A1 (en) Device upgrading method, system, and apparatus, and computer-readable storage medium
CN114610446A (en) Method, device and system for automatically injecting probe
CN106210031A (en) Service execution method, device, client and server
CN114154644A (en) Machine learning data processing method and device
CN111124907A (en) A mobile game testing method, device and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20211221

RJ01 Rejection of invention patent application after publication