Performance testing method and device, computer equipment and computer readable storage medium
Through pre-configured test control scripts and collection probes, stress testing tools and node monitoring tools are used to conduct distributed system performance testing, which solves the problems of low efficiency in distributed system performance testing and difficulty in problem location, and achieves fast and automated performance. Test closed loop.
Patent Information
- Application Number
- CN202011040376.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-28
- Publication Date
- 2024-10-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The performance testing efficiency of distributed systems is low, abnormal problem location is difficult, and a large number of experienced manual participation is required. The complicated system call relationships make it difficult to solve problems quickly.
Use pre-configured test control scripts and collection probes to conduct performance testing through stress testing tools and node monitoring tools, collect indicators such as response time, transaction success rate, and CPU usage, and output test results based on the exception rule base to match abnormal conditions.
It realizes the closed loop of distributed system performance testing, improves testing efficiency, reduces manual participation, quickly locates and solves problems, and improves the level of test automation.
Smart Images

Figure CN112115029B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system testing, and in particular to a performance testing method and apparatus, a computer device, and a computer-readable storage medium. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] With the rise of distributed systems, enterprises have begun to actively explore the migration of host systems. Compared with traditional host centralized systems, distributed systems are less expensive, but they are larger in scale, have more system roles, and have more complex calling relationships. Therefore, it is particularly important to perform performance testing on distributed systems before production to obtain the capacity and expansion capabilities of distributed systems.
[0004] The characteristics of distributed systems determine that there are several problems with their performance testing: 1. The large scale of distributed systems leads to slow location of abnormal problems, and it is impossible to quickly find abnormal nodes; 2. The large number of roles in distributed systems leads to more points of introduction of performance problems; 3. The call relationship of distributed systems is more complex, resulting in a performance problem at a certain layer of the distributed system causing a chain reaction at multiple layers, making it difficult to locate the problem and requiring a large number of experienced people to participate in the analysis. These problems have greatly increased the difficulty of performance testing of distributed systems, and the testing efficiency has been criticized.
[0005] Therefore, the performance test of existing distributed systems has the problem of low testing efficiency. Summary of the invention
[0006] An embodiment of the present invention provides a performance testing method for improving the efficiency of distributed system performance testing. The performance testing method includes:
[0007] According to the pre-configured test control script of the distributed system, the control script of the stress test tool is used to control the stress test tool to perform stress testing on the distributed node to be tested, and the control script of the node monitoring tool is used to control the node monitoring tool to monitor the distributed node to be tested; the test control script includes the control scripts of the distributed node to be tested of the distributed system, the stress test tool and the node monitoring tool;
[0008] Use the pre-configured distributed system collection probe to collect the performance test data of the distributed system; the performance test data includes the system log of the distributed node to be tested, the performance test indicators of the stress test tool and the node monitoring tool; the performance test indicators include the response time of the distributed node, the transaction success rate and the CPU usage rate;
[0009] Match the collected performance test indicators according to the pre-configured data anomaly rule library;
[0010] When the performance test indicator matches the data anomaly rule in the data anomaly rule library, the performance test result is output according to the system log of the distributed node to be tested.
[0011] The embodiment of the present invention further provides a performance testing device for improving the efficiency of distributed system performance testing, the performance testing device comprising:
[0012] A test control module is used to control the pressure test tool to perform pressure testing on the distributed node to be tested according to a pre-configured test control script of the distributed system, and to control the node monitoring tool to monitor the distributed node to be tested using the control script of the node monitoring tool according to the control script of the node monitoring tool; the test control script includes the distributed node to be tested of the distributed system, the control script of the pressure test tool and the control script of the node monitoring tool;
[0013] The data collection module is used to collect the performance test data of the distributed system using the pre-configured distributed system collection probe; the performance test data includes the system log of the distributed node to be tested, the performance test indicators of the stress test tool and the node monitoring tool; the performance test indicators include the response time of the distributed node, the transaction success rate and the CPU occupancy rate;
[0014] The anomaly rule matching module is used to match the collected performance test indicators according to the pre-configured data anomaly rule library;
[0015] The result output module is used to output the performance test result according to the system log of the distributed node to be tested when the performance test indicator matches the data anomaly rule in the data anomaly rule library.
[0016] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned performance testing method when executing the computer program.
[0017] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above performance testing method.
[0018] In an embodiment of the present invention, a stress test tool is controlled according to a configured control script to perform a stress test on a distributed node to be tested, and at the same time, a node monitoring tool is controlled according to the configured control script to monitor the distributed node to be tested; performance test data of the distributed system is collected using a configured collection probe; and then the collected performance test indicators are matched according to a configured data anomaly rule library; finally, when matching, the performance test results are output according to the system log of the distributed node to be tested. Therefore, a closed loop of distributed system performance testing can be achieved through a pre-configured control script, thereby greatly improving the efficiency of distributed system performance testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0020] Figure 1 A flow chart of the implementation of the performance testing method provided by the embodiment of the present invention;
[0021] Figure 2 Another implementation flow chart of the performance testing method provided by an embodiment of the present invention;
[0022] Figure 3 Another implementation flow chart of the performance testing method provided by the embodiment of the present invention;
[0023] Figure 4 A functional module diagram of a performance testing device provided by an embodiment of the present invention;
[0024] Figure 5 Another functional module diagram of the performance testing device provided by an embodiment of the present invention;
[0025] Figure 6 Another functional module diagram of the performance testing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0027] Figure 1 The implementation process of the performance testing method provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0028] like Figure 1 As shown, the performance testing method includes:
[0029] Step 101, according to a pre-configured test control script of a distributed system, a control script of a stress test tool is used to control the stress test tool to perform stress testing on a distributed node to be tested, and a control script of a node monitoring tool is used to control the node monitoring tool to monitor the distributed node to be tested; the test control script includes the control scripts of the distributed node to be tested of the distributed system, the stress test tool and the node monitoring tool;
[0030] Step 102, using a pre-configured distributed system collection probe to collect performance test data of the distributed system; the performance test data includes system logs of the distributed nodes to be tested, performance test indicators of stress testing tools and node monitoring tools;
[0031] Step 103, matching the collected performance test indicators according to the pre-configured data anomaly rule library;
[0032] Step 104: when the performance test indicator matches the data anomaly rule in the data anomaly rule library, the performance test result is output according to the system log of the distributed node to be tested.
[0033] In an embodiment of the present invention, a distributed system includes multiple distributed nodes. When performing a performance stress test on a distributed system, a distributed node to be tested can be flexibly selected. The distributed node to be tested can be one or more. Before performing a performance test on a distributed system, the test control script, acquisition probe, and abnormal rule database of the distributed system can be pre-configured and maintained, that is, preparatory work before the performance test of the distributed system is performed to deploy an environment for the performance test of the distributed system.
[0034] The pre-configured test control script of the distributed system is a control script for testing the distributed system, which mainly includes the following information: the distributed nodes to be tested in the distributed system, the control script of the stress test tool, and the control script of the node monitoring tool. When performing performance testing on the distributed system, the control script of the stress test tool in the test control script is used to control the stress test tool to perform stress testing on the distributed nodes to be tested; at the same time, the control script of the node monitoring tool is used to control the node monitoring tool to monitor the distributed nodes to be tested.
[0035] The stress testing tool is a commonly used stress testing tool in the testing field, which may differ according to the specific programming language. The stress testing tool may be, for example, a commonly used mainstream stress testing tool, such as KylinTOP testing and monitoring platform, LoadRunner, Apache JMeter, or other stress testing tools other than the above, such as Neoload, WebLOAD, etc. The embodiment of the present invention does not impose any special restrictions on this.
[0036] In addition, the node monitoring tool is a commonly used node monitoring tool in the testing field, which may be different according to the specific programming language, or have different functions according to the application scenario. For example, the node monitoring tool may be a Stagemonitor node monitoring tool, or a Pinpoint node monitoring tool. It can be understood by those skilled in the art that the node monitoring tool may also be other node monitoring tools other than the above, such as a MoSKito node monitoring tool, a Glowroot node monitoring tool, and a Kamon node monitoring tool, etc., and the embodiment of the present invention does not impose any particular limitation on this.
[0037] After using the stress testing tool to perform stress testing on the distributed node to be tested, and using the node monitoring tool to monitor the distributed node to be tested, the performance test data of the distributed system is collected using the pre-configured distributed system collection probe. Among them, in order to ensure the accuracy of the performance test, the performance test data of the distributed system collected by the collection probe may include the system log of the distributed node to be tested, the performance test index of the stress testing tool and the performance test index of the node monitoring tool. Among them, the performance test index may include, for example, the response time of the distributed node, the transaction success rate and the CPU occupancy rate. It can be understood by those skilled in the art that the performance test index may also be other performance test indicators in addition to the above-mentioned performance test indicators, such as concurrent transaction volume, etc., and the embodiment of the present invention does not impose any special restrictions on this.
[0038] After the performance test indicator is collected by the collection probe, the performance test indicator is matched according to the configured data anomaly rule library. Among them, the data anomaly rule library includes common data anomaly rules in distributed system testing. For example, the data anomaly rule library may include the response time of the distributed node exceeding the preset response time threshold, or the transaction success rate is less than the preset success rate threshold, etc. It can be understood by those skilled in the art that the data anomaly rule library may also include other data anomaly rules besides the above, and the embodiment of the present invention does not impose any special restrictions on this.
[0039] The preset response time threshold is a preset response time threshold, and those skilled in the art may preset the preset response time threshold according to actual conditions and specific requirements. For example, the preset response time threshold is preset to 150 milliseconds, or the preset response time threshold is preset to 100 milliseconds, etc. Those skilled in the art may understand that the preset response time threshold may also include other response time thresholds other than those mentioned above, and the embodiments of the present invention do not impose any particular limitation on this.
[0040] The preset success rate threshold is a preset success rate threshold, and those skilled in the art may preset the preset success rate threshold according to actual conditions and specific requirements. For example, the preset success rate threshold is preset to 98%, or the preset success rate threshold is preset to 95% or 99%, etc. Those skilled in the art may understand that the preset success rate threshold may also include other success rate thresholds other than those mentioned above, and the embodiments of the present invention do not impose any particular limitation on this.
[0041] If the performance test indicator matches the data anomaly rule in the data anomaly rule library, it means that the distributed system has an anomaly, which may be a response time delay, a low transaction success rate, or a long transaction execution time, etc. At this time, the system log of the distributed node to be tested is analyzed and the performance test results are output. The performance test results can include the located anomaly problems, thereby realizing the closed loop of distributed system performance testing and greatly improving the efficiency of distributed system performance testing.
[0042] In an embodiment of the present invention, a stress test tool is controlled according to a configured control script to perform a stress test on a distributed node to be tested, and at the same time, a node monitoring tool is controlled according to the configured control script to monitor the distributed node to be tested; performance test data of the distributed system is collected using the configured collection probe; and then the collected performance test indicators are matched according to the configured data anomaly rule library; finally, the performance test results are output according to the system log of the distributed node to be tested when matching. Therefore, a closed loop of distributed system performance testing can be achieved through a pre-configured control script, thereby greatly improving the efficiency of distributed system performance testing.
[0043] Figure 2 Another implementation process of the performance testing method provided by the embodiment of the present invention is shown. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0044] In one embodiment of the present invention, in order to further improve the efficiency of distributed system performance testing, as Figure 2 As shown, based on the above method steps, the performance testing method also includes:
[0045] Step 201, determining a test tuning suggestion corresponding to a performance test result from a pre-configured tuning knowledge base;
[0046] Step 202: Call the test control script of the distributed system and perform tuning using the test tuning suggestions corresponding to the performance test results.
[0047] Among them, the tuning knowledge base is a pre-configured and maintained knowledge base, which includes test tuning suggestions corresponding to the performance test results. For example, the transaction execution time in the performance test indicator is 150 milliseconds, and the matched data anomaly rule is that the transaction execution time exceeds the execution time threshold of 80 milliseconds. The abnormal problem located by analyzing the log is that a certain query statement is slow to query. At this time, the test tuning suggestions corresponding to the slow query statement query in the performance test results are determined from the tuning knowledge base, such as checking whether the index of the data table is established. If the test tuning suggestions can be completed through the test control script, the test control script of the distributed system can be called, and the test tuning suggestions corresponding to the performance test results can be used for tuning to further improve the performance test of the distributed system so that the performance of the distributed system meets the requirements.
[0048] In addition, if the test tuning suggestions cannot be completed through the test control script of the distributed system, manual intervention can be performed for tuning, and after the manual tuning is completed, the distributed system performance test can be performed again to verify the tuning results.
[0049] In an embodiment of the present invention, test tuning suggestions corresponding to performance test results are determined from a tuning knowledge base, a test control script is called, and tuning is performed using the test tuning suggestions corresponding to the performance test results. The tuning knowledge base can be adjusted and improved, thereby further improving the efficiency of distributed system performance testing.
[0050] Figure 3 Another implementation process of the performance testing method provided by the embodiment of the present invention is shown. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0051] In one embodiment of the present invention, in order to improve the flexibility of performance testing, Figure 3 As shown, based on the above method steps, the performance testing method also includes:
[0052] Step 301: configure a test control script of a distributed system according to the received configuration instruction.
[0053] The test control script of the distributed system can be configured by receiving configuration instructions in the visual interface. The distributed nodes to be tested, the stress test tool and its control script, the node monitoring tool and its control script, etc. in the configured test control script can also be modified and adjusted based on the modification instructions. For example, deletion, addition or modification.
[0054] In one embodiment of the present invention, in order to improve the flexibility of performance testing, Figure 3 As shown, based on the above method steps, the performance testing method also includes:
[0055] Step 302: configure the collection probe of the distributed system according to the received configuration instruction.
[0056] The distributed system collection probe can be configured by receiving configuration instructions in the visual interface. The distributed nodes to be tested, stress testing tools and node monitoring tools in the configured collection probe can also be modified and adjusted based on the modification instructions, for example, deletion, addition or modification.
[0057] In one embodiment of the present invention, in order to improve the flexibility of performance testing, Figure 3 As shown, based on the above method steps, the performance testing method also includes:
[0058] Step 303: configure the data anomaly rules in the data anomaly rule library according to the received configuration instructions.
[0059] Among them, the data anomaly rules in the data anomaly rule base can be configured by receiving configuration instructions in the visual interface. The data anomaly rules in the configured data anomaly rule base can also be modified and adjusted based on the modification instructions. For example, delete, add or modify the data anomaly rules.
[0060] In one embodiment of the present invention, in order to improve the flexibility of performance testing, Figure 3 As shown, based on the above method steps, the performance testing method also includes:
[0061] Step 304: configure the test tuning suggestions in the tuning knowledge base according to the received configuration instructions.
[0062] The test tuning suggestions in the tuning knowledge base can be configured by receiving configuration instructions in the visual interface. The test tuning suggestions in the configured tuning knowledge base can also be modified and adjusted based on the modification instructions, for example, deleting, adding or modifying the test tuning suggestions.
[0063] In an embodiment of the present invention, the test control script and collection probe of the distributed system are configured according to the received configuration instructions, and the data anomaly rules in the data anomaly rule library and the test tuning suggestions in the tuning knowledge base are configured according to the received configuration instructions, so as to improve the flexibility of the distributed system performance testing.
[0064] The embodiment of the present invention also provides a performance testing device, as described in the following embodiments. Since the principles of solving the problems by these devices are similar to those of the performance testing method, the implementation of these devices can refer to the implementation of the method, and the repeated parts will not be repeated.
[0065] Figure 4 The functional modules of the performance testing device provided by the embodiment of the present invention are shown. For the convenience of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:
[0066] refer to Figure 4 The modules included in the performance testing device are used to perform Figure 1 For details of each step in the corresponding embodiment, please refer to Figure 1 as well as Figure 1 In the embodiment of the present invention, the performance test device includes a test control module 401 , a data acquisition module 402 , an abnormal rule matching module 403 and a result output module 404 .
[0067] The test control module 401 is used to control the stress testing tool to perform stress testing on the distributed node to be tested according to the pre-configured test control script of the distributed system by using the control script of the stress testing tool, and to control the node monitoring tool to monitor the distributed node to be tested by using the control script of the node monitoring tool; the test control script includes the distributed node to be tested of the distributed system, the control script of the stress testing tool and the control script of the node monitoring tool.
[0068] The data collection module 402 is used to collect performance test data of the distributed system using pre-configured distributed system collection probes; the performance test data includes system logs of the distributed nodes to be tested, performance test indicators of stress testing tools and node monitoring tools.
[0069] The abnormal rule matching module 403 is used to match the collected performance test indicators according to the pre-configured data abnormal rule library.
[0070] The result output module 404 is used to output the performance test result according to the system log of the distributed node to be tested when the performance test indicator matches the data anomaly rule in the data anomaly rule library.
[0071] In an embodiment of the present invention, the test control module 401 controls the stress testing tool to perform stress testing on the distributed node to be tested according to the configured control script, and at the same time controls the node monitoring tool to monitor the distributed node to be tested according to the configured control script; the data acquisition module 402 uses the configured acquisition probe to collect performance test data of the distributed system; then the exception rule matching module 403 matches the collected performance test indicators according to the configured data exception rule library; finally, the result output module 404 outputs the performance test result according to the system log of the distributed node to be tested when matching, so that the closed loop of the distributed system performance test can be realized through the pre-configured control script, which greatly improves the efficiency of the distributed system performance test.
[0072] Figure 5 Another functional module of the performance testing device provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0073] In one embodiment of the present invention, in order to further improve the efficiency of distributed system performance testing, reference is made to Figure 5 The modules included in the performance testing device are used to perform Figure 2 For details of each step in the corresponding embodiment, please refer to Figure 2 as well as Figure 2 In the embodiment of the present invention, based on the above module structure, the performance testing device further includes a tuning suggestion determination module 501 and a tuning execution module 502 .
[0074] The tuning suggestion determination module 501 is used to determine the test tuning suggestion corresponding to the performance test result from a pre-configured tuning knowledge base.
[0075] The tuning execution module 502 is used to call the test control script of the distributed system and perform tuning using the test tuning suggestions corresponding to the performance test results.
[0076] In an embodiment of the present invention, the tuning suggestion determination module 501 determines the test tuning suggestions corresponding to the performance test results from the tuning knowledge base, and the tuning execution module 502 calls the test control script and uses the test tuning suggestions corresponding to the performance test results to perform tuning, which can adjust and improve the tuning knowledge base, thereby further improving the efficiency of distributed system performance testing.
[0077] Figure 6 Another functional module of the performance testing device provided by the embodiment of the present invention is shown. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0078] In one embodiment of the present invention, in order to improve the flexibility of performance testing, reference Figure 6 The modules included in the performance testing device are used to perform Figure 3 For details of each step in the corresponding embodiment, please refer to Figure 3 as well as Figure 3 In the embodiment of the present invention, based on the above module structure, the performance test device further includes a control script configuration module 601 .
[0079] The control script configuration module 601 is used to configure the test control script of the distributed system according to the received configuration instructions.
[0080] In one embodiment of the present invention, in order to improve the flexibility of performance testing, reference Figure 6 Based on the above module structure, the performance testing device also includes a collection probe configuration module 602.
[0081] The collection probe configuration module 602 is used to configure the collection probe of the distributed system according to the received configuration instruction.
[0082] In one embodiment of the present invention, in order to improve the flexibility of performance testing, reference Figure 6 Based on the above module structure, the performance testing device also includes an abnormal rule configuration module 603.
[0083] The exception rule configuration module 603 is used to configure the data exception rules in the data exception rule library according to the received configuration instructions.
[0084] In one embodiment of the present invention, in order to improve the flexibility of performance testing, reference Figure 6 Based on the above module structure, the performance testing device also includes a tuning suggestion configuration module 604.
[0085] The tuning suggestion configuration module 604 is used to configure the test tuning suggestions in the tuning knowledge base according to the received configuration instructions.
[0086] In an embodiment of the present invention, the control script configuration module 601 configures the test control script of the distributed system according to the received configuration instructions; the collection probe configuration module 602 configures the collection probe according to the received configuration instructions; the exception rule configuration module 603 configures the data exception rules in the data exception rule library according to the received configuration instructions; the tuning suggestion configuration module 604 configures the test tuning suggestions in the tuning knowledge base according to the received configuration instructions, which can improve the flexibility of distributed system performance testing.
[0087] Among them, in one embodiment of the present invention, the test control module 401 includes a controller, the data acquisition module 402 includes a collector, the abnormal rule matching module 403 and the result output module 404 include an analyzer, and the tuning suggestion determination module 501 and the tuning execution module 502 include a feedback device.
[0088] The following is a brief description of the principle and process of the distributed system performance test of the present invention in combination with a specific application example:
[0089] Suppose we want to perform performance testing on distributed bank account query system X to determine its performance capacity or performance bottleneck. Distributed bank account query system X provides the following functions: querying the account name and balance based on the account number provided by the customer. Through performance testing, we want to determine two things: 1. Business personnel estimate that the distributed bank account query system X needs to meet the performance indicator of 500 concurrent queries per second; 2. If this performance indicator can be achieved, how much pressure can the distributed bank account query system X withstand? If this indicator cannot be achieved, it needs to be tuned to meet this indicator.
[0090] We simplify the roles of distributed bank account query system X into two categories, namely transaction server A (distributed node) and data access server B (distributed node). Class B servers provide two sub-functions: querying account name based on account number and querying balance based on account number; Class A servers summarize the contents of the two queries of Class B servers and provide them to customers. Both types of servers can output transaction operation logs. We use stress testing tool A to initiate simulated query transactions on distributed bank account query system X. Stress testing tool A can also output the average response time and success rate of query transactions of distributed bank account query system X. Node monitoring tool B can monitor the real-time resource status of Class A and Class B servers.
[0091] The specific process of the performance test of the distributed bank account query system X is as follows:
[0092] 1. Maintain the following test control scripts in the controller: start and stop scripts for servers A and B; start and stop scripts for stress testing tool A, in which specific simulated stress values can be maintained; start and stop scripts for node monitoring tool B.
[0093] 2. The following collection probes are maintained in the collector: used to collect the average transaction response time output by stress testing tool A; collect the transaction success rate output by stress testing tool A; collect the operation logs of servers A and B; collect performance test data such as resource status of node monitoring tool B.
[0094] 3. Define the following rules as abnormal points in the abnormal data rule library: the average transaction response time of the distributed bank account query system X exceeds 500ms; the CPU occupancy rate of the server node in the distributed bank account query system X exceeds 50%; the single transaction execution time of the Class A server exceeds 30ms; the single transaction execution time of the Class B server exceeds 80ms.
[0095] 4. Maintain the following content in the tuning knowledge base: If the database query is slow, check whether the database index is established.
[0096] 5. The controller sets the initial concurrent transactions of stress test tool A to 100 per second, starts the test scenario, and the node monitoring tool starts monitoring.
[0097] 6. The collector collects performance test data including performance test indicators according to the set probes.
[0098] 7. The analyzer matches the collected performance test indicators according to the data anomaly rules in the data anomaly rule library to check whether one or more rules can be matched. If the execution time of a single transaction on a Class B server reaches 150ms at a certain moment, exceeding the threshold of 80ms. The analyzer further analyzes the operation log of the Class B server at that moment and finds that a certain query statement in the database is very slow. It preliminarily locates it as the reason for the slow operation of the Class B server and outputs the slow query statement and data table name.
[0099] 8. The feedback device checks the tuning knowledge base based on the performance test results of the analyzer and provides feedback to the user on the database query statements that are executed slowly, as well as feedback on test tuning suggestions, that is, prompting the user to check whether the index of the data table is established.
[0100] 9. If we maintain the control script of the database in the controller, the feedback device can directly create the index through the controller. Otherwise, the user needs to manually create the index and restart the controller to verify the tuning results.
[0101] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned performance testing method when executing the computer program.
[0102] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above performance testing method.
[0103] To summarize, the embodiment of the present invention controls the stress testing tool to perform stress testing on the distributed node to be tested according to the configured control script, and at the same time controls the node monitoring tool to monitor the distributed node to be tested according to the configured control script; uses the configured collection probe to collect performance test data of the distributed system; and then matches the collected performance test indicators according to the configured data anomaly rule library; finally, outputs the performance test results according to the system log of the distributed node to be tested when matching. Therefore, through the pre-configured control script, a closed loop of distributed system performance testing can be achieved, thereby greatly improving the efficiency of distributed system performance testing.
[0104] The performance test of the distributed system provided by the embodiment of the present invention has the following beneficial effects:
[0105] 1. Control the tested distributed system and distributed nodes, stress testing tools and node monitoring tools on demand: The present invention can automatically control the start and stop of each server of the tested system according to the user's requirements to meet the requirements of different test scenarios for the server cluster scale; it can also control the start and stop of stress testing tools and node monitoring tools to realize the control automation of all roles in the performance testing process.
[0106] 2. Customized test information collection: During the test process, the present invention will comprehensively collect the operation status and log information of each role in the system under test according to the user's customized needs. It can also collect the execution status and output information of the test tools, and centralize this information for easy viewing and analysis.
[0107] 3. Automatic determination and decision-making of anomalies: The present invention determines system anomalies based on the data anomaly rules configured by the user, and quickly locates the time and location of the anomaly, integrates all the information collected at the time of the problem, and analyzes the possible causes of the problem through decision-making.
[0108] 4. Optimization feedback based on manual experience: The present invention proposes corresponding optimization methods based on the existing optimization knowledge base or the optimization knowledge base newly maintained by the user by comparing the system anomalies and locating the causes of the problems.
[0109] The new invention solves the problems of slow anomaly detection, slow problem location and difficult system control in the distributed system performance testing process by controlling the tested distributed system, stress testing tools and node monitoring tools on demand, comprehensively collecting various information in the test scenario, automatically correlating and analyzing and matching the tuning solutions. It automates the entire process from stress initiation, node monitoring, indicator analysis, and system tuning, thus improving the efficiency of distributed system performance testing and enhancing its automation level.
[0110] 5. The control scripts and collection probes are independent of each other and have no quantity limit, which meets the needs of controlling and monitoring large-scale distributed systems and is compatible with existing stress testing tools, node monitoring tools and various applications. The abnormal rule database and tuning database have universal characteristics. Through continuous accumulation, maintenance and optimization, they can be widely promoted in the performance testing of various systems.
[0111] 6. The entire invention forms a closed loop of automated performance testing of large-scale distributed systems, greatly improving the performance testing efficiency of distributed systems. At the same time, through the abnormal data rule base and tuning knowledge base, it has a beneficial impact on the accumulation and promotion of distributed system performance testing experience.
[0112] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0116] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A performance testing method, characterized in that: include: According to the pre-configured test control script of the distributed system, the control script of the stress test tool is used to control the stress test tool to perform stress testing on the distributed node to be tested, and the control script of the node monitoring tool is used to control the node monitoring tool to monitor the distributed node to be tested; the test control script includes the control scripts of the distributed node to be tested of the distributed system, the stress test tool and the node monitoring tool; Use the pre-configured distributed system collection probe to collect the performance test data of the distributed system; the performance test data includes the system log of the distributed node to be tested, the performance test indicators of the stress test tool and the node monitoring tool; the performance test indicators include the response time of the distributed node, the transaction success rate and the CPU usage rate; Match the collected performance test indicators according to the pre-configured data anomaly rule library; When the performance test indicator matches the data anomaly rule in the data anomaly rule library, the performance test result is output according to the system log of the distributed node to be tested.
2. The performance testing method according to claim 1, characterized in that: Also includes: Determine test tuning recommendations corresponding to performance test results from a pre-configured tuning knowledge base; Call the test control script of the distributed system and perform tuning using the test tuning suggestions corresponding to the performance test results.
3. The performance testing method according to claim 1, characterized in that: Also includes: Configure the test control script of the distributed system according to the received configuration instructions.
4. The performance testing method according to claim 1, characterized in that: Also includes: Configure the collection probe of the distributed system according to the received configuration instructions.
5. The performance testing method according to claim 1, characterized in that: Also includes: The data anomaly rules in the data anomaly rule base are configured according to the received configuration instructions.
6. The performance testing method according to claim 1, characterized in that: Also includes: The test tuning suggestions in the configuration tuning knowledge base are configured according to the received configuration instructions.
7. A performance testing device, characterized in that: include: The test control module controls the pressure testing tool to perform pressure testing on the distributed node to be tested by using the control script of the pressure testing tool according to the pre-configured test control script of the distributed system, and controls the node monitoring tool to monitor the distributed node to be tested by using the control script of the node monitoring tool; the test control script includes the control scripts of the distributed node to be tested of the distributed system, the pressure testing tool and the node monitoring tool; The data collection module is used to collect the performance test data of the distributed system using the pre-configured distributed system collection probe; the performance test data includes the system log of the distributed node to be tested, the performance test indicators of the stress test tool and the node monitoring tool; the performance test indicators include the response time of the distributed node, the transaction success rate and the CPU occupancy rate; The anomaly rule matching module is used to match the collected performance test indicators according to the pre-configured data anomaly rule library; The result output module is used to output the performance test result according to the system log of the distributed node to be tested when the performance test indicator matches the data anomaly rule in the data anomaly rule library.
8. The performance testing device according to claim 7, characterized in that: Also includes: A tuning suggestion determination module is used to determine the test tuning suggestions corresponding to the performance test results from a pre-configured tuning knowledge base; The tuning execution module is used to call the test control script of the distributed system and perform tuning using the test tuning suggestions corresponding to the performance test results.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the performance testing method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the performance testing method according to any one of claims 1 to 6 is implemented.
