CN111752789A - Pressure testing method, computer device and computer readable storage medium - Google Patents

Pressure testing method, computer device and computer readable storage medium Download PDF

Info

Publication number
CN111752789A
CN111752789A CN201910249037.0A CN201910249037A CN111752789A CN 111752789 A CN111752789 A CN 111752789A CN 201910249037 A CN201910249037 A CN 201910249037A CN 111752789 A CN111752789 A CN 111752789A
Authority
CN
China
Prior art keywords
data
target
cutting
pressure test
file
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.)
Granted
Application number
CN201910249037.0A
Other languages
Chinese (zh)
Other versions
CN111752789B (en
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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN201910249037.0A priority Critical patent/CN111752789B/en
Publication of CN111752789A publication Critical patent/CN111752789A/en
Application granted granted Critical
Publication of CN111752789B publication Critical patent/CN111752789B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test

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)
  • Measuring Fluid Pressure (AREA)

Abstract

The present disclosure provides a pressure testing method, which includes: receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction; cutting data in a data file required by the pressure test according to the data cutting parameters; determining corresponding target data from the cut data; and executing the pressure test according to the target data. The present disclosure also provides a computer device and a computer-readable storage medium.

Description

Pressure testing method, computer device and computer readable storage medium
Technical Field
The present invention relates to the field of pressure testing technologies, and in particular, to a pressure testing method, a computer device, and a computer-readable storage medium.
Background
With the service design of the mainstream system, the interface has become a bridge for communication between systems, and therefore, the performance pressure measurement of the interface is becoming more and more important.
In the prior art, when a pressure test is performed, the pressure test is usually performed by using the same batch of test parameters at the same time, and this operation may cause an interface service error due to the repeated use of the test parameters and may have a certain influence on the pressure test result.
Disclosure of Invention
The purpose of the present disclosure is to provide a pressure testing method, a computer device, and a computer-readable storage medium, which are used to solve the defects in the prior art that the pressure testing is performed by using the same batch of testing parameters at the same time, which results in the error reporting of the interface service and affects the pressure testing result.
One aspect of the present disclosure provides a pressure testing method, including: receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction; cutting data in a data file required for executing the pressure test according to the data cutting parameters; determining corresponding target data from the cut data; and executing the pressure test according to the target data.
According to an embodiment of the present disclosure, the cutting data in the data file required for performing the stress test according to the data cutting parameter includes: determining the file size of the data file; and cutting the data in the data file according to the data cutting parameters and the file size.
According to an embodiment of the present disclosure, the data cutting parameter includes a number of data cutting copies, and the cutting the data in the data file according to the data cutting parameter and the file size includes: and cutting the data in the data file into data cutting copies according to the file size, wherein the cut data of different copies occupy different data blocks.
According to an embodiment of the present disclosure, the determining the corresponding target data from the cut data includes: determining a target data block from data blocks obtained after cutting data in the data file; and determining the data stored in the target data block as the target data.
According to an embodiment of the present disclosure, the determining a target data block from data blocks obtained by cutting data in the data file includes: acquiring a first target index contained in the pressure test instruction; determining a data block corresponding to the first target index from data blocks obtained by cutting data in the data file; and determining the data block corresponding to the first target index as the target data block.
According to an embodiment of the present disclosure, the determining a target data block from data blocks obtained by cutting data in the data file includes: receiving a pressurization instruction for increasing the pressure flow of the pressure test, and acquiring a second target index from the pressurization instruction; determining a data block corresponding to the second target index from the data blocks obtained by cutting the data in the data file; and determining the data block corresponding to the second target index as the target data block.
According to an embodiment of the present disclosure, the performing the stress test according to the target data includes: reading the first row data of the target data block corresponding to the second target index; judging whether the first line of data is data of a complete line; and if so, executing the pressure test according to the first row of data, and continuously reading other rows of data in the target data block.
According to an embodiment of the present disclosure, the pressure testing method further includes: if the first row data is judged not to be data of a complete row, reading the next row data of the first row data from the target data block; and executing the pressure test according to the next line of data, and continuously reading other lines of data in the target data block.
Yet another aspect of the present disclosure provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor when executing the computer program being adapted to implement the steps of the method as described in any of the above.
Yet another aspect of the disclosure provides a computer readable storage medium having stored thereon a computer program for implementing the steps of the method as any one of the above when executed by a processor.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, the data cutting parameters contained in the pressure test instruction are obtained, the data in the data file are cut by using the data cutting parameters, the target data needed by the pressure test are determined from the cut data, and then the pressure test is executed by using the determined target data. When the pressure test is executed, the data in the data file is cut, so that the data used in the batch of pressure test process can be ensured not to be repeated, the defects that interface service error is caused and the pressure test result is influenced because the same batch of test parameters are used for pressure test at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
Drawings
FIG. 1 schematically illustrates a flow chart of a pressure testing method according to an embodiment of the present disclosure;
FIG. 2 schematically shows a schematic diagram of reading target data according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a diagram of Meltoi pressure measurement platform configuration information, in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a Meltoi pressure measurement platform interface according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a preview of a pressure measurement scenario in accordance with an embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of inputting data cutting parameters through a Melloi pressure sensing platform, according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a schematic diagram of pressure test commissioning information according to an embodiment of the present disclosure;
FIG. 8 schematically illustrates a diagram of downloading a PDF format document according to an embodiment of the disclosure;
FIG. 9 schematically illustrates a schematic diagram of a pressure testing protocol according to an embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of a pressure testing system according to an embodiment of the present disclosure; and
fig. 11 schematically shows a hardware architecture diagram of a computer device suitable for implementing the stress testing method according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not intended to limit the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, the data cutting parameters contained in the pressure test instruction are obtained, the data in the data file are cut by using the data cutting parameters, the target data needed by the pressure test are determined from the cut data, and then the pressure test is executed by using the determined target data. When the pressure test is executed, the data in the data file is cut, so that the data used in the batch of pressure test process can be ensured not to be repeated, the defects that interface service error is caused and the pressure test result is influenced because the same batch of test parameters are used for pressure test at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
Fig. 1 schematically illustrates a flow chart of a pressure testing method according to an embodiment of the present disclosure.
As shown in fig. 1, the pressure testing method may include steps S101 to S104, in which:
step S101, receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction.
The pressure test instruction may be an instruction for instructing to perform a pressure test on a preset interface (the pressure test may be simply referred to as a pressure test). Before formally executing the pressure test, in order to avoid the defect that the pressure test by using the same batch of test parameters at the same time in the prior art causes an interface service error report and affects the pressure test result, the pressure test instruction in the embodiment of the present disclosure may carry a data cutting parameter, acquire the data cutting parameter, and then continue to execute step S102.
And S102, cutting the data in the data file required by the pressure test according to the data cutting parameters. The data in the data file may include interface parameters of a preset interface.
According to the data cutting parameters, cutting the data in the data file required for executing the pressure test may include: determining a file size of the data file; and cutting the data in the data file according to the data cutting parameters and the file size.
According to an embodiment of the present disclosure, the data cutting parameter may include the number of data cutting copies, and cutting the data in the data file according to the data cutting parameter and the file size may include: and cutting the data in the data file into data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
Alternatively, the data in the data file may be equally divided into data division parts according to the file size. For example, the file size is 9K, the number of data to be cut is 3, and each cut data can occupy 3K of space. The data in the data file may also be randomly divided into data division copies, which is not limited in the embodiments of the present disclosure.
Optionally, the data cutting parameter may further include a preset space size occupied by each cut data, so that, in addition to cutting the data in the data file into the data cutting parts, it is also required to ensure that the space size occupied by each cut data meets the preset space size. For example, the file size is 9K, the number of data to be cut is 3, the preset space sizes are 2K, 4K, and 3K in sequence, then the size of the space occupied by the first cut data is 2K, the size of the space occupied by the second cut data is 4K, and the size of the space occupied by the third cut data is 3K.
It should be noted that, the embodiment of the present disclosure does not cut the data file, but cuts the data in the data file. For example, each share of the cut data may be stored in one data block, with different shares of the cut data being stored in different data blocks. Optionally, each cut data may also be stored in several associated data blocks, which is not limited in this embodiment of the disclosure.
And step S103, determining corresponding target data from the cut data.
Determining corresponding target data from the cut data may include: determining a target data block from data blocks obtained after cutting data in the data file; and determining the data stored in the target data block as the target data.
In an embodiment of the present disclosure, when performing a pressure test on a preset interface for the first time, determining a target data block from data blocks obtained by cutting data in the data file may include: acquiring a first target index contained in the pressure test instruction; determining a data block corresponding to the first target index from the data blocks obtained after cutting the data in the data file; determining a data block corresponding to the first target index as the target data block.
Specifically, if the pressure test is performed on the preset interface for the first time, the pressure test includes a first target index, and the first target index may correspond to a data block where a preset number of pieces of cut data are located, for example, may correspond to a data block where a first piece of cut data are located.
According to the embodiment of the disclosure, in the process of performing the pressure test on the preset interface, when the pressure flow is found to be insufficient, the pressure flow for the preset interface may be increased. Determining a target data block from data blocks obtained by cutting data in the data file, which may include: receiving a pressurization instruction for increasing the pressure flow of the pressure test, and acquiring a second target index from the pressurization instruction; determining a data block corresponding to the second target index from the data blocks obtained after cutting the data in the data file; determining a data block corresponding to the second target index as the target data block.
Specifically, in the process of performing a pressure test on the preset interface, a user may trigger a multiple-pressurization instruction, and the embodiment of the present disclosure may also receive the multiple-pressurization instruction. For each pressurizing command, a second target index is carried, the second target index may also correspond to a data block where a preset number of pieces of cut data are located, and the data blocks corresponding to each target index (e.g., the first target index and the second target index) are different. For example, in connection with the above example, for the received first pressurization instruction, the second target index may correspond to the data block in which the second cut of data is located.
And step S104, executing the pressure test according to the target data.
In the embodiment of the disclosure, when the pressure test is performed by using the target data in the target data block, the target data may be read in lines, and each line of the target data is read, an HTTP request is generated by using the target data, and then the HTTP request is sent to an interface address corresponding to a preset interface, so as to test the performance of the preset interface.
According to an embodiment of the present disclosure, performing the stress test according to the target data may include: reading the first row data of the target data block corresponding to the second target index; judging whether the first line of data is data of a complete line; and if so, executing the pressure test according to the first row of data, and continuously reading other rows of data in the target data block. If the first row of data is judged not to be data of a complete row, reading the next row of data of the first row of data from the target data block; and executing the pressure test according to the next row of data, and continuously reading other rows of data in the target data block.
Since the target data block corresponding to the second target index is not the first data block, a situation that the first row data in the target data block is not a complete row may occur. In this case, in order to ensure the availability of data, it can be determined whether the first row of data is a complete row of data. And if the first row data is a complete row, executing the pressure test according to the read first row data, and further reading the next row data and continuously executing the pressure test based on the next row data. And if the first row data is not the complete row, reading the second row data from the target data block, and executing a pressure test based on the read second row data.
The present disclosure may implement the above-described embodiments using the seek () method. Specifically, as shown in fig. 2, fig. 2 schematically shows a schematic diagram of reading target data according to an embodiment of the present disclosure. In fig. 2, the first byte position of the first line data of the target data block corresponding to the second target index is pointer, the first line data is read and stored in a variable line, and it is determined whether the pointer is the same as the start position startlndex of the target data block and whether the pointer is not equal to 0. If not, the behavior is indicated to be a complete line, and the line is directly used. If yes, the first row data is not the complete row. At this time, the next line of data may be read continuously, the read next line of data may be stored to the previous variable line, the previous first line of data that is not the complete line may be overwritten, and the line value may be further returned to the interface for requesting use.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, the data cutting parameters contained in the pressure test instruction are obtained, the data in the data file are cut by using the data cutting parameters, the target data needed by the pressure test are determined from the cut data, and then the pressure test is executed by using the determined target data. When the pressure test is executed, the data in the data file is cut, so that the data used in the batch of pressure test process can be ensured not to be repeated, the defects that interface service error is caused and the pressure test result is influenced because the same batch of test parameters are used for pressure test at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
It should be noted that, as an alternative embodiment, the present disclosure may rely on the melloid pressure measurement platform sending pressure test instructions. The main pressure testing convenience, zero coding and visualization of the Melloi pressure testing platform are realized, a user enters the Melloi pressure testing platform at the Web end, one-key storage or debugging or pressure testing can be realized through simple interface configuration under friendly interaction prompt information, and no tool needs to be installed. The existing Jmeter pressure measurement tool only supports two modes of commands and clients, distributed pressure measurement support is poor and difficult to expand, a user needs to create scripts in complicated steps at the Jmeter client or manually write XML scripts, so that labor cost is high, and in addition, the Jmeter does not support the function of data file cutting. Although another nGrinder pressure measurement tool in the prior art supports Web end pressure measurement, a pressure measurement script needs to invest a great deal of energy to write, for example, some basic parameterization, cookie adding functions and the like need to be realized by a user through coding, and the usability is poor. And some pressure measurement tools such as wrk, Apache, Benchmark, k6 and the like only support a command line mode, have no self visual interface and do not support distributed pressure measurement.
As shown in fig. 3 and 4, the melloid pressure measurement platform of the present disclosure may provide convenient functional support as follows: 1. pressure measurement configuration default values and self-definition: the page is automatically configured with basic pressure measurement information, and pressure measurement can be carried out only by logging in an interface address and a service tree node (a path for storing a pressure measurement script). The melloid pressure measurement platform can automatically generate an interface name from the input interface address, as for www.baidu.com/fsddfv? hfgfg ═ { dfdsvhs }, the operator "/" and the operator "? "as the interface name, fsddfv. As shown in fig. 5, fig. 5 is a preview of the pressure measurement scene in fig. 4, where the concurrent user is 100, the pressure measurement duration is 180s, and the preheating time is 20s, and it can be seen that 100 concurrent users can be reached after the preheating time is 20 s. In addition, the Melloi pressure measurement platform also supports user-defined modification. 2. Login information: sufficient online account information is built in, and login of a Web end and an APP end can be effectively simulated. 3. Signature algorithm: various signature algorithms are built in, as shown in fig. 4, and other algorithms can be extended. 4. And (3) fusing rate configuration: configuration of response code fusing rate and service fusing rate is supported, and online environment safety is ensured to a certain extent. 5. Data cutting: the data cutting parameters are remotely transmitted, so that the requirement of the service on the data can be met. As shown in fig. 6, the data cut parameters (i.e., the number of cuts in the graph) may be entered in an input box. 6. Debugging functions: after the pressure measurement information is configured, the user can click to debug and check whether the network, the interface state, the pressure measurement script and the like are correct or not, so that the problem is quickly positioned, and sufficient preparation is made for formal pressure measurement. As shown in fig. 7, the debugging will first default to perform a small number of pressure tests on the interface, for example, 5 requests, and will print the 5 pieces of request information and the corresponding 5 pieces of response information, if there is an error, then print the corresponding error information. 7. And a get request mode, a post request mode and a service assertion are supported. 8. And (3) storing and operating a pressure measurement script: and the storage function of the pressure measurement script is supported, and the repeated utilization of the pressure measurement script is realized. 9. The pressure measurement report is exported to a PDF format document, so that the pressure measurement report can be conveniently checked and shared at any time, and a user can check and share the report under the condition of no network. In order to facilitate a user to view a complete pressure measurement report after downloading, the Meltoi pressure measurement platform can also realize the function of converting an html report of a webpage into PDF, and the user can download and store the report by one key. The function is mainly that a front-end html2canvas is applied to directly capture the whole page at a browser end of a user, the whole page is rendered into a picture JPEG format, and then the picture is converted into a PDF format document by adopting a JsPDF technology. As shown in fig. 8, the PDF push report download is complete by clicking the camera button.
Fig. 9 schematically illustrates a schematic diagram of a pressure testing protocol according to an embodiment of the present disclosure.
The scheme shown in fig. 9 takes as an example that a pressure test instruction is sent through the melloid pressure test platform and a pressure test is performed on a preset interface for the first time. First, the data file is uploaded to the shared storage through the meltoi pressure testing platform, and then the data cutting parameters (the number of cuts in fig. 9) and the first target index (the current index in fig. 9) in the pressure testing instruction are transferred to the Jmeter through the meltoi pressure testing platform. The file reading logic of the fileServer of the Jmeter is modified, the MyBuffedReader class is added, the file Enrey object is obtained as shown in FIG. 9, and a target data block (the data block of the current index in FIG. 9) corresponding to the first target index, such as the first data block, is determined by utilizing the MyBuffedReader () method. And then determining a starting byte and an ending byte of the target data block, reading each line of the target data block from the beginning by a myreader.
FIG. 10 schematically illustrates a block diagram of a pressure testing system according to an embodiment of the disclosure.
As shown in fig. 10, the pressure testing system 1000 may include a receiving module 1010, a cutting module 1020, a determining module 1030, and a processing module 1040, wherein:
the receiving module 1010 is configured to receive a pressure test instruction, and acquire a data cutting parameter from the pressure test instruction.
And a cutting module 1020, configured to cut data in the data file required for performing the pressure test according to the data cutting parameter.
A determining module 1030, configured to determine corresponding target data from the cut data.
And the pressure testing module 1040 is configured to execute the pressure test according to the target data.
According to the pressure test system, after a pressure test instruction for executing the pressure test is received, the data cutting parameters contained in the pressure test instruction are obtained, the data in the data file are cut by using the data cutting parameters, the target data needed by the pressure test are determined from the cut data, and then the pressure test is executed by using the determined target data. When the pressure test is executed, the data in the data file is cut, so that the data used in the batch of pressure test process can be ensured not to be repeated, the defects that interface service error is caused and the pressure test result is influenced because the same batch of test parameters are used for pressure test at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
As an alternative embodiment, the cutting module may include: a first determining unit configured to determine a file size of the data file; and the cutting unit is used for cutting the data in the data file according to the data cutting parameters and the file size.
As an optional embodiment, the data cutting parameter includes a number of data cuts, and the cutting unit is further configured to: and cutting the data in the data file into data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
As an alternative embodiment, the determining module may include: the second determining unit is used for determining a target data block from the data blocks obtained after the data in the data file are cut; a third determining unit configured to determine data stored in the target data block as the target data.
As an alternative embodiment, the second determining unit may include: the acquiring subunit is used for acquiring a first target index contained in the pressure test instruction; a first determining subunit, configured to determine, from the data blocks obtained after the data in the data file is cut, a data block corresponding to the first target index; a second determining subunit, configured to determine a data block corresponding to the first target index as the target data block.
As an alternative embodiment, the second determining unit may include: the receiving subunit is used for receiving a pressurization instruction for increasing the pressure flow of the pressure test and acquiring a second target index from the pressurization instruction; a third determining subunit, configured to determine, from the data blocks obtained after the data in the data file is cut, a data block corresponding to the second target index; a fourth determining subunit, configured to determine a data block corresponding to the second target index as the target data block.
As an alternative embodiment, the pressure measurement module may include: a reading unit, configured to read first row data of the target data block corresponding to the second target index; the judging unit is used for judging whether the first line data is data of a complete line; and the processing unit is used for executing the pressure test according to the first line data and continuously reading other lines of data in the target data block under the condition that the first line data is judged to be data of a complete line.
As an alternative embodiment, the pressure testing system may further include: a reading module, configured to read, from the target data block, data in a next row of the first row of data when it is determined that the first row of data is not data in a complete row; and the processing module is used for executing the pressure test according to the next row of data and continuously reading other rows of data in the target data block.
Fig. 11 schematically shows a hardware architecture diagram of a computer device suitable for implementing the stress testing method according to an embodiment of the present disclosure. In this embodiment, the computer device 1100 is a device capable of automatically performing numerical calculation and/or information processing in accordance with a command set in advance or stored. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server or a server cluster composed of a plurality of servers). As shown in fig. 11, computer device 1100 includes at least, but is not limited to: the memory 1110, processor 1120, and network interface 1130 may be communicatively coupled to each other via a system bus. Wherein:
the memory 1110 includes at least one type of computer-readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 1110 may be an internal storage module of the computer device 1100, such as a hard disk or a memory of the computer device 1100. In other embodiments, the memory 1110 may also be an external storage device of the computer device 1100, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the computer device 1100. Of course, memory 1110 may also include both internal and external memory modules of computer device 1100. In this embodiment, the memory 1110 is generally used for storing an operating system and various types of application software installed in the computer device 1100, such as program codes of the stress test method, and the like. In addition, the memory 1110 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 1120 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 1120 generally serves to control the overall operation of the computer device 1100, such as performing control and processing related to data interaction or communication with the computer device 1100. In this embodiment, the processor 1120 is configured to execute program codes stored in the memory 1110 or process data.
The network interface 1130, which may comprise a wireless network interface or a wired network interface, is typically used to establish communication links between the computer device 1100 and other computer devices. For example, the network interface 1130 is used to connect the computer apparatus 1100 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer apparatus 1100 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth (Bluetooth), or Wi-Fi.
It should be noted that FIG. 11 only shows a computer device having components 1110 and 1130, but it should be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the pressure testing method stored in the memory 1110 may be further divided into one or more program modules and executed by one or more processors (in this embodiment, the processor 1120) to implement the present invention.
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the pressure testing method in the embodiments.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device. Of course, the computer-readable storage medium may also include both internal and external storage devices of the computer device. In this embodiment, the computer-readable storage medium is generally used for storing an operating system and various types of application software installed in the computer device, for example, the program codes of the pressure testing method in the embodiment, and the like. Further, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method of pressure testing, the method comprising:
receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction;
cutting data in a data file required by the pressure test according to the data cutting parameters;
determining corresponding target data from the cut data;
and executing the pressure test according to the target data.
2. The method of claim 1, wherein the cutting data in the data file required for performing the stress test according to the data cutting parameters comprises:
determining a file size of the data file;
and cutting the data in the data file according to the data cutting parameters and the file size.
3. The method of claim 2, wherein the data cutting parameters include a number of data cuts, and wherein cutting the data in the data file according to the data cutting parameters and the file size comprises:
and cutting the data in the data file into data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
4. The method of claim 3, wherein determining the corresponding target data from the cut data comprises:
determining a target data block from data blocks obtained after cutting data in the data file;
and determining the data stored in the target data block as the target data.
5. The method of claim 4, wherein determining the target data block from the data blocks obtained by cutting the data in the data file comprises:
acquiring a first target index contained in the pressure test instruction;
determining a data block corresponding to the first target index from the data blocks obtained after cutting the data in the data file;
determining a data block corresponding to the first target index as the target data block.
6. The method of claim 4, wherein determining the target data block from the data blocks obtained by cutting the data in the data file comprises:
receiving a pressurization instruction for increasing the pressure flow of the pressure test, and acquiring a second target index from the pressurization instruction;
determining a data block corresponding to the second target index from the data blocks obtained after cutting the data in the data file;
determining a data block corresponding to the second target index as the target data block.
7. The method of claim 6, wherein said performing the stress test based on the target data comprises:
reading the first row data of the target data block corresponding to the second target index;
judging whether the first line of data is data of a complete line;
and if so, executing the pressure test according to the first row of data, and continuously reading other rows of data in the target data block.
8. The method of claim 7, further comprising:
if the first row of data is judged not to be data of a complete row, reading the next row of data of the first row of data from the target data block;
and executing the pressure test according to the next row of data, and continuously reading other rows of data in the target data block.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor is adapted to carry out the steps of the method according to any of claims 1 to 8 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method of any one of claims 1 to 8.
CN201910249037.0A 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium Active CN111752789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910249037.0A CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910249037.0A CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111752789A true CN111752789A (en) 2020-10-09
CN111752789B CN111752789B (en) 2024-04-16

Family

ID=72671348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910249037.0A Active CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111752789B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732557A (en) * 2020-12-30 2021-04-30 成都科来网络技术有限公司 Interface test script implementation method for data offset downloading and automatic test method
CN114510430A (en) * 2022-04-19 2022-05-17 北京焦点新干线信息技术有限公司 Distribution method and device of pressure measurement plan, server and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021055A (en) * 2016-05-25 2016-10-12 乐视控股(北京)有限公司 Performance testing method and device for mixed interface
CN107294878A (en) * 2016-04-13 2017-10-24 中国移动通信有限公司研究院 Data transmission method, system and relevant device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294878A (en) * 2016-04-13 2017-10-24 中国移动通信有限公司研究院 Data transmission method, system and relevant device
CN106021055A (en) * 2016-05-25 2016-10-12 乐视控股(北京)有限公司 Performance testing method and device for mixed interface

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
WD5S: "HDFS在把大文件分割成多个数据块时,有可能会把一条完整的记录划分到不同的数据块中", Retrieved from the Internet <URL:https://www.cnblogs.com/kaixu/p/6164976.html> *
XTYLY: "JMeter 使用 CSV 参数文件_JMeter_操作指南_性能测试 PTS", pages 169 - 170, Retrieved from the Internet <URL:http://www.dawuzhe.cn/90575.html> *
XTYLY: "JMeter 原生压测快速入门_快速入门_性能测试 PTS", Retrieved from the Internet <URL:http://www.dawuzhe.cn/90625.html> *
企鹅号 - 58招聘技术团队: "站点压测利器-nGrinder", Retrieved from the Internet <URL:https://cloud.tencent.com/developer/news/52627> *
吴骏龙: "饿了么全链路压测平台的实现与原理", Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/30511486?from_voters_page=true> *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732557A (en) * 2020-12-30 2021-04-30 成都科来网络技术有限公司 Interface test script implementation method for data offset downloading and automatic test method
CN112732557B (en) * 2020-12-30 2023-09-08 科来网络技术股份有限公司 Interface test script implementation method and automatic test method for data offset downloading
CN114510430A (en) * 2022-04-19 2022-05-17 北京焦点新干线信息技术有限公司 Distribution method and device of pressure measurement plan, server and computer storage medium
CN114510430B (en) * 2022-04-19 2022-07-12 北京焦点新干线信息技术有限公司 Distribution method and device of pressure measurement plan, server and computer storage medium

Also Published As

Publication number Publication date
CN111752789B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN108829593B (en) Code coverage rate calculation and analysis method, device, equipment and storage medium
US9569325B2 (en) Method and system for automated test and result comparison
US10698797B2 (en) Mobile application program testing method, server, terminal, and storage medium
CN104468843A (en) File uploading method and device
CN110647471B (en) Interface test case generation method, electronic device and storage medium
CN111694749A (en) Automatic interface testing method and device, computer equipment and readable storage medium
CN111752789B (en) Pressure testing method, computer device and computer readable storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN112039900A (en) Network security risk detection method, system, computer device and storage medium
CN107797721B (en) Interface information display method and device
CN103152327A (en) Configuration method, client and system for plug-in unit compressing and uncompressing
US10423472B2 (en) System and method for providing extended javascript object notation (JSON) remote procedure call (RPC) with mediator
CN112714365B (en) Video playing method and system
US20190149571A1 (en) Method and device for repairing page vulnerability
CN112395187A (en) Test method, test system, computer device and storage medium
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN112650674A (en) Method for remotely acquiring and debugging webpage log, computer equipment and storage medium
CN112416648A (en) Data verification method and device
CN111338644A (en) Task script deployment method and system
CN114915565A (en) Method and system for debugging network
CN111026667B (en) Script execution method and device and electronic equipment
CN114416420A (en) Equipment problem feedback method and system
CN113569551A (en) APP page configuration method, device, system and storage medium
CN112417324A (en) Chrome-based URL (Uniform resource locator) interception method and device and computer equipment
CN113722225A (en) Page testing method and device, computer equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant