CN114116448A - Pressure testing method and device of application program, storage medium and computer equipment - Google Patents

Pressure testing method and device of application program, storage medium and computer equipment Download PDF

Info

Publication number
CN114116448A
CN114116448A CN202111233140.XA CN202111233140A CN114116448A CN 114116448 A CN114116448 A CN 114116448A CN 202111233140 A CN202111233140 A CN 202111233140A CN 114116448 A CN114116448 A CN 114116448A
Authority
CN
China
Prior art keywords
pressure measurement
script
application program
server
pressure
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
CN202111233140.XA
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.)
Chengdu Luyi Technology Co ltd
Original Assignee
Chengdu Luyi 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 Chengdu Luyi Technology Co ltd filed Critical Chengdu Luyi Technology Co ltd
Priority to CN202111233140.XA priority Critical patent/CN114116448A/en
Publication of CN114116448A publication Critical patent/CN114116448A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

The invention discloses a pressure testing method and device of an application program, a storage medium and computer equipment, relates to the technical field of information, and mainly aims to improve the efficiency and accuracy of the pressure testing of the application program. The method comprises the following steps: sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and the number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs; judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users. The invention is suitable for carrying out pressure test on the application program.

Description

Pressure testing method and device of application program, storage medium and computer equipment
Technical Field
The present invention relates to the field of information technologies, and in particular, to a method and an apparatus for testing a stress of an application program, a storage medium, and a computer device.
Background
The pressure test is a test which needs to be performed before each application program is on line, the load capacity of the system in the current application environment is judged through the pressure test, and the performance bottleneck of the system is found, so that the probability of problems after the application programs are released to the production environment is reduced, and meanwhile, the problems generated during the operation of the application programs can be avoided by taking some measures through estimating the load capacity of the system.
At present, a pressure measurement script is usually copied from a local computer to another computer for pressure measurement, however, this pressure measurement method needs to copy the pressure measurement script on the local computer to another computer, if the memory occupancy of the pressure measurement script is large, the copying time is long, the efficiency of the pressure test is affected, and meanwhile, the copied pressure measurement script has errors due to the misoperation of a worker or the quality defect of a copying tool, so that the accuracy of the pressure measurement is low.
Disclosure of Invention
The invention provides a pressure test method and device of an application program, a storage medium and computer equipment, and mainly aims to improve the efficiency and accuracy of the pressure test of the application program.
According to a first aspect of the present invention, there is provided a method for stress testing of an application program, comprising:
sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program;
acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
According to a second aspect of the present invention, there is provided an apparatus for stress testing of an application, comprising:
the system comprises a sending unit, a receiving unit and a processing unit, wherein the sending unit is used for sending an acquisition request of a pressure measurement script of an application program to a server, and the acquisition request carries identification information of the application program;
an obtaining unit, configured to obtain a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, where the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
the judging unit is used for judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and the execution unit is used for executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program;
acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:
sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program;
acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
According to the method, the device, the storage medium and the computer equipment for testing the pressure of the application program, compared with the current mode that the pressure test script is copied from a local computer to another computer for pressure test, the method sends an acquisition request of the pressure test script of the application program to a server side, wherein the acquisition request carries identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; meanwhile, judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; finally, if contain in the pressure survey parameter that the pressure survey script corresponds the pressure survey time, then based on the pressure survey time with the number of concurrent users, carry out the pressure survey script that the application corresponds sends the acquisition request that presses the survey script to the server through the identification information of application from this, and based on the acquisition request, acquire the server the pressure survey script that identification information corresponds can avoid copying the pressure survey script to improved the overall efficiency that carries out pressure test to the application, can avoid simultaneously because staff's maloperation or the quality defect of copy tool, the pressure survey script that leads to copying has wrong problem, and then improved the degree of accuracy that carries out pressure test to the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method for testing stress of an application according to an embodiment of the present invention;
FIG. 2 is a flow chart of a pressure testing method for another application provided by the embodiment of the invention;
FIG. 3 is a schematic structural diagram of a pressure testing apparatus for an application according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a pressure testing apparatus for another application provided in an embodiment of the present invention;
fig. 5 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
At present, the mode of copying the pressure measurement script from a local computer to another computer for pressure measurement can lead to longer copying time and influence the efficiency of pressure measurement if the memory occupation of the pressure measurement script is large, and simultaneously, the copied pressure measurement script has errors due to the misoperation of workers or the quality defect of a copying tool, so that the accuracy of pressure measurement is low.
In order to solve the above problem, an embodiment of the present invention provides a method for testing stress of an application program, as shown in fig. 1, the method includes:
101. sending an acquisition request of a pressure test script of an application program to a server, wherein the acquisition request carries identification information of the application program.
The application program is a program which needs to be subjected to pressure testing by a developer, the identification information is information for acquiring a pressure testing script from a server, the identification information can be codes, icons and the like, and different application programs correspond to different identification information.
For the embodiment of the invention, in order to overcome the defects of low efficiency and low accuracy of the pressure test in the prior art, the embodiment of the invention sends the acquisition request of the pressure test script to the server through the identification information of the application program, and acquires the pressure test script corresponding to the identification information of the server based on the acquisition request, so that the pressure test script can be prevented from being copied, the overall efficiency of the pressure test on the application program is improved, meanwhile, the problem that the copied pressure test script has errors due to the misoperation of a worker or the quality defect of a copying tool can be avoided, and the accuracy of the pressure test on the application program is improved. The embodiment of the invention is mainly applied to a scene of pressure measurement of the application program, and the execution main body of the embodiment of the invention is a device or equipment capable of pressure measurement of the application program, and can be specifically arranged on one side of a client or a server.
Specifically, first, a pressure measurement tool is downloaded to a local computer in a company official website, and then the pressure measurement tool can be run by double-clicking the pressure measurement tool on the local computer without installation, pressure measurement scripts corresponding to different application programs in the embodiment of the present invention are all stored in a server, when a user wants to perform a pressure test on an application program on the local computer, the pressure measurement script of the server needs to be obtained, specifically, the process of obtaining the pressure measurement script is to double-click the pressure measurement tool running on the local computer, a position for inputting identification information is present in an operation interface of the pressure measurement tool, at this time, the user inputs the identification information corresponding to the application program to the position, and clicks an "obtain pressure measurement script" option in the operation interface, that is, an obtaining request of the pressure measurement script of the application program is sent to the server, for example, the identification information corresponding to the application program may be a 32-bit string code, inputting the 32-bit string code to a corresponding position of an operation interface of a pressure measurement tool, clicking a pressure measurement script acquisition option, sending a pressure measurement script acquisition request to a server, sending the pressure measurement script corresponding to the identification information to a local computer by the server after sending the request, and clicking a pressure measurement starting option on the operation interface of the pressure measurement tool in the local computer, namely executing the pressure measurement script corresponding to the application program, so that the script copying is avoided, the pressure measurement efficiency is improved, meanwhile, the situation that the copied pressure measurement script has errors due to the misoperation of a worker or the quality defect of the copying tool can be avoided, and the accuracy of pressure measurement is improved.
102. And acquiring a pressure measurement script corresponding to the identification information fed back by the server and the number of concurrent users corresponding to the pressure measurement script, wherein the server stores the pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs.
The number of concurrent users is the number of virtual users simultaneously accessing the application program when the application program is subjected to pressure test.
For the embodiment of the invention, after sending an acquisition request of a pressure measurement script of an application program to a server, the server receives the acquisition request, finds the pressure measurement script corresponding to the identification information based on the identification information carried by the acquisition request, then feeds back the pressure measurement script generated by configuration request parameters and pressure measurement parameters to a local computer, and simultaneously feeds back the number of concurrent users corresponding to the pressure measurement script to the local computer, wherein the server stores the pressure measurement scripts corresponding to different application programs, and the server also stores the identification information corresponding to different application programs.
103. And judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time.
And the pressure measurement time is the time for executing the pressure measurement script corresponding to the application program, which is set by the user at the server.
Specifically, obtain the server side feedback the identification information corresponds presses survey script after, need judge whether contain in the pressure survey parameter that presses survey script corresponds press survey time, need judge promptly whether the user sets up the execution in the pressure survey script of server side press the time of surveying the script, if the user has set up at the server side press survey time, then based on press survey time with the number of concurrent users, carry out the pressure survey script that the application corresponds to the selection carries out pressure test to application when everybody is on duty, avoids influencing other personnel's work because pressure test.
104. And if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
For the embodiment of the present invention, in order to execute the pressure measurement script corresponding to the application program, it is necessary to determine whether the pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time, if the pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time, when the pressure measurement time is reached, the local pressure measurement tool automatically executes the pressure measurement script corresponding to the application program, and there is no need for a user to click a "start pressure measurement" button in an operation interface of the pressure measurement tool, for example, when the pressure measurement time corresponding to the pressure measurement script set by the user at the service end is 6:00 pm, after the pressure measurement script of the service end is obtained, and when the time reaches 6:00 pm, the local pressure measurement tool automatically executes the pressure measurement script corresponding to the application program, so as to reduce the operation steps of pressure measurement, save the time of the user, and at the same time, avoid the quality defect due to the erroneous operation of a worker or the copying of the tool, the copied pressure measurement script has an error problem, and the accuracy of pressure measurement on the application program is further improved.
According to the pressure testing method of the application program, compared with the mode that the pressure testing script is copied from a local computer to another computer for pressure testing at present, the method sends the acquisition request of the pressure testing script of the application program to a server side, wherein the acquisition request carries the identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; meanwhile, judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; finally, if contain in the pressure survey parameter that the pressure survey script corresponds the pressure survey time, then based on the pressure survey time with the number of concurrent users, carry out the pressure survey script that the application corresponds sends the acquisition request that presses the survey script to the server through the identification information of application from this, and based on the acquisition request, acquire the server the pressure survey script that identification information corresponds can avoid copying the pressure survey script to improved the overall efficiency that carries out pressure test to the application, can avoid simultaneously because staff's maloperation or the quality defect of copy tool, the pressure survey script that leads to copying has wrong problem, and then improved the degree of accuracy that carries out pressure test to the application.
Further, in order to better describe the above process of performing pressure test on the application, as a refinement and an extension of the above embodiment, an embodiment of the present invention provides another method for performing pressure test on an application, as shown in fig. 2, where the method includes:
201. sending an acquisition request of a pressure test script of an application program to a server, wherein the acquisition request carries identification information of the application program.
For the embodiment of the present invention, when a local computer wants to perform a stress test on an application program, in order to avoid copying a pressure test script, a pressure test script needs to be established at a server, and based on this, the method includes: determining configuration request parameters corresponding to different application programs according to protocol types, domain name information, port information, request links, request modes and request parameters corresponding to the different application programs configured by a user at the server; determining pressure measurement parameters corresponding to different application programs according to the number of concurrent users and the pressure measurement time corresponding to the different application programs configured by the user at the server; generating pressure measurement scripts corresponding to different application programs at the server based on the configuration request parameters and the pressure measurement parameters; and correspondingly storing the identification information corresponding to the different application programs and the pressure measurement script into the server.
Specifically, before sending an acquisition request of a pressure test script of an application program to the server, the server needs to generate the pressure test script, where the specific generation method of the pressure test script is to fill a protocol type corresponding to different application programs in a server operation interface, where the protocol type may be HTTP or HTTPs, fill domain name information or IP address, fill port information, fill a request link url, and fill a request manner, where the request manner may be GET or POST, and fill a request parameter, and determine a configuration request parameter corresponding to different application programs based on the above parameters, and at the same time, fill a concurrent user number and pressure test time in the server operation interface, where it is required to say that a user may fill pressure test time or may not fill pressure test time, and determine a pressure test parameter corresponding to an unused application program based on the concurrent user number and the pressure test time, finally, based on the configuration request parameters and the pressure measurement parameters, pressure measurement scripts corresponding to different application programs are generated at the server, meanwhile, when the pressure measurement scripts corresponding to different application programs are generated, identification information corresponding to different application programs is also generated together, the identification information, the pressure measurement scripts corresponding to the identification information and the number of concurrent users corresponding to the pressure measurement scripts are stored to the server together, in order to prevent technical information from being leaked, at the moment, a user can also select to encrypt the pressure measurement scripts, and store the encrypted pressure measurement scripts and the encryption keys corresponding to the encrypted pressure measurement scripts to the server.
Further, after the server establishes the pressure measurement script and the identification information corresponding to the pressure measurement script, if the local computer needs to perform a pressure test on the application program, an obtaining request for obtaining the pressure measurement script needs to be sent to the server, based on which step 201 specifically includes: and responding to an acquisition instruction of the pressure measurement script of the application program triggered by a user, generating an acquisition request of the pressure measurement script of the application program based on the identification information corresponding to the application program, and sending the acquisition request to the server.
For the embodiment of the invention, firstly, the identification information of the pressure measurement script corresponding to the application program of the server needs to be acquired, the identification information corresponding to the pressure measurement script is input into a pressure measurement tool of a local computer, then an acquisition instruction is clicked, at this time, an acquisition request of the pressure measurement script of the application program is generated based on the identification information corresponding to the application program and is sent to the server, after the server receives the acquisition instruction, the pressure measurement script corresponding to the identification information is fed back to the local computer based on the identification information carried by the acquisition request, and the local computer executes the pressure measurement script corresponding to the application program based on the acquired pressure measurement script.
202. And acquiring a pressure measurement script corresponding to the identification information fed back by the server and the number of concurrent users corresponding to the pressure measurement script, wherein the server stores the pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs.
Specifically, after sending an acquisition request of a pressure measurement script of an application program to a server, based on identification information carried by the acquisition request, the server feeds back a pressure measurement script corresponding to the identification information and a number of concurrent users corresponding to the pressure measurement script to a local computer, and the local computer acquires the number of concurrent users corresponding to the pressure measurement script and the pressure measurement script, and at this time, in order to smoothly execute the pressure measurement script, it needs to be determined whether the pressure measurement script is encrypted, and if the pressure measurement script is an encrypted script, it needs to be decrypted, and specifically, the method for specifically acquiring the decrypted pressure measurement script includes: judging whether the pressure measurement script fed back by the server is an encrypted script or not; if the pressure measurement script is an encryption script, sending an encryption key acquisition request of the pressure measurement script to the server; and acquiring an encrypted secret key corresponding to the pressure measurement script fed back by the server, and decrypting the pressure measurement script based on the encrypted secret key to obtain the decrypted pressure measurement script.
For the embodiment of the present invention, if the user encrypts the pressure measurement script at the server, the local computer needs to send a request for obtaining an encryption key corresponding to the encryption script to the server after obtaining the encryption script, the server feeds back the encryption key to the local computer based on the obtained request, the local computer decrypts the encryption script based on the obtained encryption key, and if the decrypted pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time, the pressure measurement script corresponding to the application program is finally executed based on the pressure measurement time and the number of concurrent users.
203. And judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time.
Specifically, in order to realize the automatic execution in local computer the pressure script that the application corresponds, need judge whether contain the pressure time in the pressure parameter that the pressure script originally corresponds, if contain the pressure time, then when the pressure time reachs, need not the user and clicks the initial pressure option, just can the automatic execution the pressure script that the application corresponds, simultaneously, if contain in the pressure parameter that the pressure script originally corresponds press the pressure time, even if the user is in click the initial pressure option before the pressure time reachs, local computer still can arrive when pressing the pressure time, carry out the pressure script that the application corresponds.
Further, after determining whether the pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time, the method further includes: and if the pressure measurement parameters corresponding to the pressure measurement script do not contain the pressure measurement time, responding to a pressure measurement instruction of an application program triggered by a user, and executing the pressure measurement script corresponding to the application program based on the number of the concurrent users.
For the embodiment of the invention, a user can set the pressure measurement time in the pressure measurement parameters of the pressure measurement script of the server according to requirements, that is, the user also can not set the pressure measurement time, if the user does not set the pressure measurement time, when the local computer needs to perform pressure test on the application program, after the pressure measurement script of the server is obtained, the user needs to click the initial pressure measurement option on the operation interface of the pressure measurement tool, and at this time, based on the number of concurrent users, the pressure measurement script corresponding to the application program is executed.
204. And if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, constructing a corresponding access thread based on the number of the concurrent users before the pressure measurement time is reached.
Wherein the access thread is a virtual user of the access application built in the local computer.
For the embodiment of the invention, because the number of concurrent users is set in advance in the pressure measurement parameters corresponding to different pressure measurement scripts of the server, when the pressure measurement script corresponding to the identification information fed back by the server is obtained, the number of concurrent users corresponding to the pressure measurement script is also obtained at the same time, before the pressure measurement time is reached, the local pressure measurement tool constructs a corresponding number of access threads in advance according to the number of concurrent users, and after the access threads are constructed and the pressure measurement time is reached, the access threads are started, the application program is accessed, and the pressure measurement script corresponding to the application program is executed.
205. And when the pressure measurement time is up, starting the access thread, accessing the application program, and executing a pressure measurement script corresponding to the application program.
For the embodiment of the invention, after the access thread is constructed, when the pressure measurement time is reached, the access thread is started, and the access thread simultaneously accesses the application program to execute the pressure measurement script corresponding to the application program, so that the application program can be simultaneously accessed by a plurality of access threads at a certain moment, the delay of executing the pressure measurement script time caused by the fact that the access thread is started to be established when the pressure measurement time is reached is avoided, and the pressure measurement efficiency is further improved.
Further, when the pressure test script corresponding to the application program is executed, the method further includes: acquiring the running time of a pressure measurement script corresponding to the application program; judging whether the running time length exceeds a preset pressure measurement time length corresponding to the pressure measurement script or not; if the running time length exceeds the preset pressure measurement time length, outputting alarm information corresponding to the application program, and determining pressure measurement problem information corresponding to the application program based on a current execution instruction in the pressure measurement script; if the running time does not exceed the preset pressure measurement time, outputting a pressure measurement report for performing pressure test on the application program; and performing quality evaluation on the application program based on the pressure measurement result recorded in the pressure measurement report, and performing structure optimization on the application program according to the evaluation result.
Specifically, in order to perform quality evaluation on the application program, when a pressure measurement script corresponding to the application program is executed, the running time length of the pressure measurement script needs to be acquired, whether the running time length exceeds the preset pressure measurement time length or not is judged, if the running time length exceeds the preset pressure measurement time length, it is indicated that the application program has a problem, at this time, alarm information corresponding to the application program is output to prompt a user that the application program has a problem, the user determines pressure measurement problem information corresponding to the application program according to a current execution instruction in the pressure measurement script, and if the running time length does not exceed the preset pressure measurement time length, a pressure test report corresponding to the application program is output, and information such as request response time, the maximum access thread number, the system CPU utilization rate under the access thread and the like is recorded in the pressure test report, and according to the information recorded in the pressure test report, performing quality evaluation on the application program, and performing structure optimization on the application program according to an evaluation result so as to provide a high-quality application program for a user.
According to another pressure testing method of the application program, compared with the current mode that the pressure testing script is copied from a local computer to another computer for pressure testing, the method sends an acquisition request of the pressure testing script of the application program to a server, wherein the acquisition request carries the identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; meanwhile, judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; finally, if contain in the pressure survey parameter that the pressure survey script corresponds the pressure survey time, then based on the pressure survey time with the number of concurrent users, carry out the pressure survey script that the application corresponds sends the acquisition request that presses the survey script to the server through the identification information of application from this, and based on the acquisition request, acquire the server the pressure survey script that identification information corresponds can avoid copying the pressure survey script to improved the overall efficiency that carries out pressure test to the application, can avoid simultaneously because staff's maloperation or the quality defect of copy tool, the pressure survey script that leads to copying has wrong problem, and then improved the degree of accuracy that carries out pressure test to the application.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides a device for testing stress of an application program, as shown in fig. 3, the device includes: a sending unit 31, an obtaining unit 32, a judging unit 33 and an executing unit 34.
The sending unit 31 may be configured to send an obtaining request of a pressure measurement script of an application program to a server, where the obtaining request carries identification information of the application program.
The obtaining unit 32 may be configured to obtain a pressure measurement script corresponding to the identification information fed back by the server, and a number of concurrent users corresponding to the pressure measurement script, where the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs.
The determining unit 33 may be configured to determine whether the pressure measurement parameter corresponding to the pressure measurement script includes pressure measurement time.
The execution unit 34 may be configured to execute the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of concurrent users if the pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time.
In a specific application scenario, in order to execute the pressure test script corresponding to the application program, as shown in fig. 4, the execution unit 34 includes a building module 341 and an executing module 342.
The constructing module 341 may be configured to construct a corresponding access thread based on the number of concurrent users before the pressure measurement time arrives.
The execution module 342 may be configured to start the access thread, access the application program, and execute the pressure measurement script corresponding to the application program when the pressure measurement time is reached.
In a specific application scenario, in the process of executing the pressure test script corresponding to the application program, the execution module 342 includes an acquisition sub-module, a judgment sub-module, an output sub-module, and an evaluation sub-module.
The obtaining submodule may be configured to obtain a running time of a pressure measurement script corresponding to the application program.
The judgment submodule may be configured to judge whether the operation duration exceeds the preset pressure measurement duration.
The output submodule can be used for outputting alarm information corresponding to the application program if the running time length exceeds the preset pressure measurement time length, and determining pressure measurement problem information corresponding to the application program based on a current execution instruction in the pressure measurement script.
The output sub-module may be further configured to output a pressure measurement report for performing a pressure test on the application program if the operation duration does not exceed the preset pressure measurement duration.
The evaluation submodule may be configured to perform quality evaluation on the application program based on the pressure measurement result recorded in the pressure measurement report, and perform structural optimization on the application program according to the evaluation result.
In a specific application scenario, if the pressure measurement parameter corresponding to the pressure measurement script does not include the pressure measurement time, the execution unit 34 may be further configured to respond to a pressure measurement instruction of the application program triggered by the user and execute the pressure measurement script corresponding to the application program based on the number of concurrent users in order to execute the pressure measurement script corresponding to the application program if the pressure measurement parameter corresponding to the pressure measurement script does not include the pressure measurement time.
In a specific application scenario, if the pressure measurement script of the server is an encrypted script, in order to obtain a decrypted pressure measurement script, the apparatus further includes: a decryption unit 35.
The determining unit 33 may be further configured to determine whether the pressure measurement script fed back by the server is an encrypted script.
The sending unit 31 may be further configured to send an encryption key obtaining request of the pressure measurement script to the server if the pressure measurement script is an encryption script.
The decryption unit 35 may be configured to obtain an encrypted key corresponding to the pressure measurement script fed back by the server, and decrypt the pressure measurement script based on the encrypted key to obtain a decrypted pressure measurement script.
In a specific application scenario, in order to generate pressure measurement scripts corresponding to different application programs at a server, the obtaining unit 32 includes a determining module 321, a generating module 322, and a storing module 323.
The determining module 321 may be configured to determine the configuration request parameters corresponding to the different application programs according to the protocol types, domain name information, port information, request links, request manners, and request parameters corresponding to the different application programs configured by the user at the server.
The determining module 321 may be further configured to determine the pressure measurement parameters corresponding to the different application programs according to the number of concurrent users and the pressure measurement time corresponding to the different application programs configured by the user at the server.
The generating module 322 may be configured to generate, at the server, pressure measurement scripts corresponding to different application programs based on the configuration request parameter and the pressure measurement parameter.
The storage module 323 may be configured to correspondingly store the identification information corresponding to the different application programs and the pressure measurement script in the server.
In a specific application scenario, in order to send an obtaining request of a pressure measurement script of an application program to a server, the sending unit 31 may be specifically configured to respond to a user-triggered obtaining instruction of the pressure measurement script of the application program, generate the obtaining request of the pressure measurement script of the application program based on identification information corresponding to the application program, and send the obtaining request to the server.
It should be noted that, for other corresponding descriptions of the functional modules related to the pressure testing apparatus for an application provided in the embodiment of the present invention, reference may be made to the corresponding description of the method shown in fig. 1, which is not described herein again.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps: sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
Based on the above embodiments of the method shown in fig. 1 and the apparatus shown in fig. 3, an embodiment of the present invention further provides an entity structure diagram of a computer device, as shown in fig. 5, where the computer device includes: a processor 41, a memory 42, and a computer program stored on the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43 such that when the processor 41 executes the program, the following steps are performed: sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
According to the technical scheme, the acquisition request of the pressure test script of the application program is sent to the server side, and the acquisition request carries the identification information of the application program; acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs; meanwhile, judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not; finally, if contain in the pressure survey parameter that the pressure survey script corresponds the pressure survey time, then based on the pressure survey time with the number of concurrent users, carry out the pressure survey script that the application corresponds sends the acquisition request that presses the survey script to the server through the identification information of application from this, and based on the acquisition request, acquire the server the pressure survey script that identification information corresponds can avoid copying the pressure survey script to improved the overall efficiency that carries out pressure test to the application, can avoid simultaneously because staff's maloperation or the quality defect of copy tool, the pressure survey script that leads to copying has wrong problem, and then improved the degree of accuracy that carries out pressure test to the application.
It will be apparent to those skilled in the art that the modules or steps of the present 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, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for stress testing of an application, comprising:
sending an acquisition request of a pressure measurement script of an application program to a server, wherein the acquisition request carries identification information of the application program;
acquiring a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, wherein the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time, executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users.
2. The method according to claim 1, wherein the executing a pressure test script corresponding to the application program based on the pressure test time and the number of concurrent users comprises:
before the pressure measurement time is reached, constructing a corresponding access thread based on the number of the concurrent users;
and when the pressure measurement time is up, starting the access thread, accessing the application program, and executing a pressure measurement script corresponding to the application program.
3. The method of claim 2, further comprising:
acquiring the running time of a pressure measurement script corresponding to the application program;
judging whether the running time length exceeds a preset pressure measurement time length corresponding to the pressure measurement script or not;
if the running time length exceeds the preset pressure measurement time length, outputting alarm information corresponding to the application program, and determining pressure measurement problem information corresponding to the application program based on a current execution instruction in the pressure measurement script;
if the running time does not exceed the preset pressure measurement time, outputting a pressure measurement report for performing pressure test on the application program;
and performing quality evaluation on the application program based on the pressure measurement result recorded in the pressure measurement report, and performing structure optimization on the application program according to the evaluation result.
4. The method according to claim 1, wherein after the determining whether the pressure measurement parameter corresponding to the pressure measurement script includes the pressure measurement time, the method further comprises:
and if the pressure measurement parameters corresponding to the pressure measurement script do not contain the pressure measurement time, responding to a pressure measurement instruction of an application program triggered by a user, and executing the pressure measurement script corresponding to the application program based on the number of the concurrent users.
5. The method according to claim 1, wherein after the obtaining of the pressure measurement script corresponding to the identification information fed back by the server and the number of concurrent users corresponding to the pressure measurement script, the method further comprises:
judging whether the pressure measurement script fed back by the server is an encrypted script or not;
if the pressure measurement script is an encryption script, sending an encryption key acquisition request of the pressure measurement script to the server;
and acquiring an encrypted secret key corresponding to the pressure measurement script fed back by the server, and decrypting the pressure measurement script based on the encrypted secret key to obtain the decrypted pressure measurement script.
6. The method according to claim 1, wherein the server stores pressure measurement scripts corresponding to different applications, and the pressure measurement scripts are generated from configuration request parameters and pressure measurement parameters corresponding to the different applications, and the method comprises:
determining configuration request parameters corresponding to different application programs according to protocol types, domain name information, port information, request links, request modes and request parameters corresponding to the different application programs configured by a user at the server;
determining pressure measurement parameters corresponding to different application programs according to the number of concurrent users and the pressure measurement time corresponding to the different application programs configured by the user at the server;
generating pressure measurement scripts corresponding to different application programs at the server based on the configuration request parameters and the pressure measurement parameters;
and correspondingly storing the identification information corresponding to the different application programs and the pressure measurement script into the server.
7. The method according to claim 1, wherein the sending an acquisition request of a pressure test script of an application program to a server, where the acquisition request carries identification information of the application program, comprises:
and responding to an acquisition instruction of the pressure measurement script of the application program triggered by a user, generating an acquisition request of the pressure measurement script of the application program based on the identification information corresponding to the application program, and sending the acquisition request to the server.
8. An application stress testing apparatus, comprising:
the system comprises a sending unit, a receiving unit and a processing unit, wherein the sending unit is used for sending an acquisition request of a pressure measurement script of an application program to a server, and the acquisition request carries identification information of the application program;
an obtaining unit, configured to obtain a pressure measurement script corresponding to the identification information fed back by the server and a number of concurrent users corresponding to the pressure measurement script, where the server stores pressure measurement scripts corresponding to different application programs, and the pressure measurement script is generated by configuration request parameters and pressure measurement parameters corresponding to the different application programs;
the judging unit is used for judging whether the pressure measurement parameters corresponding to the pressure measurement script contain pressure measurement time or not;
and the execution unit is used for executing the pressure measurement script corresponding to the application program based on the pressure measurement time and the number of the concurrent users if the pressure measurement parameters corresponding to the pressure measurement script contain the pressure measurement time.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
10. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 7 when executed by the processor.
CN202111233140.XA 2021-10-22 2021-10-22 Pressure testing method and device of application program, storage medium and computer equipment Pending CN114116448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111233140.XA CN114116448A (en) 2021-10-22 2021-10-22 Pressure testing method and device of application program, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111233140.XA CN114116448A (en) 2021-10-22 2021-10-22 Pressure testing method and device of application program, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN114116448A true CN114116448A (en) 2022-03-01

Family

ID=80376709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111233140.XA Pending CN114116448A (en) 2021-10-22 2021-10-22 Pressure testing method and device of application program, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN114116448A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615171A (en) * 2022-03-16 2022-06-10 网易(杭州)网络有限公司 Pressure measurement processing method, device, medium and program product for cloud game server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615171A (en) * 2022-03-16 2022-06-10 网易(杭州)网络有限公司 Pressure measurement processing method, device, medium and program product for cloud game server
CN114615171B (en) * 2022-03-16 2024-01-30 网易(上海)网络有限公司 Pressure measurement processing method, device, medium and program product of cloud game server

Similar Documents

Publication Publication Date Title
CN108923908B (en) Authorization processing method, device, equipment and storage medium
CN108718347B (en) Domain name resolution method, system, device and storage medium
CN108347361B (en) Application program testing method and device, computer equipment and storage medium
CN108243188B (en) Interface access, interface call and interface verification processing method and device
CN108664395B (en) Application program testing method, device, equipment and storage medium
US10540223B1 (en) System for determining error data
TW201342050A (en) System and method for processing probation software
CN110113440B (en) Request response method, device and terminal
CN112954050B (en) Distributed management method and device, management equipment and computer storage medium
CN109582583B (en) Software testing method, device, computer equipment and storage medium
CN112783787A (en) Interface test method, device and system and electronic equipment
CN114116448A (en) Pressure testing method and device of application program, storage medium and computer equipment
CN114239026A (en) Information desensitization conversion processing method, device, computer equipment and storage medium
CN114416169A (en) Data processing method, medium, device and computing equipment based on micro front end
CN109522202B (en) Software testing method and device
CN111752819B (en) Abnormality monitoring method, device, system, equipment and storage medium
CN108768916B (en) Method and device for acquiring security configuration information
CN116244682A (en) Database access method, device, equipment and storage medium
US10216926B2 (en) Isolation of untrusted code in operating system without isolation capability
US20200301816A1 (en) Code profiling system and associated methods
CN110995756B (en) Method and device for calling service
CN113626789A (en) User operation request processing method and device and electronic equipment
CN112416763A (en) Method, device and equipment for automatically testing interface and storage medium
CN112333150A (en) Data decryption method and device, storage medium and computing equipment
CN112162923A (en) Interface testing method and device

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