Pressure testing method, device and equipment and computer readable medium
By switching servers in a big data environment and utilizing historical and real-time messages from distributed file systems, the problem of long stress testing preparation time is solved, the pressure testing efficiency is improved, and the real peak scenario is simulated.
Patent Information
- Application Number
- CN202310500668.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2024-11-05
AI Technical Summary
The existing stress testing methods have a long preparation time for pressure testing in big data environments, resulting in low efficiency. It is difficult to quickly simulate peak traffic in e-commerce scenarios, and normalized reading and writing pressure testing requires a lot of manpower to operate, which is prone to errors.
By monitoring the requests of pressure measurement objects, switching the primary server and backup server, and using online historical messages and real-time messages stored in the distributed file system, quickly construct pressure measurement data, ensuring timely processing of real-time messages, generating and analytical data to improve efficiency.
It realizes the rapid construction of pressure measurement data, ensures real-time message processing, significantly improves pressure measurement efficiency, reduces manpower investment and preparation time, and can simulate peak scenarios more realistically.
Smart Images

Figure CN118897787A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a method, device, equipment and computer-readable medium for stress testing. Background Art
[0002] Stress testing is a testing method to establish system stability. It is usually performed outside the normal operating range of the system to examine its functional limits and hidden dangers.
[0003] At present, the read and write stress test of real-time data in big data is mostly carried out by forming flood storage capacity online for production traffic, and then starting flood discharge to perform stress test on downstream systems when the traffic size meets the requirements.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: the stress test preparation time is long, resulting in low stress test efficiency. Summary of the invention
[0005] In view of this, embodiments of the present invention provide a stress testing method, apparatus, device, and computer-readable medium, which can improve stress testing efficiency.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a stress test method is provided, comprising:
[0007] Monitor the stress test request of the stress test object and switch the primary server and the backup server of the stress test object;
[0008] Using multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, the multiple types of online historical messages being pre-stored in a distributed file system;
[0009] Based on the monitoring data of the stress testing task, analysis data of the stress testing object is generated.
[0010] The monitoring of the stress test request of the stress test object and switching the primary server and the backup server of the stress test object include:
[0011] Create a stress testing script on the stress testing platform, and point the read link stress testing configuration to the server of the stress testing object to obtain the monitoring data;
[0012] By updating the read link interface program, the stress testing parameters of the stress testing object are monitored to determine the stress testing request of the stress testing object;
[0013] Switch the stress test object from the primary server to the backup server.
[0014] The monitoring of the stress test parameters of the stress test object includes:
[0015] Call the http application programming interface provided by the control center to monitor the stress testing parameters of the control center.
[0016] Before executing the stress testing task of the stress testing request using the multiple types of online historical messages and the multiple types of online real-time messages, the method further includes:
[0017] Storing the online historical messages in the distributed file system according to occurrence dates and message types;
[0018] The online historical messages of the distributed file system are identified to distinguish the online historical messages from the online real-time messages.
[0019] The using multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request includes:
[0020] After monitoring the stress test request of the stress test object, using a message queue to input the multiple types of online historical messages from the distributed file system to the stress test object;
[0021] The multiple types of online real-time messages are input into the stress testing object to execute the stress testing task of the stress testing request.
[0022] The multiple types of online real-time messages are multiple types of data processed online in real time by the stress testing object.
[0023] The method further comprises:
[0024] Call the interface to obtain the monitoring parameters of the stress test object, determine that the stress test object is abnormal, and terminate the stress test task;
[0025] Switch the backup server of the stress test object and the primary server of the stress test object.
[0026] According to a second aspect of an embodiment of the present invention, there is provided a pressure test apparatus, comprising:
[0027] A monitoring module is used to monitor the stress test request of the stress test object and switch the main server and the backup server of the stress test object;
[0028] An execution module, configured to use multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, wherein the multiple types of online historical messages are pre-stored in a distributed file system;
[0029] The analysis module is used to generate analysis data of the stress testing object based on the monitoring data of the stress testing task.
[0030] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for stress testing, comprising:
[0031] one or more processors;
[0032] a storage device for storing one or more programs,
[0033] When the one or more programs are executed by the one or more processors, the one or more processors implement the above method.
[0034] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.
[0035] One embodiment of the above invention has the following advantages or beneficial effects: monitoring a stress test request of a stress test object, switching the primary server and the backup server of the stress test object; using multiple types of online historical messages and multiple types of online real-time messages to execute the stress test task of the stress test request, wherein the multiple types of online historical messages are pre-stored in a distributed file system; generating analysis data of the stress test object based on the monitoring data of the stress test task. For stress test requests, stress test data can be quickly constructed using online historical messages and online real-time messages, and timely processing of online real-time messages is guaranteed, thereby improving stress test efficiency.
[0036] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0038] Figure 1 is a schematic diagram of the main flow of a stress test method according to an embodiment of the present invention;
[0039] Figure 2 is a schematic diagram of a process of monitoring a stress test request of a stress test object according to an embodiment of the present invention;
[0040] Figure 3 is a schematic diagram of a process for obtaining online historical messages according to an embodiment of the present invention;
[0041] Figure 4 It is a schematic diagram of a process of performing a stress testing task using online historical messages and online real-time messages according to an embodiment of the present invention;
[0042] Figure 5 is a schematic diagram of a stress test according to an embodiment of the present invention;
[0043] Figure 6 is a schematic diagram of a process for monitoring a stress test object according to an embodiment of the present invention;
[0044] Figure 7 is a schematic diagram of the main structure of a pressure test device according to an embodiment of the present invention;
[0045] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0046] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0048] Currently, in e-commerce scenarios, data produced upstream (for example, data related to the order volume of items or data related to the number of item visits) is accumulated to generate a large backlog of data, and then the large amount of accumulated data is sent at one time to simulate the order or visit peak during the e-commerce promotion to achieve stress testing.
[0049] The daily order volume and visit volume are very different from those during the big promotion. The above data accumulation method usually requires 4 to 8 hours of data. Because the accumulation speed is slow, the recording level can only meet the simulation of about 10 minutes. If you want to repeat the data after sending it once, you must accumulate it again for several hours. The above stress test method takes a long time to prepare, but in fact the stress test only takes a few minutes. It is a one-time operation and cannot be used repeatedly.
[0050] Moreover, for some reservation orders and pre-sale orders, there are almost no orders or the quantity is far from enough during non-large-scale promotional periods. Even if the above-mentioned diversion and damming method is adopted, it is impossible to simulate the real scene.
[0051] In addition, when performing periodic normalized read-write stress testing, the R&D personnel manually reset the task and the test personnel manually start the pre-prepared stress testing tasks to complete it. Even if the reset point is adopted, manpower is still required to configure the modification operation, which is labor-intensive and prone to errors.
[0052] In summary, the stress testing preparation time is long, resulting in low stress testing efficiency.
[0053] In order to solve the technical problem of low stress testing efficiency, the following technical solution in the embodiment of the present invention may be adopted.
[0054] See also Figure 1 , Figure 1 1 is a schematic diagram of the main flow of the stress test method according to an embodiment of the present invention, which uses online historical messages and online real-time messages to perform stress testing tasks, and implements stress testing on the basis of timely processing of online real-time messages. Figure 1 As shown, the specific steps include:
[0055] S101: Monitor a stress test request of a stress test object and switch the primary server and the backup server of the stress test object.
[0056] In the embodiment of the present invention, the object to be subjected to stress testing is referred to as a stress testing object. As an example, the stress testing object includes one or more of an online program, a software system, and a hardware device. A server is used to provide services to the stress testing object. The server includes a primary server and a backup server.
[0057] You can use the stress testing platform to monitor stress testing requests. The stress testing platform is a performance testing platform specifically provided for developers and testers. It completes performance testing through a series of operation processes such as writing scripts, configuring monitoring, setting scenarios, starting tasks, real-time monitoring, log location, and exporting reports.
[0058] That is, when the stress testing platform monitors the stress testing request of the stress testing object, the primary server and the backup server of the stress testing object are switched.
[0059] See also Figure 2 , Figure 2 The flowchart of monitoring a stress test request of a stress test object according to an embodiment of the present invention is shown in FIG. The flowchart specifically includes the following steps:
[0060] S201. Create a stress testing script on the stress testing platform, and point the read link stress testing configuration to the server of the stress testing object to obtain monitoring data.
[0061] In order to obtain monitoring data of the compression object, you can create a stress testing script on the stress testing platform and point the read link stress testing configuration to the server of the stress testing object.
[0062] Specifically, you can create a stress test script through the stress test platform, point the read link stress test configuration to the server of the stress test object, and perform a regular stress test to confirm that the stress test is executed normally. After that, you can use the normalized stress test function of the stress test platform to create a new normalized stress test task based on the regular stress test. Regular stress testing includes stress test tasks that are executed periodically.
[0063] It can be understood that if the stress testing script includes a stress testing execution cycle, the stress testing task can be executed in the stress testing execution cycle.
[0064] In one embodiment of the present invention, a software system can be used to control the stress testing platform, thereby realizing a complete software delivery process from software development, testing, release and maintenance. As an example, the software system includes Xingyun Pipeline. Xingyun Pipeline is a software system developed based on the open source Jenkins. Jenkins is an open source software project and a continuous integration tool developed based on Java.
[0065] In one embodiment of the present invention, the stress testing task identifier is used in the Xingyun pipeline to call the stress testing platform to create a stress testing script. The read link stress testing configuration is collected daily and stored in the network disk. In the Xingyun pipeline, the network disk file is updated to the stress testing script through the stress testing interface before the stress testing is executed, so as to point the read link stress testing configuration to the server of the stress testing object.
[0066] S202: Monitor stress test parameters of the stress test object by updating the read link interface program to determine the monitored stress test request of the stress test object.
[0067] If the stress test parameter of the monitored object changes, it is determined that the stress test request of the stress test object is monitored. As an example, the stress test parameter includes ON and OFF. If the stress test parameter changes from OFF to ON, it is determined that the stress test request of the stress test object is monitored.
[0068] In order to monitor the stress test parameters, the stress test parameters of the stress test object can be monitored by updating the read link interface program. It can be understood that there are corresponding read link interface programs for different stress test objects. In order to monitor the stress test parameters of a specified stress test object, the read link interface program needs to be updated.
[0069] In one embodiment of the present invention, the http program programming interface provided by the control center is called to monitor the stress test parameters of the control center.
[0070] As an example, in order to monitor stress testing parameters in a timely manner, if the software system controlling the stress testing platform supports Linux commands, the hypertext transfer protocol (http) application programming interface provided by the control center can be called through Linux commands to monitor the stress testing parameters of the center.
[0071] S203: Switch the stress test object from the primary server to the backup server.
[0072] In the normal business process of the stress test object, the main server is often used to provide services, and the business data of the stress test object is stored in the backup server. The business data in the main server and the backup server are the same. During the stress test process, the stress test object needs to be switched from the main server to the backup server. As an example, if a stress test request of the stress test object is monitored, it means that the stress test of the stress test object is about to start, and the stress test object is switched from the main server to the backup server.
[0073] exist Figure 2 In the embodiment, after monitoring the stress test request of the stress test object, the main server and the backup server are switched to prepare for the stress test.
[0074] S102: Use multiple types of online historical messages and multiple types of online real-time messages to execute the stress testing task requested by the stress testing, where the multiple types of online historical messages are pre-stored in the distributed file system.
[0075] Stress testing needs to be implemented using online messages. Online messages are messages that the stress test object needs to process during runtime. In an embodiment of the present invention, online messages include online historical messages and online real-time messages. Online historical messages are data that the stress test object needs to process during historical runtime. Online real-time messages are data that the stress test object needs to process during current runtime.
[0076] There are multiple categories of online messages. As an example, the categories include one or more of the following: browsing messages, transaction messages, payment messages, and delivery messages. Each category of messages can be stored in a preset space. As an example, browsing messages are stored in memory 1; transaction messages are stored in memory 2; payment messages are stored in memory 3; and delivery messages are stored in memory 4.
[0077] Considering that the stress test object needs to process online real-time messages while executing the stress test task to ensure the normal operation of the stress test object. Therefore, multiple types of online historical messages and multiple types of online real-time messages can be used to execute the stress test task requested by the stress test. The types of online historical messages can be preset. As an embodiment, the stress test task targets the rapid growth of browsing messages and transaction messages, and the preset online historical messages include browsing messages and transaction messages.
[0078] See also Figure 3 , Figure 3 1 is a schematic diagram of a process for obtaining online historical messages according to an embodiment of the present invention. Specifically, the following steps are included:
[0079] S301. Store online historical messages in a distributed file system according to occurrence date and message type.
[0080] In an embodiment of the present invention, online historical messages are copied and stored. When stress testing is required, online historical messages are directly read and played back into the stress testing object, thereby simulating access to a large amount of data. In order to facilitate the acquisition and display of online historical messages, online historical messages can be stored in a distributed file system according to the occurrence date of the online historical messages and the message type of the online historical messages.
[0081] As an example, the browsing messages on February 1 are stored in area a1 of the distributed file system; the transaction messages on February 1 are stored in area a2 of the distributed file system; the browsing messages on February 2 are stored in area b1 of the distributed file system; and the transaction messages on February 2 are stored in area b2 of the distributed file system.
[0082] S302: Identify online historical messages of the distributed file system to distinguish online historical messages from online real-time messages.
[0083] During the stress test, the stress test object also needs to process real messages, that is, online real-time messages. In order to avoid affecting online real-time messages, it is necessary to identify the online historical messages of the distributed file system to distinguish between online historical messages and online real-time messages.
[0084] As an example, a specific identifier of the online historical message of the distributed file system is set. As an example, the specific identifier is 1. That is, the online historical message and the online real-time message are distinguished by the specific identifier. The stress test object processes the online historical message including the specific identifier and the online real-time message not including the specific identifier separately, so as to avoid affecting the online real-time message.
[0085] exist Figure 3 In an embodiment of the present invention, online historical messages are stored in a distributed file system so as to obtain online historical messages in a timely manner.
[0086] See also Figure 4 , Figure 4 This is a flow chart of using online historical messages and online real-time messages to perform stress testing tasks according to an embodiment of the present invention. Specifically, the following steps are included:
[0087] S401: After monitoring a stress test request of a stress test object, a message queue is used to input multiple types of online historical messages from a distributed file system to the stress test object.
[0088] After monitoring the stress test request of the stress test object, multiple types of online historical messages can be obtained. Specifically, a message queue is used to input multiple types of online historical messages from the distributed file system to the stress test object, thereby simulating the scenario of a large amount of real data being written to the stress test object. As an example, the message queue includes a real-time message queue. The real-time message queue is a real-time messaging platform based on Kafka that serves a wide range of businesses.
[0089] S402: Input multiple types of online real-time messages into the stress testing object to execute the stress testing task requested by the stress testing.
[0090] While online historical messages are input into the stress testing object, online real-time messages can also be input into the stress testing object to execute the stress testing task requested by the stress testing.
[0091] It can be understood that, on the one hand, the stress test object can process online real-time messages normally to ensure normal business; on the other hand, online real-time messages can be input into the stress test object as stress test data to improve the authenticity of the stress test data.
[0092] exist Figure 4 In the embodiment, online historical messages and online real-time messages are used as stress test data input into the stress test object, and stress testing is performed while ensuring normal processing of online real-time messages, thereby improving the authenticity of the stress test data.
[0093] See also Figure 5 , Figure 5 2 is a schematic diagram of a stress test according to an embodiment of the present invention. While processing online real-time messages, the online real-time messages are stored in a distributed file system. The online real-time messages stored in the distributed file system are called online historical messages.
[0094] After receiving the stress test request, the online historical messages and online real-time messages in the distributed file system are input into the stress test object as stress test data to implement the stress test.
[0095] In one embodiment of the present invention, the multiple types of online real-time messages are multiple types of data that the stress test object processes in real time online. The multiple types of online real-time messages are input into the stress test object, and while ensuring the processing of online real-time messages, the stress test is performed with real data, thereby improving the authenticity of the stress test.
[0096] In one embodiment of the present invention, multiple types of online historical messages include multiple types of historical peak data. During the stress test, it is necessary to simulate the peak condition to obtain the state of the stress test object. By implementing stress testing with multiple types of historical peak data, there is no need to accumulate data, thereby improving the efficiency of stress testing.
[0097] S103: Generate analysis data of the stress testing object based on the monitoring data of the stress testing task.
[0098] Based on the monitoring data of the stress testing task, the analysis data of the stress testing object can be generated. As an example, the monitoring data of the stress testing task is obtained through the interface, and then the analysis data of the stress testing object is generated.
[0099] See also Figure 6 , Figure 6 This is a flow chart of monitoring a stress test object according to an embodiment of the present invention. Specifically, it includes the following steps:
[0100] S601. Call an interface to obtain monitoring parameters of a stress test object, and if it is determined that the stress test object is abnormal, terminate the stress test task.
[0101] To ensure the normal operation of the stress test object, you need to monitor the stress test object while it is being executed. Call the interface to obtain the monitoring parameters of the stress test object. If the stress test object is abnormal, terminate the stress test task.
[0102] As an example, the monitoring parameters include the average response time of online users. If the average user response time is greater than 5 seconds for 3 consecutive minutes, it is determined that the stress test object is abnormal, and the stress test task is terminated.
[0103] As another example, the monitoring parameter includes the cluster CPU usage. If the cluster CPU usage exceeds 80% for 2 consecutive minutes, it is determined that the stress test object is abnormal, and the stress test task is terminated.
[0104] S602: Switch the backup server of the stress test object and the primary server of the stress test object.
[0105] If the stress test object is determined to be abnormal, it is necessary to switch the server of the stress test object from the backup server to the main server to ensure the normal operation of the stress test object.
[0106] exist Figure 6 In the embodiment of the present invention, the stress test object is monitored in real time to ensure the normal operation of the stress test object.
[0107] In the above-mentioned embodiment of the present invention, a stress test request of a stress test object is monitored, and the primary server and the backup server of the stress test object are switched; a plurality of types of online historical messages and the plurality of types of online real-time messages are used to execute the stress test task of the stress test request, and the plurality of types of online historical messages are pre-stored in a distributed file system; and analysis data of the stress test object is generated based on the monitoring data of the stress test task. For stress test requests, stress test data can be quickly constructed using online historical messages and online real-time messages, and timely processing of online real-time messages is guaranteed, thereby improving stress test efficiency.
[0108] See also Figure 7 , Figure 7is a schematic diagram of the main structure of a pressure test device according to an embodiment of the present invention. The pressure test device can implement a pressure test method, such as Figure 7 As shown, the pressure test device specifically includes:
[0109] A monitoring module 701 is used to monitor a stress test request of a stress test object and switch a primary server and a backup server of the stress test object;
[0110] An execution module 702 is used to use multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, wherein the multiple types of online historical messages are pre-stored in a distributed file system;
[0111] The analysis module 703 is used to generate analysis data of the stress testing object based on the monitoring data of the stress testing task.
[0112] In one embodiment of the present invention, the monitoring module 701 is specifically used to create a stress testing script on the stress testing platform, and point the read link stress testing configuration to the server of the stress testing object to obtain the monitoring data;
[0113] By updating the read link interface program, the stress testing parameters of the stress testing object are monitored to determine the stress testing request of the stress testing object;
[0114] Switch the stress test object from the primary server to the backup server.
[0115] In one embodiment of the present invention, the monitoring module 701 is specifically used to call the http application programming interface provided by the control center to monitor the stress testing parameters of the control center.
[0116] In one embodiment of the present invention, the execution module 702 is further configured to store the online historical messages in the distributed file system according to occurrence dates and message types;
[0117] The online historical messages of the distributed file system are identified to distinguish the online historical messages from the online real-time messages.
[0118] In one embodiment of the present invention, the execution module 702 is specifically configured to, after monitoring the stress test request of the stress test object, input the multiple types of online historical messages from the distributed file system to the stress test object using a message queue;
[0119] The multiple types of online real-time messages are input into the stress testing object to execute the stress testing task of the stress testing request.
[0120] In one embodiment of the present invention, the multiple types of online real-time messages are multiple types of data processed online in real time by the stress testing object.
[0121] In one embodiment of the present invention, the analysis module 703 is further used to call an interface to obtain monitoring parameters of the stress test object, and terminate the stress test task if it is determined that the stress test object is abnormal.
[0122] Switch the backup server of the stress test object and the primary server of the stress test object.
[0123] Figure 8 An exemplary system architecture 800 is shown to which the stress testing method or stress testing apparatus according to an embodiment of the present invention may be applied.
[0124] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0125] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0126] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0127] The server 805 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0128] It should be noted that the stress testing method provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the stress testing device is generally set in the server 805 .
[0129] It should be understood that Figure 8The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0130] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0131] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0132] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0133] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.
[0134] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0135] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a monitoring module, an execution module and an analysis module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the monitoring module may also be described as "used to monitor the stress test request of the stress test object and switch the main server and the backup server of the stress test object".
[0137] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0138] Monitor the stress test request of the stress test object and switch the primary server and the backup server of the stress test object;
[0139] Using multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, the multiple types of online historical messages being pre-stored in a distributed file system;
[0140] Based on the monitoring data of the stress testing task, analysis data of the stress testing object is generated.
[0141] According to the technical solution of the embodiment of the present invention, a stress test request of a stress test object is monitored, and the main server and the backup server of the stress test object are switched; multiple types of online historical messages and multiple types of online real-time messages are used to execute the stress test task of the stress test request, and the multiple types of online historical messages are pre-stored in a distributed file system; based on the monitoring data of the stress test task, the analysis data of the stress test object is generated. For the stress test request, the stress test data can be quickly constructed with online historical messages and online real-time messages, and the online real-time messages can be processed in a timely manner, thereby improving the efficiency of stress testing.
[0142] The above specific implementation methods do not constitute limitations on the scope of protection of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention. It should be noted that in the technical solution disclosed in this disclosure, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
Claims
1. A stress testing method, characterized in that: include: Monitor the stress test request of the stress test object and switch the primary server and the backup server of the stress test object; Using multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, the multiple types of online historical messages being pre-stored in a distributed file system; Based on the monitoring data of the stress testing task, analysis data of the stress testing object is generated.
2. The method for pressure testing according to claim 1, characterized in that: The monitoring of the stress test request of the stress test object and switching the primary server and the backup server of the stress test object include: Create a stress testing script on the stress testing platform, and point the read link stress testing configuration to the server of the stress testing object to obtain the monitoring data; By updating the read link interface program, the stress testing parameters of the stress testing object are monitored to determine the stress testing request of the stress testing object; Switch the stress test object from the primary server to the backup server.
3. The method for pressure testing according to claim 2, characterized in that: The monitoring of the stress test parameters of the stress test object includes: The application programming interface of the hypertext transfer protocol (http) provided by the control center is called to monitor the stress testing parameters of the control center.
4. The method for pressure testing according to claim 1, characterized in that: Before executing the stress testing task of the stress testing request using the multiple types of online historical messages and the multiple types of online real-time messages, the method further includes: Storing the online historical messages in the distributed file system according to occurrence dates and message types; The online historical messages of the distributed file system are identified to distinguish the online historical messages from the online real-time messages.
5. The method for pressure testing according to claim 1, characterized in that: The using multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request includes: After monitoring the stress test request of the stress test object, using a message queue to input the multiple types of online historical messages from the distributed file system to the stress test object; The multiple types of online real-time messages are input into the stress testing object to execute the stress testing task of the stress testing request.
6. The method for pressure testing according to claim 1, characterized in that: The multiple types of online real-time messages are multiple types of data processed online in real time by the stress testing object.
7. The method for pressure testing according to claim 1, characterized in that: The method further comprises: Call the interface to obtain the monitoring parameters of the stress test object, determine that the stress test object is abnormal, and terminate the stress test task; Switch the backup server of the stress test object and the primary server of the stress test object.
8. A pressure test device, characterized in that: include: A monitoring module is used to monitor the stress test request of the stress test object and switch the main server and the backup server of the stress test object; An execution module, configured to use multiple types of online historical messages and the multiple types of online real-time messages to execute the stress testing task of the stress testing request, wherein the multiple types of online historical messages are pre-stored in a distributed file system; The analysis module is used to generate analysis data of the stress testing object based on the monitoring data of the stress testing task.
9. An electronic device for stress testing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
