CN117539754A - Pressure testing method and device, storage medium and electronic equipment - Google Patents

Pressure testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117539754A
CN117539754A CN202311477632.2A CN202311477632A CN117539754A CN 117539754 A CN117539754 A CN 117539754A CN 202311477632 A CN202311477632 A CN 202311477632A CN 117539754 A CN117539754 A CN 117539754A
Authority
CN
China
Prior art keywords
test
pressure test
pressure
tasks
files
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
CN202311477632.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311477632.2A priority Critical patent/CN117539754A/en
Publication of CN117539754A publication Critical patent/CN117539754A/en
Pending legal-status Critical Current

Links

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/3684Test management for test design, e.g. generating new test cases
    • 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
    • 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/3692Test management for test results analysis

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 application discloses a pressure testing method, a pressure testing device, a storage medium and electronic equipment. Relates to the field of cloud computing, financial science and technology or other related fields, and the method comprises the following steps: acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks; determining a pressure test template file; determining test files corresponding to the N pressure test tasks respectively based on the pressure test template files and the test parameters corresponding to the N pressure test tasks respectively; concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: average response time, number of files processed per second. According to the method and the device, the problem that the pressure testing efficiency is low because the pressure testing method in the related technology needs to test different pressure testing tasks by using a plurality of testing tools is solved.

Description

Pressure testing method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of cloud computing, financial science and technology, or other related fields, and in particular, to a pressure testing method, a pressure testing device, a storage medium, and an electronic device.
Background
With the development of cloud computing and distributed technology, information technology (Information Technology, IT) systems gradually transition from traditional monolithic services to distributed services. The distributed architecture brings the advantages of high performance and high availability, and also causes the complexity of the IT system. In order to ensure the stability of the system, IT is necessary to perform system tests on IT systems, including functional tests, pressure tests, and the like. Distributed systems are typically composed of different nodes, which typically assume different functions and require different test tools for pressure testing, such as a presentation layer transition (Representational State Transfer, restful) interface server requires hypertext transfer protocol (Hypertext Transfer Protocol, http) test tools, and a database server requires structured query language (Structured Query Language, sql) test tools. Therefore, if multiple pressure testing tasks need to be tested in the related art, multiple testing tools are often needed to complete the testing, and the pressure testing efficiency is low.
Aiming at the problem that the pressure test method in the related technology needs to test different pressure test tasks by utilizing a plurality of test tools, the pressure test efficiency is low, and no effective solution is proposed at present.
Disclosure of Invention
The main objective of the present application is to provide a pressure testing method, a device, a storage medium and an electronic apparatus, so as to solve the problem of low pressure testing efficiency caused by the fact that the pressure testing method in the related art needs to test different pressure testing tasks by using multiple testing tools.
To achieve the above object, according to one aspect of the present application, there is provided a pressure testing method. The method comprises the following steps: acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks, wherein N is an integer greater than 0; determining a pressure test template file, wherein the pressure test template file at least comprises: pressure measurement address, thread pool configuration and pressure measurement target flow; determining test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively; concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: average response time, number of files processed per second.
Optionally, the determining, based on the pressure test template file and the test parameters respectively corresponding to the N pressure test tasks, the test file respectively corresponding to the N pressure test tasks includes: generating a target script, wherein the target script is used for generating a test file; based on the target script, writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template file respectively to obtain test files respectively corresponding to the N pressure test tasks.
Optionally, the performing concurrent execution processing on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively includes: acquiring a target module, wherein the target module is used for executing the test file; determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure test and the duration of the pressure test; based on the test parameters, the target module is adopted to conduct concurrent test on the test files corresponding to the N pressure test tasks respectively, and pressure test results corresponding to the N pressure test tasks respectively are obtained.
Optionally, the method further comprises: acquiring a scheduler and concurrent parameters corresponding to the scheduler, wherein the scheduler is used for concurrent execution of multiple tasks; and based on the dispatcher, the concurrency parameter and the target module, performing concurrency test on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively.
Optionally, based on the scheduler, the concurrency parameter, and the target module, performing concurrency test on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, where the step of performing concurrency test includes: adding the test files corresponding to the N pressure test tasks into the scheduler; based on the concurrency parameters, M test files are obtained from the scheduler; adopting the target module to perform concurrent testing on the M test files; repeating the steps until the scheduler does not have an untested test file, and outputting the pressure test results respectively corresponding to the N pressure test tasks, wherein M is an integer greater than 0 and less than or equal to N.
Optionally, after the concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, the method further includes: and storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
Optionally, after the concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, the method further includes: obtaining a target tool library, wherein the target tool library is used for carrying out numerical operation on data; and respectively analyzing and processing the pressure test results respectively corresponding to the N pressure test tasks based on the target tool library to obtain test reports respectively corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
In order to achieve the above object, according to another aspect of the present application, there is provided a pressure testing apparatus. The device comprises: the first acquisition module is used for acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks, wherein N is an integer greater than 0; the first determining module is configured to determine a pressure test template file, where the pressure test template file at least includes: pressure measurement address, thread pool configuration and pressure measurement target flow; the second determining module is used for determining the test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively; the third determining module is configured to perform concurrent testing on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, where the pressure test results at least include: average response time, number of files processed per second.
To achieve the above object, according to another aspect of the present application, there is also provided a non-volatile storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the pressure test method of any one of the above.
To achieve the above object, according to another aspect of the present application, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any one of the pressure testing methods.
Through the application, the following steps are adopted: acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks, wherein N is an integer greater than 0; determining a pressure test template file, wherein the pressure test template file at least comprises: pressure measurement address, thread pool configuration and pressure measurement target flow; determining test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively; concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: the average response time and the number of files processed per second reach the aim of generating test files corresponding to the pressure test tasks respectively by using a single test tool based on test parameters corresponding to the pressure test environment template file and the pressure test tasks respectively, and efficiently and concurrently testing the test files corresponding to the pressure test tasks respectively, solve the problem of low pressure test efficiency caused by the fact that the pressure test method in the related art needs to test different pressure test tasks by using multiple test tools, and further reach the effect of improving the pressure test efficiency.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and explain the application and are not to be construed as limiting the application. In the drawings:
FIG. 1 is a flow chart of a pressure testing method provided in accordance with an embodiment of the present application; and
FIG. 2 is a schematic diagram of a pressure testing apparatus provided according to an embodiment of the present application;
fig. 3 is a schematic diagram of an electronic device provided according to an embodiment of the present application.
Detailed Description
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the present application described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of description, the following will describe some terms or terms related to the embodiments of the present application:
JMeter: the load testing tool is an open source load testing tool and is used for testing the performance of software, networks and the like. It can simulate various types of loads, including concurrent users, network loads, and server loads, to test the performance of the system under different load conditions. Jmeters can configure and execute tests by creating test plans, thread groups, and test elements, and provide rich test reports and charts to analyze test results. JMeter supports multiple protocols including HTTP, FTP, JDBC, SOAP, REST, etc., so that it can perform performance testing for various types of applications.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
In the following description of the preferred implementation steps, fig. 1 is a flowchart of a pressure testing method according to an embodiment of the present application, as shown in fig. 1, and the method includes the following steps:
step S101, N pressure test tasks and test parameters corresponding to the N pressure test tasks are obtained, wherein N is an integer greater than 0.
Alternatively, the IT system may be subjected to the following stress tests, for example: load test: testing the performance of the system under normal load by simulating the normal use condition of the system; and (3) concurrent testing: by simulating simultaneous access of multiple users to the system, testing performance of the system under high concurrency; peak test: by suddenly increasing the load of the system to a limit value, the ability of the system to handle a large number of requests in a short time is tested; delay test: by gradually increasing the load of the system, the performance of the system under conditions exceeding normal load is tested, etc. The different tasks may include the following test parameters: the number of concurrent users, the frequency of requests, the amount of load, the response time, the throughput, etc. By acquiring test parameters corresponding to different tasks, the performance and stability of the system can be more comprehensively evaluated.
Step S102, determining a pressure test template file, wherein the pressure test template file at least comprises: the method comprises the steps of pressure measurement address, thread pool configuration and pressure measurement target flow.
Optionally, the stress test template file is generated based on a visual GUI tool provided by the JMeter, and is a file in a format for managing and monitoring Java applications (Java Management Extensions, jmx), and the stress test template file contains a stress test address, so that a target address or service to be subjected to stress test can be specified. Thus, when the test tool is pressed, the test tool can send a request according to the address, and the user can be simulated to access the target system. Parameters related to the thread pool, such as the number of threads, the size of the thread pool, etc., can also be configured in the template file. These parameters can affect the concurrency and performance of the crush test. By configuring thread pool parameters, concurrent user access behavior can be simulated, thereby evaluating the performance of the system under high load. The template file may also be configured to target flow, i.e., specify the number and frequency of user requests to be simulated. By configuring the target flow, the access behavior of the actual user to the system can be simulated, so that the performance of the system under different loads can be evaluated.
Step S103, determining test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively.
Optionally, the test parameters corresponding to the N pressure test tasks may be stored in a file or a database, and when the pressure test is to be performed, the test parameters are read and filled into the pressure test template file, so that the test files corresponding to the N pressure test tasks may be obtained. By using the pressure test template file to generate the test file, the full-quantity pressure test can be more efficiently performed, and the test efficiency and the test quality are improved.
In an alternative embodiment, determining the test file corresponding to each of the N pressure test tasks based on the pressure test template file and the test parameters corresponding to each of the N pressure test tasks includes: generating a target script, wherein the target script is used for generating a test file; based on the target script, writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template file respectively to obtain test files respectively corresponding to the N pressure test tasks.
Alternatively, a target script may be written using Python, wherein the script is used to generate test files and multiple stress test tasks may be performed in parallel. Based on the target script, reading the test parameters respectively corresponding to the N pressure test tasks and the pressure test template file, and respectively writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template file to obtain the test files respectively corresponding to the N pressure test tasks. Through the mode, the Python can be utilized to automatically generate the test files respectively corresponding to the plurality of pressure test tasks, flexible adaptation of pressure test requirements of different scenes can be realized, and the test efficiency is improved.
Step S104, concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively, and pressure test results corresponding to the N pressure test tasks respectively are obtained, wherein the pressure test results at least comprise: average response time, number of files processed per second.
Alternatively, the average response time refers to the average response time of the system to the request, which reflects the efficiency and speed at which the system processes the request. The average response time of the system under different loads can be obtained through pressure test, so that the performance of the system under different loads can be known. The number of files processed per second refers to the number of files that the system can process per unit time. The load capacity of the system can be evaluated through the pressure test, and the processing capacity of the system under the condition of high load is known. The stress test results may include maximum response time, response time distribution, system resource utilization, etc., in addition to average response time, number of files processed per second. The python queue may be used in the python script to collect the pressure test results for each test file separately.
In an alternative embodiment, concurrent testing is performed on test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, including: acquiring a target module, wherein the target module is used for executing a test file; determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure test and the duration of the pressure test; based on the test parameters, a target module is adopted to conduct concurrent test on the test files corresponding to the N pressure test tasks respectively, and pressure test results corresponding to the N pressure test tasks respectively are obtained.
Alternatively, the target module is a sub-process module in Python, which may execute external commands, so based on the test parameters, the command line executor of JMeter may be called by the sub-process module to run jmx the test file, e.g., the pressure test may be performed using the command "JMeter-n-t text. Meanwhile, the sub process module can concurrently execute a plurality of jmx test files by creating a plurality of sub processes, so that the test files corresponding to the N pressure test tasks respectively can be tested concurrently, thereby realizing the concurrent execution of the plurality of pressure test tasks, and in the test process, the possible errors during the test can be captured and processed correspondingly.
In an alternative embodiment, the method further comprises: acquiring a scheduler and concurrent parameters corresponding to the scheduler, wherein the scheduler is used for concurrent execution of multiple tasks; based on the dispatcher, the concurrency parameters and the target module, the concurrency test is carried out on the test files corresponding to the N pressure test tasks respectively, and the pressure test results corresponding to the N pressure test tasks respectively are obtained.
Optionally, based on the scheduler, the concurrency parameters and the target module, the concurrency test of the test files corresponding to the N pressure test tasks can be realized, and by executing multiple test files concurrently by using the scheduler, multiple users or scenes can be simulated at the same time, the test progress is accelerated, the test efficiency is prompted, and meanwhile, the possible performance problems of the system under the high concurrency condition, such as response time delay, resource competition and the like, can be found.
In an alternative embodiment, based on the scheduler, the concurrency parameter and the target module, the concurrency test is performed on the test files corresponding to the N pressure test tasks respectively, to obtain the pressure test results corresponding to the N pressure test tasks respectively, including: adding test files corresponding to the N pressure test tasks into a scheduler; based on the concurrency parameters, M test files are obtained from a scheduler; a target module is adopted to carry out concurrent test on M test files; repeating the steps until the scheduler does not have an untested test file, and outputting the pressure test results corresponding to the N pressure test tasks respectively, wherein M is an integer greater than 0 and less than or equal to N.
Optionally, adding test files corresponding to the N pressure test tasks respectively to the scheduler, acquiring M test files from the scheduler, wherein M is a preset concurrency parameter, performing concurrency test on the M test files by using the target module, repeating the steps, acquiring the M test files each time for concurrency test until the scheduler does not have an untested test file, and outputting pressure test results corresponding to the N pressure test tasks respectively. By utilizing the scheduler to perform concurrent testing on a plurality of test files, the concurrent quantity and rate can be adjusted, and the expandability and the load capacity of the system can be better evaluated.
In an alternative embodiment, after concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, the method further includes: and storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
Optionally, the pressure test results corresponding to the N pressure test tasks can be stored in a target database, so that the performance condition of the system can be better known, problems and bottlenecks can be found, and the performance trend of the system can be analyzed, so that measures can be taken in time to optimize and improve, and the stability and reliability of the system can be improved. After the pressure test result is stored in the database, the performance index of the system can be displayed in real time through a specific tool and a reporting system, and visual test results and reports can be provided for a manager.
In an alternative embodiment, after concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, the method further includes: obtaining a target tool library, wherein the target tool library is used for carrying out numerical operation on data; and respectively analyzing and processing the pressure test results corresponding to the N pressure test tasks based on the target tool library to obtain test reports corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
Optionally, the target tool library is a Numpy library in Python, which provides a multidimensional array object and a series of functions for manipulating the array, and numerical computation and data analysis can be performed efficiently. Based on the Numpy library, the pressure test results corresponding to the N pressure test tasks can be analyzed and processed respectively to obtain abnormal data included in the pressure test tasks. Meanwhile, a line graph of the pressure test result can be drawn by using Pandas to intuitively display the test result, wherein the Pandas is an open-source Python library and is used for data analysis and data processing. It provides high performance, easy to use data structures and data analysis tools that make data processing and analysis simple and fast.
Through the steps S101 to S104, the purposes of generating the test files corresponding to the pressure test tasks respectively by using a single test tool based on the test parameters corresponding to the pressure test environment template file and the plurality of pressure test tasks respectively and carrying out concurrent test on the test files corresponding to the plurality of pressure test tasks respectively are achieved, the problem that the pressure test efficiency is low due to the fact that the pressure test method in the related art needs to test different pressure test tasks by using a plurality of test tools is solved, and the effect of improving the pressure test efficiency is achieved.
Based on the above examples and alternative examples, the present application proposes an alternative pressure test implementation, the method comprising:
step S1, N pressure test tasks and test parameters corresponding to the N pressure test tasks are obtained, wherein N is an integer greater than 0.
Step S2, determining a pressure test template file, wherein the pressure test template file at least comprises: the method comprises the steps of pressure measurement address, thread pool configuration and pressure measurement target flow.
And S3, generating a target script, wherein the target script is used for generating a test file.
And S4, based on the target script, writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template files respectively to obtain test files respectively corresponding to the N pressure test tasks.
And S5, acquiring a target module, wherein the target module is used for executing the test file.
Step S6, determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure tests and the duration of the pressure tests.
And S7, based on the test parameters, carrying out concurrent test on the test files corresponding to the N pressure test tasks respectively by adopting the target module to obtain pressure test results corresponding to the N pressure test tasks respectively.
And S8, storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
Step S9, a target tool library is obtained, wherein the target tool library is used for carrying out numerical operation on the data.
Step S10, based on the target tool library, respectively analyzing and processing the pressure test results respectively corresponding to the N pressure test tasks to obtain test reports respectively corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a pressure testing device, and the pressure testing device can be used for executing the pressure testing method provided by the embodiment of the application. The pressure testing device provided in the embodiment of the present application is described below.
Fig. 2 is a schematic diagram of a pressure testing device according to an embodiment of the present application. As shown in fig. 2, the apparatus includes: a first acquisition module 201, a first determination module 202, a second determination module 203, a third determination module 204, wherein,
the first obtaining module 201 is configured to obtain N pressure test tasks and test parameters corresponding to the N pressure test tasks, where N is an integer greater than 0;
the first determining module 202 is connected to the first obtaining module 201, and is configured to determine a pressure test template file, where the pressure test template file at least includes: pressure measurement address, thread pool configuration and pressure measurement target flow;
the second determining module 203 is connected to the first determining module 202, and is configured to determine test files corresponding to the N pressure test tasks respectively based on the pressure test template file and test parameters corresponding to the N pressure test tasks respectively;
the third determining module 204, connected to the second determining module 203, is configured to perform concurrent testing on the test files corresponding to the N pressure test tasks, to obtain pressure test results corresponding to the N pressure test tasks, where the pressure test results at least include: average response time, number of files processed per second.
In the application, the first obtaining module 201 is configured to obtain N pressure test tasks and test parameters corresponding to the N pressure test tasks respectively, where N is an integer greater than 0; the first determining module 202 is configured to determine a stress test template file, where the stress test template file at least includes: pressure measurement address, thread pool configuration and pressure measurement target flow; the second determining module 203 is configured to determine test files corresponding to the N pressure test tasks respectively based on the pressure test template file and test parameters corresponding to the N pressure test tasks respectively; the third determining module 204 is configured to perform concurrent testing on test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, where the pressure test results at least include: the average response time and the number of files processed per second reach the aim of generating test files corresponding to the pressure test tasks respectively by using a single test tool based on test parameters corresponding to the pressure test environment template file and the pressure test tasks respectively, and efficiently and concurrently testing the test files corresponding to the pressure test tasks respectively, solve the problem of low pressure test efficiency caused by the fact that the pressure test method in the related art needs to test different pressure test tasks by using multiple test tools, and further reach the effect of improving the pressure test efficiency.
In an alternative embodiment, the second determining module includes: the first generation sub-module is used for generating a target script, wherein the target script is used for generating a test file; the first writing sub-module is used for writing the test parameters corresponding to the N pressure test tasks into the pressure test template files respectively based on the target script to obtain the test files corresponding to the N pressure test tasks respectively.
In an alternative embodiment, the third determining module includes: the first acquisition sub-module is used for acquiring a target module, wherein the target module is used for executing a test file; the first determining submodule is used for determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure test and the duration of the pressure test; and the second determining submodule is used for carrying out concurrent test on the test files corresponding to the N pressure test tasks respectively by adopting the target module based on the test parameters to obtain pressure test results corresponding to the N pressure test tasks respectively.
In an alternative embodiment, the apparatus further comprises: the second acquisition sub-module is used for acquiring a scheduler and concurrent parameters corresponding to the scheduler, wherein the scheduler is used for concurrent execution of multiple tasks; and the third determining submodule is used for carrying out concurrent test on the test files corresponding to the N pressure test tasks respectively based on the dispatcher, the concurrent parameter and the target module to obtain pressure test results corresponding to the N pressure test tasks respectively.
In an alternative embodiment, the third determining sub-module includes: the first adding submodule is used for adding the test files corresponding to the N pressure test tasks into the scheduler; the first execution sub-module is used for acquiring M test files from the scheduler based on the concurrence parameters; a target module is adopted to carry out concurrent test on M test files; repeating the steps until the scheduler does not have an untested test file, and outputting the pressure test results corresponding to the N pressure test tasks respectively, wherein M is an integer greater than 0 and less than or equal to N.
In an alternative embodiment, the apparatus further comprises: and the second adding sub-module is used for storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
In an alternative embodiment, the apparatus further comprises: the third acquisition sub-module is used for acquiring a target tool library, wherein the target tool library is used for carrying out numerical operation on data; the first analysis sub-module is used for respectively analyzing and processing the pressure test results corresponding to the N pressure test tasks based on the target tool library to obtain test reports corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
It should be noted that each of the above modules may be implemented by software or hardware, for example, in the latter case, it may be implemented by: the above modules may be located in the same processor; alternatively, the various modules described above may be located in different processors in any combination.
Here, the first obtaining module 201, the first determining module 202, the second determining module 203, and the third determining module 204 correspond to steps S101 to S104 in the embodiment, and the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the above modules may be run in a computer terminal as part of the apparatus.
It should be noted that, the optional or preferred implementation manner of this embodiment may be referred to the related description in the embodiment, and will not be repeated herein.
The pressure test device comprises a processor and a memory, wherein the units and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel may be provided with one or more of which the stress test is performed by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application provides a nonvolatile storage medium, on which a program is stored, which when executed by a processor, implements the pressure test method described above.
The embodiment of the application provides a processor, which is used for running a program, wherein the pressure test method is executed when the program runs.
As shown in fig. 3, an embodiment of the present application provides an electronic device, where the electronic device 10 includes a processor, a memory, and a program stored on the memory and executable on the processor, and the processor implements the following steps when executing the program: acquiring N pressure test tasks and test parameters corresponding to the N pressure test tasks respectively, wherein N is an integer greater than 0; determining a pressure test template file, wherein the pressure test template file at least comprises: pressure measurement address, thread pool configuration and pressure measurement target flow; determining test files corresponding to the N pressure test tasks respectively based on the pressure test template files and the test parameters corresponding to the N pressure test tasks respectively; concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: average response time, number of files processed per second. The device herein may be a server, PC, PAD, cell phone, etc.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: acquiring N pressure test tasks and test parameters corresponding to the N pressure test tasks respectively, wherein N is an integer greater than 0; determining a pressure test template file, wherein the pressure test template file at least comprises: pressure measurement address, thread pool configuration and pressure measurement target flow; determining test files corresponding to the N pressure test tasks respectively based on the pressure test template files and the test parameters corresponding to the N pressure test tasks respectively; concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: average response time, number of files processed per second.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: generating a target script, wherein the target script is used for generating a test file; based on the target script, writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template file respectively to obtain test files respectively corresponding to the N pressure test tasks.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: acquiring a target module, wherein the target module is used for executing a test file; determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure test and the duration of the pressure test; based on the test parameters, a target module is adopted to conduct concurrent test on the test files corresponding to the N pressure test tasks respectively, and pressure test results corresponding to the N pressure test tasks respectively are obtained.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: acquiring a scheduler and concurrent parameters corresponding to the scheduler, wherein the scheduler is used for concurrent execution of multiple tasks; based on the dispatcher, the concurrency parameters and the target module, the concurrency test is carried out on the test files corresponding to the N pressure test tasks respectively, and the pressure test results corresponding to the N pressure test tasks respectively are obtained.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: adding test files corresponding to the N pressure test tasks into a scheduler; based on the concurrency parameters, M test files are obtained from a scheduler; a target module is adopted to carry out concurrent test on M test files; repeating the steps until the scheduler does not have an untested test file, and outputting the pressure test results corresponding to the N pressure test tasks respectively, wherein M is an integer greater than 0 and less than or equal to N.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: and storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
Optionally, the above computer program product is further adapted to execute a program initialized with the method steps of: obtaining a target tool library, wherein the target tool library is used for carrying out numerical operation on data; and respectively analyzing and processing the pressure test results corresponding to the N pressure test tasks based on the target tool library to obtain test reports corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A method of pressure testing, comprising:
acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks, wherein N is an integer greater than 0;
determining a pressure test template file, wherein the pressure test template file at least comprises: pressure measurement address, thread pool configuration and pressure measurement target flow;
determining test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively;
concurrent testing is carried out on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively, wherein the pressure test results at least comprise: average response time, number of files processed per second.
2. The method of claim 1, wherein the determining the test files corresponding to the N pressure test tasks based on the pressure test template file and the test parameters corresponding to the N pressure test tasks, respectively, comprises:
generating a target script, wherein the target script is used for generating a test file;
Based on the target script, writing the test parameters respectively corresponding to the N pressure test tasks into the pressure test template file respectively to obtain test files respectively corresponding to the N pressure test tasks.
3. The method of claim 1, wherein the concurrently testing the test files corresponding to the N pressure test tasks respectively to obtain the pressure test results corresponding to the N pressure test tasks respectively, includes:
acquiring a target module, wherein the target module is used for executing the test file;
determining test parameters, wherein the test parameters at least comprise: the concurrency number of the pressure test and the duration of the pressure test;
based on the test parameters, the target module is adopted to conduct concurrent test on the test files corresponding to the N pressure test tasks respectively, and pressure test results corresponding to the N pressure test tasks respectively are obtained.
4. A method according to claim 3, characterized in that the method further comprises:
acquiring a scheduler and concurrent parameters corresponding to the scheduler, wherein the scheduler is used for concurrent execution of multiple tasks;
And based on the dispatcher, the concurrency parameter and the target module, performing concurrency test on the test files corresponding to the N pressure test tasks respectively to obtain pressure test results corresponding to the N pressure test tasks respectively.
5. The method of claim 4, wherein the performing concurrent testing on the test files corresponding to the N pressure test tasks respectively based on the scheduler, the concurrency parameter, and the target module, to obtain the pressure test results corresponding to the N pressure test tasks respectively, includes:
adding the test files corresponding to the N pressure test tasks into the scheduler;
based on the concurrency parameters, M test files are obtained from the scheduler; adopting the target module to perform concurrent testing on the M test files; repeating the steps until the scheduler does not have an untested test file, and outputting the pressure test results respectively corresponding to the N pressure test tasks, wherein M is an integer greater than 0 and less than or equal to N.
6. The method according to any one of claims 1 to 5, wherein after the concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, the method further includes:
And storing the pressure test results corresponding to the N pressure test tasks into a target database, wherein the target database comprises test parameters corresponding to the N pressure test tasks.
7. The method according to any one of claims 1 to 5, wherein after the concurrent testing is performed on the test files corresponding to the N pressure test tasks respectively, the method further includes:
obtaining a target tool library, wherein the target tool library is used for carrying out numerical operation on data;
and respectively analyzing and processing the pressure test results respectively corresponding to the N pressure test tasks based on the target tool library to obtain test reports respectively corresponding to the N pressure test tasks, wherein the test reports are used for indicating abnormal data included in the corresponding pressure test tasks.
8. A service evaluation processing apparatus, comprising:
the first acquisition module is used for acquiring N pressure test tasks and test parameters respectively corresponding to the N pressure test tasks, wherein N is an integer greater than 0;
The first determining module is configured to determine a pressure test template file, where the pressure test template file at least includes: pressure measurement address, thread pool configuration and pressure measurement target flow;
the second determining module is used for determining the test files corresponding to the N pressure test tasks respectively based on the pressure test template file and the test parameters corresponding to the N pressure test tasks respectively;
the third determining module is configured to perform concurrent testing on the test files corresponding to the N pressure test tasks respectively, to obtain pressure test results corresponding to the N pressure test tasks respectively, where the pressure test results at least include: average response time, number of files processed per second.
9. A non-volatile storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the pressure testing method of any one of claims 1 to 7.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the pressure testing method of any of claims 1-7.
CN202311477632.2A 2023-11-07 2023-11-07 Pressure testing method and device, storage medium and electronic equipment Pending CN117539754A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311477632.2A CN117539754A (en) 2023-11-07 2023-11-07 Pressure testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311477632.2A CN117539754A (en) 2023-11-07 2023-11-07 Pressure testing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117539754A true CN117539754A (en) 2024-02-09

Family

ID=89785332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311477632.2A Pending CN117539754A (en) 2023-11-07 2023-11-07 Pressure testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117539754A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117914984A (en) * 2024-03-19 2024-04-19 深圳百沃彰世科技有限公司 Multidimensional communication pressure testing method and system for communication equipment terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117914984A (en) * 2024-03-19 2024-04-19 深圳百沃彰世科技有限公司 Multidimensional communication pressure testing method and system for communication equipment terminal
CN117914984B (en) * 2024-03-19 2024-06-07 深圳百沃彰世科技有限公司 Multidimensional communication pressure testing method and system for communication equipment terminal

Similar Documents

Publication Publication Date Title
CN110245078B (en) Software pressure testing method and device, storage medium and server
CN102868573B (en) Method and device for Web service load cloud test
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN117539754A (en) Pressure testing method and device, storage medium and electronic equipment
CN112835792B (en) Pressure testing system and method
CN111949545A (en) Automatic testing method, system, server and storage medium
TWI734746B (en) Method and device for simulating online pressure test
CN103713935A (en) Method and device for managing Hadoop cluster resources in online manner
CN110968495A (en) Container cloud platform performance evaluation method and device
CN110557291A (en) Network service monitoring system
CN113342515A (en) Method, device and equipment for selecting server-free computing resources and storage medium
CN110334012B (en) Risk assessment method and device
CN115757066A (en) Hard disk performance test method, device, equipment, storage medium and program product
CN116069577A (en) Interface testing method, equipment and medium for RPC service
CN117687920A (en) Interface testing method and device, storage medium and electronic equipment
CN112948262A (en) System test method, device, computer equipment and storage medium
Sun et al. A model-based system to automate cloud resource allocation and optimization
Jayakumar et al. INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)
CN112564996A (en) Pressure test flow scheduling method, pressure test flow control device and computer readable medium
CN116527553A (en) Processing method, system and storage medium for automatic test report of switch
CN114942878A (en) Automatic performance testing method for internet application and related equipment
CN111949504A (en) Pressure testing method, device and medium
CN112035360A (en) Middleware testing method and device, computer equipment and readable storage medium
CN106855840B (en) System CPU analysis method and device
Sfakianakis et al. Trace-based workload generation and execution

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