Interface service performance testing method, device, equipment and storage medium
Through the automated concurrent stress testing method, the use of press clusters and preset rule libraries solves the problem of cumbersome operation of performance testing tools in the existing technology, improves testing efficiency and accuracy, and realizes the automation of interface service performance testing.
Patent Information
- Application Number
- CN201910113198.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-02-13
AI Technical Summary
Existing performance testing tools are cumbersome to operate, time-consuming and labor-intensive, and manual operations can easily lead to testing errors and reduce testing efficiency and accuracy.
By controlling the press cluster to start concurrent threads according to pre-written test scripts, it automatically collects test data, detects service performance bottlenecks, and adjusts the number of concurrent threads according to the preset rule base to realize automated test scenario updates.
It improves the testing efficiency and accuracy, avoids testing errors caused by manual operations, and realizes the automation of interface service performance testing.
Smart Images

Figure CN111563014B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of Internet technology, and in particular to an interface service performance testing method, device, equipment and storage medium. Background Art
[0002] With the increasing number of Internet users and the access peaks caused by various special events, the performance requirements for network interface services are becoming higher and higher, so that the service system can have higher processing capabilities and faster response speeds.
[0003] Currently, performance testing tools, such as LOADRUNNER and JMETER, are usually used to test the performance of interface services to determine whether the interface services can meet user needs.
[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] When using LOADRUNNER or JMETER performance testing tools for performance testing, testers need to manually create test scenarios and manually modify test scenarios repeatedly according to service performance indicators and resource consumption. In addition, after each test scenario is executed, test data needs to be manually counted and performance test reports need to be manually compiled. It can be seen that existing performance testing tools are cumbersome, time-consuming and labor-intensive to operate, and manual operations are prone to test errors, which greatly reduces test efficiency and test accuracy. Summary of the invention
[0006] The embodiment of the present invention provides an interface service performance testing method, device, equipment and storage medium to improve testing efficiency and testing accuracy.
[0007] In a first aspect, an embodiment of the present invention provides an interface service performance testing method, comprising:
[0008] Control the stress machine cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test;
[0009] Collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario based on a preset bottleneck rule base and the test data;
[0010] When there is no service performance bottleneck in the current test scenario, the number of concurrent threads corresponding to the next test scenario is determined according to the preset concurrent rule library and the test data, the next test scenario is updated to the current test scenario, and the operation of controlling the press cluster to open the first thread with the number of concurrent threads corresponding to the current test scenario according to the pre-written test script is returned.
[0011] In a second aspect, an embodiment of the present invention further provides an interface service performance testing device, comprising:
[0012] A press cluster control module, used to control the press cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to a pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test;
[0013] The service performance bottleneck detection module is used to collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario based on the preset bottleneck rule base and the test data;
[0014] The current test scenario update module is used to determine the number of concurrent threads corresponding to the next test scenario based on the preset concurrent rule library and the test data when there is no service performance bottleneck in the current test scenario, update the next test scenario to the current test scenario, and return to execute the operation of controlling the press cluster to open the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-compiled test script.
[0015] In a third aspect, an embodiment of the present invention further provides a device, the device comprising:
[0016] one or more processors;
[0017] A storage device for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the interface service performance testing method provided by any embodiment of the present invention.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the interface service performance testing method provided by any embodiment of the present invention.
[0020] The embodiments of the above invention have the following advantages or beneficial effects:
[0021] By automatically collecting test data during the concurrent stress test of the current test scenario, and detecting that there is no service performance bottleneck in the current test scenario based on the preset bottleneck rule library and test data, it indicates that the interface service performance test has not yet ended. At this time, the number of concurrent threads corresponding to the next test scenario can be determined based on the collected test data and the preset concurrent rule library, so that the test scenario can be automatically adjusted without manual operation, avoiding test errors caused by manually setting the number of concurrent threads, and each test scenario can also be automatically stress tested in a loop, thereby improving test efficiency and test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flow chart of an interface service performance testing method provided in Embodiment 1 of the present invention;
[0023] Figure 2 It is a schematic diagram of the use process of an interface service performance testing tool involved in the first embodiment of the present invention;
[0024] Figure 3 is a flow chart of an interface service performance testing method provided by Embodiment 2 of the present invention;
[0025] Figure 4 is a flow chart of an interface service performance testing method provided by Embodiment 3 of the present invention;
[0026] Figure 5 It is a structural diagram of an interface service performance testing device provided by Embodiment 4 of the present invention;
[0027] Figure 6 It is a structural schematic diagram of a device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0029] Embodiment 1
[0030] Figure 1 This is a flowchart of an interface service performance testing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of performing performance testing on interface services, especially the scenario of performing performance testing on interface services written in JAVA programming language. The method can be executed by an interface service performance testing device, which can be implemented by software and / or hardware and integrated into a device that can control a press cluster. The method specifically includes the following steps:
[0031] S110 , controlling the stress machine cluster to start the first thread of the concurrent thread number corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test.
[0032] Among them, the stress machine may refer to a machine simulating a client, which is used to apply pressure to the server during the performance test, that is, to simulate an actual user sending a request to the server. The stress machine cluster is to concentrate multiple stress machines together to apply pressure to the server to test the processing capacity of the interface service. The pre-written test script may be a test case script pre-written according to the business to be tested and the test requirements. The interface service may refer to a service that can implement the business function to be tested using one or more interfaces. The server cluster may be a server cluster that brings multiple servers together to perform the same service. The server cluster corresponding to the interface service under test may refer to a pre-set server cluster for implementing the interface service under test. The test scenario refers to the scenario in which the stress machine cluster performs concurrent stress testing on the server cluster. Each test scenario corresponds to a number of concurrent threads. The current test scenario refers to the test scenario at the current moment. The number of concurrent threads may refer to the total number of threads opened simultaneously in the stress machine cluster to make concurrent requests to the server cluster. The number of concurrent threads may also refer to the number of concurrent users, that is, the number of users who use the interface service under test at the same time. The first thread may refer to a thread opened in the stress machine cluster for sending user requests to the server cluster.
[0033] Specifically, the main control machine that controls the press cluster can control the press cluster to start the first thread of the concurrent thread number according to the pre-written test script based on the number of concurrent threads corresponding to the current test scenario. For example, if the number of concurrent threads corresponding to the current test scenario is 100, and the press cluster includes 10 presses, the main control machine can control each press to start 10 first threads at the same time according to the pre-written test script. When the first threads of the number of concurrent threads are started at the same time in the press cluster, the user request data corresponding to each first thread can be sent to the server cluster corresponding to the interface service under test at the same time, so that the server cluster can be subjected to concurrent stress testing.
[0034] It should be noted that if the current test scenario is the first test scenario in the performance test process, the number of concurrent threads in the first test scenario can be pre-determined according to the preset configuration information. The preset configuration information can be the initial number of concurrent threads pre-set according to the test requirements. In other words, during the loop test process, the number of concurrent threads corresponding to the first test scenario needs to be pre-determined according to the preset configuration information, and the number of concurrent threads corresponding to subsequent test scenarios can be determined in real time according to subsequent operations.
[0035] S120, collecting test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detecting whether there is a service performance bottleneck in the current test scenario according to a preset bottleneck rule library and test data.
[0036] The test data may include but is not limited to request data during concurrent stress testing, response data corresponding to the request data, and resource consumption information. A service performance bottleneck may refer to a situation in which the hardware and / or software programs of a server cluster cannot meet the test business requirements during the test. The preset bottleneck rule base may be a rule pre-set according to the test requirements and used to determine whether a service performance bottleneck occurs in a server cluster.
[0037] Specifically, during the concurrent stress test of the current test scenario, the obtained test data can be collected, and the current running time and / or the total number of currently processed transactions of the current test scenario can be monitored in real time. When the current running time is equal to the pre-configured preset running time, and / or the total number of currently processed transactions is equal to the pre-configured preset total number of transactions, it can be indicated that the concurrent stress test of the current test scenario is over. At this time, it can be detected whether there is a performance bottleneck in the current test scenario based on the preset bottleneck rule base and the collected test data. If it exists, it indicates that the performance test of the interface service under test is over; if it does not exist, it indicates that the server cluster has not reached the performance bottleneck, and it is necessary to perform concurrent stress testing again.
[0038] Exemplarily, collecting test data in the concurrent stress test process of the current test scenario in S120 may include: collecting each request data and corresponding response data based on each first thread that is opened; opening a second thread in each server in the server cluster, and collecting server resource consumption information corresponding to each server based on each second thread. The server resource consumption information may include but is not limited to at least one of a central processing unit (CPU) utilization rate, a memory utilization rate, a disk utilization rate, a network utilization rate, and a system load.
[0039] Specifically, in the process of concurrent stress testing, this embodiment can use each first thread opened in the stress machine cluster to collect each request data and the response data returned by the server for the request data. By opening a second thread in each server in the server cluster, the server resource consumption information corresponding to each server during the test can be collected using the second thread. This embodiment can also store the collected request data and the corresponding response data as well as each server resource consumption information in a preset memory so that the master control machine can obtain these test data and realize data sharing.
[0040] S130. When there is no service performance bottleneck in the current test scenario, determine the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and test data, update the next test scenario to the current test scenario, and return to step S110.
[0041] The preset concurrent rule base may be pre-set according to test requirements and business needs, and is used to calculate the rules for the number of concurrent threads according to test data.
[0042] Specifically, when there is no service performance bottleneck in the current test scenario, it indicates that the server cluster corresponding to the tested service interface can correctly handle all the first threads opened in the current test scenario. At this time, it is necessary to increase the number of concurrent threads corresponding to the test scenario to exert greater pressure on the server cluster. This embodiment can automatically determine the number of concurrent threads corresponding to the next test scenario based on the preset concurrent rule library and the collected test data, without waiting for the manual statistics of the test results of the current test scenario, and manually modify the number of concurrent threads according to the test results, thereby greatly shortening the test time and avoiding the situation where the test results are inaccurate due to manual setting errors. After determining the number of concurrent threads corresponding to the next test scenario, by updating the next test scenario to the current test scenario, and returning to perform the operation of step S110, so as to perform a concurrent stress test in the next test scenario, each test scenario can be automatically subjected to concurrent stress testing in a loop manner without manual operation, which greatly improves the test efficiency and test accuracy.
[0043] It should be noted that if there is a service performance bottleneck in the current test scenario, it means that the performance test of the interface service under test is over. At this time, the resource consumption of the interface service under test corresponding to each test scenario, the performance indicators of the interface service under test, the resource consumption of the pressure machine cluster, etc. are manually counted, so that the test report can be manually compiled so that the service evaluation of the interface service under test can be carried out.
[0044] The technical solution of this embodiment automatically collects test data during the concurrent stress test of the current test scenario, and when it is detected that there is no service performance bottleneck in the current test scenario based on the preset bottleneck rule library and the test data, it indicates that the interface service performance test has not yet ended. At this time, the number of concurrent threads corresponding to the next test scenario can be determined based on the collected test data and the preset concurrent rule library, so that the test scenario can be automatically adjusted without manual operation, avoiding test errors caused by manually setting the number of concurrent threads, and each test scenario can also be automatically concurrently stressed in a loop, thereby improving test efficiency and test accuracy.
[0045] On the basis of the above technical solution, the method also includes: when there is a service performance bottleneck in the current test scenario, automatically aggregating the test data collected during the concurrent stress test of each test scenario and generating a test report.
[0046] Specifically, when a service performance bottleneck exists in the current test scenario, this embodiment can automatically stop the test by setting the number of concurrent threads corresponding to the next test scenario to 0, and automatically perform statistical analysis based on the collected test data corresponding to each test scenario, so as to automatically generate a test report, saving time and effort, and making the entire test process free of manual operation, thereby realizing the automation of interface service performance testing and further improving test efficiency.
[0047] Exemplarily, automatically aggregating the test data collected during the concurrent stress test of each test scenario to generate a test report may include: comparing the number of transactions per second (TPS) corresponding to each test scenario, and determining the maximum processing capacity of the server cluster based on the test data of the test scenario corresponding to the highest TPS; drawing a TPS histogram based on the TPS corresponding to each test scenario; and linking the test data during the concurrent stress test of each test scenario based on the TPS histogram.
[0048] Specifically, the size of the number of transactions processed per second TPS (Transaction PerSecond) in the service performance index can be used to reflect the processing capacity of each server cluster in each test scenario. The service performance index information and resource consumption information of the test scenario corresponding to the highest TPS are determined as the maximum processing capacity corresponding to the server cluster, so that the tester can better understand the service performance of the interface service under test. The TPS corresponding to each test scenario can be automatically drawn as a TPS bar chart, where the horizontal axis of the TPS bar chart is the test scenario identifier and the vertical axis is the TPS value. And by linking the test scenario identifier in the TPS bar chart with the corresponding test data, the user can directly obtain all the test data corresponding to the test scenario by clicking the test scenario identifier of interest in the TPS bar chart, which is convenient for the user to view the test results.
[0049] Exemplarily, the interface service performance testing method provided in this embodiment may be encapsulated as a testing tool, so that the interface service performance testing tool may be used to automatically perform performance testing. Figure 2 A schematic diagram of the use process of an interface service performance testing tool is given. Figure 2As shown, write a test script in the test tool, and set a "one-key start" button in the main control machine, so that the tester can automatically execute the above-mentioned performance test process by clicking the "one-key start" button. This embodiment can also set configuration parameters according to test requirements before performing performance testing, such as setting the display mode of test data, setting the level and storage path of execution logs, setting the initial number of concurrent threads, setting the scene running time, and / or setting the total number of scene processing transactions, etc., and can also display the collected test data in real time in the display interface during the concurrent stress test of the test scene, so that the test situation of the current test scene can be viewed in real time. When the performance test ends, the test and summary test report can be automatically stopped, so that the automatically summarized test report, each test scenario report and execution log, etc. can be viewed, thereby fully realizing the automation of performance testing, greatly improving test efficiency and test experience.
[0050] On the basis of the above technical solution, S120 detects whether there is a service performance bottleneck in the current test scenario according to the preset bottleneck rule library and test data, which may include: determining the service performance indicator information corresponding to the interface service under test according to each request data and the corresponding response data; determining whether there is a service performance bottleneck in the current test scenario according to the preset bottleneck rule library, service performance indicator information and each server resource consumption information.
[0051] Among them, the service performance indicator information may include but is not limited to: service availability, number of transactions per second TPS, average response time, error rate, response time TP999 required to process 99.9% of the requests, response time TP99 required to process 99% of the requests, response time TP95 required to process 95% of the requests, response time TP90 required to process 90% of the requests, and response time TP50 required to process 50% of the requests. Specifically, each indicator value in the service performance indicator information can be calculated based on the collected request data and the corresponding response data. Exemplarily, the service availability refers to the ratio between the number of correctly processed requests and the total number of requests within a preset time. The service availability can be calculated by counting the number of correctly processed requests and the total number of requests within the preset time. If the total number of requests is 1000, the response time corresponding to each request is arranged from small to large, and the response time corresponding to the 999th request after arrangement is determined as TP999. This embodiment can detect whether a service performance bottleneck occurs based on the service performance indicator information and the resource consumption information of each server at the same time.
[0052] Exemplarily, determining whether there is a service performance bottleneck in the current test scenario based on a preset bottleneck rule base, service performance indicator information and each server resource consumption information can include: detecting whether each indicator value in the service performance indicator information exceeds the corresponding indicator threshold in the preset indicator rule base, and whether each service resource consumption value in each server resource consumption information exceeds the corresponding service resource consumption threshold in the preset service resource consumption rule base; if any indicator value exceeds the corresponding indicator threshold, and / or any service resource consumption value exceeds the corresponding service resource consumption threshold, it is determined that there is a service performance bottleneck in the current test scenario; otherwise, it is determined that there is no service performance bottleneck in the current test scenario.
[0053] Among them, the preset bottleneck rule base may include a preset indicator rule base and a preset service resource consumption rule base. In this embodiment, the preset indicator rule base and the preset service resource consumption rule base may be configured according to the test requirements by setting threshold values, that is, the indicator threshold corresponding to each performance indicator is set in the preset indicator rule base, and the consumption threshold corresponding to each service resource consumption value is set in the preset service resource consumption rule base. Specifically, when it is detected that any indicator value in the service performance indicator information exceeds the corresponding indicator threshold, and / or any service resource consumption value in any server resource consumption information exceeds the corresponding service resource consumption threshold, it can be determined that there is a service performance bottleneck in the current test scenario; if all indicator values in the service performance indicator information do not exceed the corresponding indicator threshold, and all service resource consumption values in all server resource consumption information do not exceed the corresponding service resource consumption threshold, it can be determined that there is no service performance bottleneck in the current test scenario.
[0054] On the basis of the above technical solution, S130 determines the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and test data, which may include: determining the target service performance indicator information and target server resource consumption information corresponding to the next test scenario according to the preset concurrent rule library and the service performance indicator information and server resource consumption information corresponding to the current test scenario, and calculating the performance indicator ratio information and server resource consumption ratio information between the next test scenario and the current test scenario; determining the number of concurrent threads corresponding to the next test scenario according to the performance indicator ratio information, server resource consumption ratio information, preset performance indicator weight information, server resource consumption weight information and the number of concurrent threads corresponding to the current test scenario.
[0055] Among them, the target service performance indicator information corresponding to the next test scenario may refer to the service performance indicator that can be achieved by the planned next test scenario. The target server resource consumption information corresponding to the next test scenario may refer to the resource consumption information that can be consumed by the planned next test scenario. The preset performance indicator weight information refers to the pre-set indicator weight value corresponding to each indicator in the service performance indicator information. The preset server resource parameter weight information refers to the pre-set parameter weight value corresponding to each resource parameter in the server resource parameters. It should be noted that the sum of all indicator weight values and all parameter weight values is 1.
[0056] Specifically, based on the preset concurrent rule base, according to the service performance indicator information and server resource consumption information corresponding to the current test scenario, the target service performance indicator information and target server resource consumption information corresponding to the next test scenario can be determined. According to the service performance indicator information and server resource consumption information of the current test scenario and the target service performance indicator information and target server resource consumption information corresponding to the next test scenario, the ratio of each indicator and each resource consumption ratio between the next test scenario and the current test scenario can be calculated. Exemplarily, if the CPU usage corresponding to the current test scenario is 50%, and the preset concurrent rule base stipulates that the CPU usage of the next test scenario is increased by 20% compared with the CPU usage of the current test scenario, then the target CPU usage corresponding to the next test scenario can be determined to be 70%, so that the resource consumption ratio of the CPU usage can be determined to be 70% / 50%=1.4. If the parameter weight value corresponding to the CPU usage is 70%, and the number of concurrent threads corresponding to the current test scenario is 50, then the number of concurrent threads corresponding to the target CPU usage in the next test scenario can be determined to be: 50×1.4×70%=49. Similarly, the number of concurrent threads corresponding to each indicator in the service performance indicator information and the number of concurrent threads corresponding to each resource parameter in the server resource parameters can be calculated, and then each calculated number of concurrent threads can be added, and the addition result can be determined as the number of concurrent threads corresponding to the next test scenario, so that the number of concurrent threads corresponding to the next test scenario can be automatically calculated to automatically modify the test scenario.
[0057] Embodiment 2
[0058] Figure 3 A flowchart of an interface service performance testing method provided for the second embodiment of the present invention. In addition to the above embodiments, this embodiment can also start a third thread in each press in the press cluster during the concurrent stress test of the current test scenario, and collect press resource consumption information corresponding to each press based on each third thread. On this basis, it is also possible to detect whether there is a stress performance bottleneck in the current test scenario. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0059] See also Figure 3 The interface service performance testing method provided in this embodiment specifically includes the following steps:
[0060] S310, controlling the stress machine cluster to start the first thread of the concurrent thread number corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test.
[0061] S320. During the concurrent stress test of the current test scenario, a third thread is started in each press in the press cluster, and press resource consumption information corresponding to each press is collected based on each third thread.
[0062] The press resource consumption information may include but is not limited to at least one of CPU utilization, memory utilization, disk utilization, network utilization and system load.
[0063] Usually, before performing performance testing on an interface service, you can apply for a larger number of presses to ensure that there are enough presses for concurrent stress testing. However, during concurrent stress testing, some presses in the press cluster may be idle, resulting in a waste of test resources and insufficient presses for performance testing of other interface services.
[0064] Specifically, this embodiment can start a third thread in each press in the press cluster during the concurrent stress testing of each test scenario, and use the third thread to collect the press resource consumption information corresponding to each press, so as to monitor the press resource consumption in real time, so that the number of presses can be adjusted in real time according to the press resource consumption information in the test scenario, thereby improving the utilization rate of press resources.
[0065] Exemplarily, this embodiment can also store the collected resource consumption information of each press in a preset memory to achieve data sharing, and during the concurrent stress testing process of the test scenario, the collected press resource consumption information can also be displayed in real time in the display interface so that the press resource consumption status can be viewed in real time.
[0066] S330, collecting test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detecting whether there is a service performance bottleneck in the current test scenario according to a preset bottleneck rule base and test data.
[0067] S340: When there is no service performance bottleneck in the current test scenario, determine the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and test data.
[0068] S350. According to the preset pressure resource consumption rule library and the resource consumption information of each press machine, detect whether there is a pressure performance bottleneck in the current test scenario. If so, proceed to step S360; if not, proceed to step S370.
[0069] The pressure performance bottleneck may refer to a situation where the pressure machine cluster cannot meet the pressure requirements during the concurrent pressure test. The preset pressure resource consumption rule base may be a rule pre-set according to the pressure requirements and used to determine whether the current pressure machine cluster has a pressure performance bottleneck.
[0070] Specifically, this embodiment can determine whether there is a pressure performance bottleneck in the press cluster in the current test scenario based on the resource consumption information of each press. If so, it indicates that the current press cluster has reached the maximum pressure capacity, and the operation of step S360 can be executed at this time; if not, it indicates that the current press cluster can still apply further pressure, and step S370 can be entered at this time to use the current press cluster to execute the next test scenario and improve the resource utilization of the press.
[0071] Exemplarily, S350 may include: detecting whether each pressure resource consumption value in each press machine resource consumption information exceeds the corresponding pressure resource consumption threshold in the preset pressure resource consumption rule library; if any pressure resource consumption value exceeds the corresponding pressure resource consumption threshold, it is determined that there is a pressure performance bottleneck in the current test scenario.
[0072] Among them, this embodiment can use the method of setting thresholds to configure the consumption threshold corresponding to each pressure resource consumption value in the preset pressure resource consumption rule library according to the pressure requirements. Specifically, when it is detected that any pressure resource consumption value in each press resource consumption information exceeds the corresponding pressure resource consumption threshold, it can be determined that there is a pressure performance bottleneck in the current test scenario. When all pressure resource consumption values in all press resource consumption information do not exceed the corresponding pressure resource consumption threshold, it can be determined that there is no pressure performance bottleneck in the current test scenario. Exemplarily, when the CPU utilization threshold set in the preset pressure resource consumption rule library is 90%, if the CPU utilization in the press resource consumption information is 95%, it can be determined that there is a pressure performance bottleneck in the current press cluster.
[0073] S360. Determine the target number of presses to be added according to the number of concurrent threads corresponding to the current test scenario and the number of concurrent threads corresponding to the next test scenario, add the target number of idle presses to the press cluster, and update the press cluster.
[0074] Specifically, when there is a pressure performance bottleneck in the current test scenario, it is necessary to add a press to the press cluster so that the next test scenario can be executed sequentially. This embodiment can determine the number of concurrent threads added to the next test scenario based on the number of concurrent threads corresponding to the current test scenario and the number of concurrent threads corresponding to the next test scenario, and can determine the target number of presses to be added based on the number of concurrent threads increased and the maximum number of concurrent threads opened by the press. Exemplarily, if the number of concurrent threads corresponding to the current test scenario is 20, the number of concurrent threads corresponding to the next test scenario is 40, and the current press cluster includes 2 presses, then it can be determined that the maximum number of threads opened by each press is 10, and the target number of presses to be added is determined to be 2. By adding the target number of idle presses to the press cluster in the current test scenario, the press cluster is updated so that the concurrent pressure test of the next test scenario can be smoothly performed using the updated press cluster.
[0075] This embodiment can set up a smaller number of presses in the first test scenario, and can adjust the number of presses in real time according to the press resource consumption information in each test scenario, so as to fully utilize the resources of each press in the press cluster and greatly improve the utilization rate of press resources.
[0076] S370, update the next test scenario to the current test scenario, and return to step S310.
[0077] The technical solution of this embodiment detects in real time whether there is a pressure performance bottleneck in the current test scenario based on a preset pressure resource consumption rule library and the collected resource consumption information of each press, and when a pressure performance bottleneck exists, adds a target number of idle presses to the press cluster to ensure that each test scenario can be executed sequentially, and can also avoid idle presses in the press cluster, making full use of the resources of each press, thereby improving the utilization rate of press resources and facilitating the use of limited press resources to complete more performance testing tasks.
[0078] Embodiment 3
[0079] Figure 4 This is a flow chart of a method for testing interface service performance provided by Embodiment 3 of the present invention. This embodiment provides a preferred example based on the above embodiments. Explanations of terms that are the same or corresponding to the above embodiments are not repeated here.
[0080] See also Figure 4 The interface service performance testing method provided in this embodiment specifically includes the following steps:
[0081] S410, check whether the current test scenario is executed for the first time; if so, proceed to step S420; if not, proceed to step S430.
[0082] Specifically, this embodiment can detect whether the current test scenario is the first test scenario in the performance test process before executing the current test scenario. In this embodiment, different test scenarios in different orders have different ways of determining the number of concurrent threads corresponding thereto.
[0083] S420. Determine the number of concurrent threads corresponding to the current test scenario according to preset configuration information, and proceed to step S490.
[0084] Specifically, when the current test scenario is executed for the first time, that is, when the current test scenario is the first test scenario in the performance test process, the initial number of concurrent threads in the preset configuration information can be determined as the number of concurrent threads corresponding to the current test scenario.
[0085] S430, obtaining request data, corresponding response data, server resource consumption information, and press resource consumption information corresponding to the previous test scenario from the preset memory.
[0086] The preset memory may refer to a pre-set memory used to store test data collected during the concurrent stress test of each test scenario.
[0087] Specifically, when the current test scenario is not executed for the first time, it indicates that the concurrent stress test of the previous test scenario has ended. At this time, the request data, corresponding response data, server resource consumption information and stress machine resource consumption information corresponding to the previous test scenario can be obtained from the preset memory.
[0088] S440. Determine whether there is a service performance bottleneck in the previous test scenario based on the request data, corresponding response data, server resource consumption information and preset bottleneck rule library corresponding to the previous test scenario. If so, proceed to step S450; if not, proceed to step S460.
[0089] Specifically, the service performance indicator information corresponding to the previous test scenario can be determined based on the request data and the corresponding response data corresponding to the previous test scenario; based on the preset bottleneck rule library, the service performance indicator information corresponding to the previous test scenario and the server resource consumption information, it can be determined whether there is a service performance bottleneck in the previous test scenario.
[0090] S450. Determine the number of concurrent threads corresponding to the current test scenario as zero, and proceed to step S470.
[0091] Specifically, when there is a service performance bottleneck in the previous test scenario, it indicates that the performance test of the interface service under test can be ended. At this time, there is no need to execute the current test scenario, that is, the number of concurrent threads N corresponding to the current test scenario can be set to zero.
[0092] S460. Determine the number of concurrent threads corresponding to the current test scenario according to the preset concurrent rule library, the service performance indicator information corresponding to the previous test scenario, and the server resource consumption information, and proceed to step S470.
[0093] Specifically, when there is no service performance bottleneck in the previous test scenario, it indicates that the performance test of the interface service under test has not yet ended, that is, it is necessary to continue to execute the concurrent stress test of the current test scenario. At this time, based on the preset concurrent rule library, according to the service performance indicator information and server resource consumption information corresponding to the previous test scenario, the number of concurrent threads corresponding to the current test scenario can be automatically determined, thereby realizing automatic modification and adjustment of the test scenario without manual operation.
[0094] S470, check whether the number of concurrent threads corresponding to the current test scenario is zero, if so, proceed to step S480; if not, proceed to step S490.
[0095] Specifically, this embodiment can determine whether the tested interface service performance test is completed by detecting whether the number of concurrent threads corresponding to the current test scenario is zero.
[0096] S480. Automatically summarize the test data collected during the concurrent stress test of each test scenario, generate a test report, and display the test report on the display interface.
[0097] Specifically, when the number of concurrent threads corresponding to the current test scenario is zero, it indicates that the performance test of the interface service under test is completed. At this time, the collected test data for each test scenario can be automatically summarized, and the generated test report can be displayed on the display interface, making it convenient for users to view the test results, thereby realizing the automation of interface service performance testing and improving testing efficiency.
[0098] S490, controlling the stress machine cluster to start the first thread of the concurrent thread number corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test.
[0099] Specifically, when the number of concurrent threads corresponding to the current test scenario is not zero, it indicates that the performance test of the interface service under test has not been completed. At this time, the stress machine cluster can be controlled to start the first thread of the concurrent thread number corresponding to the current test scenario, so that the server cluster corresponding to the interface service under test can be automatically subjected to concurrent stress testing.
[0100] It should be noted that before S490, it may also include: based on the preset pressure resource consumption rule library and the resource consumption information of each press, detecting whether there is a pressure performance bottleneck in the current test scenario; if so, determining the target number of presses to be added based on the number of concurrent threads corresponding to the current test scenario and the number of concurrent threads corresponding to the previous test scenario, adding the target number of idle presses to the press cluster, and updating the press cluster, and then entering step S490 after updating the press cluster; if not, directly entering step S490 so that the number of presses in the press cluster can be adjusted in real time, thereby improving the utilization of press resources.
[0101] S491. During the concurrent stress test of the current test scenario, based on each opened first thread, collect each request data and the corresponding response data, and store them in a preset memory.
[0102] S492: Based on the second thread started in each server in the server cluster, collect the server resource consumption information corresponding to each server and store it in a preset memory.
[0103] S493. Based on the third thread opened in each press in the press cluster, press resource consumption information corresponding to each press is collected and stored in a preset memory.
[0104] S494. After the concurrent stress test of the current test scenario is completed, the next test scenario is updated to the current test scenario, and the process returns to step S410.
[0105] Specifically, when the running time of the current test scenario is equal to the pre-configured preset running time, and / or the total number of processed transactions of the current test scenario is equal to the pre-configured total number of preset transactions, it indicates that the concurrent stress test of the current test scenario is over. At this time, the next test scenario can be updated to the current test scenario so that the next test scenario can be automatically executed in a loop to improve test efficiency.
[0106] The technical solution of this embodiment can realize automatic adjustment and modification of the test scenario by automatically determining the number of concurrent threads corresponding to the current test scenario before executing the current test scenario, and can automatically perform concurrent stress testing on the server cluster corresponding to the tested interface service when the number of concurrent threads corresponding to the current test scenario is not zero, and can automatically perform stress testing on different test scenarios through automatic cycles, thereby improving test efficiency and test accuracy. Moreover, after the performance test is completed, a test report can be automatically generated, saving time and effort, and no manual operation is required, thereby fully realizing the automation of performance testing and further improving test efficiency.
[0107] The following is an embodiment of the interface service performance testing device provided in an embodiment of the present invention. The device and the interface service performance testing methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the interface service performance testing device, please refer to the embodiment of the above-mentioned interface service performance testing method.
[0108] Embodiment 4
[0109] Figure 5 This is a structural diagram of an interface service performance testing device provided in Example 4 of the present invention. This embodiment is applicable to the situation of performing performance testing on interface services. The device specifically includes: a press cluster control module 510, a service performance bottleneck detection module 520 and a current test scenario update module 530.
[0110] Among them, the stress machine cluster control module 510 is used to control the stress machine cluster to start the first thread of the concurrent thread number corresponding to the current test scenario according to the pre-compiled test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test; the service performance bottleneck detection module 520 is used to collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario according to the preset bottleneck rule library and test data; the current test scenario update module 530 is used to determine the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and test data when there is no service performance bottleneck in the current test scenario, update the next test scenario to the current test scenario, and return to execute the operation of controlling the stress machine cluster to start the first thread of the concurrent thread number corresponding to the current test scenario according to the pre-compiled test script.
[0111] The technical solution of this embodiment automatically collects test data during the concurrent stress test of the current test scenario, and when it is detected that there is no service performance bottleneck in the current test scenario based on the preset bottleneck rule library and the test data, it indicates that the interface service performance test has not yet ended. At this time, the number of concurrent threads corresponding to the next test scenario can be determined based on the collected test data and the preset concurrent rule library, so that the test scenario can be automatically adjusted without manual operation, avoiding test errors caused by manually setting the number of concurrent threads, and each test scenario can also be automatically concurrently stressed in a loop, thereby improving test efficiency and test accuracy.
[0112] Optionally, the device further comprises:
[0113] The test report generation module is used to automatically summarize the test data collected during the concurrent stress test of each test scenario and generate a test report when there is a service performance bottleneck in the current test scenario.
[0114] Optionally, the service performance bottleneck detection module 520 includes a test data collection unit, which is specifically used to:
[0115] Based on each opened first thread, each request data and the corresponding response data are collected; a second thread is opened in each server in the server cluster, and server resource consumption information corresponding to each server is collected based on each second thread.
[0116] Optionally, the service performance bottleneck detection module 520 further includes:
[0117] A service performance indicator information determination unit, used to determine the service performance indicator information corresponding to the tested interface service according to each request data and the corresponding response data;
[0118] The service performance bottleneck detection unit is used to determine whether there is a service performance bottleneck in the current test scenario based on a preset bottleneck rule base, service performance indicator information and each server resource consumption information.
[0119] Optionally, the service performance bottleneck detection unit is specifically used to:
[0120] Check whether each indicator value in the service performance indicator information exceeds the corresponding indicator threshold in the preset indicator rule library, and whether each service resource consumption value in each server resource consumption information exceeds the corresponding service resource consumption threshold in the preset service resource consumption rule library; if any indicator value exceeds the corresponding indicator threshold, and / or any service resource consumption value exceeds the corresponding service resource consumption threshold, it is determined that there is a service performance bottleneck in the current test scenario, otherwise, it is determined that there is no service performance bottleneck in the current test scenario.
[0121] Optionally, the current test scenario updating module 530 includes a concurrent thread number determining unit, which is specifically used to:
[0122] According to the preset concurrent rule library, the service performance indicator information and server resource consumption information corresponding to the current test scenario, determine the target service performance indicator information and target server resource consumption information corresponding to the next test scenario, and calculate the performance indicator ratio information and server resource consumption ratio information between the next test scenario and the current test scenario; according to the performance indicator ratio information, server resource consumption ratio information, preset performance indicator weight information, preset server resource parameter weight information and the number of concurrent threads corresponding to the current test scenario, determine the number of concurrent threads corresponding to the next test scenario.
[0123] Optionally, the test report generation module is specifically used to:
[0124] Compare the number of transactions per second (TPS) corresponding to each test scenario, and determine the maximum processing capacity of the server cluster based on the test data of the test scenario corresponding to the highest TPS; draw a TPS bar chart based on the TPS corresponding to each test scenario; based on the TPS bar chart, link the test data during the concurrent stress test of each test scenario.
[0125] Optionally, the device further comprises:
[0126] The press resource consumption information collection module is used to start a third thread in each press in the press cluster during the concurrent stress test of the current test scenario, and collect press resource consumption information corresponding to each press based on each third thread.
[0127] Optionally, the device further comprises:
[0128] The pressure performance bottleneck detection module is used to detect whether there is a pressure performance bottleneck in the current test scenario according to the preset pressure resource consumption rule base and the resource consumption information of each press, after determining the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule base and test data;
[0129] The press cluster update module is used to determine the target number of presses to be added according to the number of concurrent threads corresponding to the current test scenario and the number of concurrent threads corresponding to the next test scenario, add the target number of idle presses to the press cluster, and update the press cluster.
[0130] Optionally, the pressure performance bottleneck detection module is specifically used to:
[0131] Check whether each pressure resource consumption value in each press machine resource consumption information exceeds the corresponding pressure resource consumption threshold in the preset pressure resource consumption rule library; if any pressure resource consumption value exceeds the corresponding pressure resource consumption threshold, it is determined that there is a pressure performance bottleneck in the current test scenario.
[0132] The interface service performance testing device provided in the embodiment of the present invention can execute the interface service performance testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the interface service performance testing method.
[0133] It is worth noting that in the embodiment of the above-mentioned interface service performance testing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0134] Embodiment 5
[0135] Figure 6 A schematic diagram of the structure of a device provided in Embodiment 5 of the present invention. Figure 6 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The device 12 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.
[0136] like Figure 6 As shown, device 12 is in the form of a general purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects various system components (including system memory 28 and processing unit 16).
[0137] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0138] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.
[0139] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0140] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0141] The device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the device 12, and / or may communicate with any device that enables the device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0142] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the steps of the interface service performance testing method provided in the embodiment of the present invention, the method comprising:
[0143] Control the stress machine cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test;
[0144] Collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario based on the preset bottleneck rule base and test data;
[0145] When there is no service performance bottleneck in the current test scenario, the number of concurrent threads corresponding to the next test scenario is determined according to the preset concurrent rule library and test data, the next test scenario is updated to the current test scenario, and the execution control press cluster is returned to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script.
[0146] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the interface service performance testing method provided by any embodiment of the present invention.
[0147] Embodiment 6
[0148] This embodiment 6 provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the interface service performance testing method according to any embodiment of the present invention are implemented. The method includes:
[0149] Control the stress machine cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test;
[0150] Collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario based on the preset bottleneck rule base and test data;
[0151] When there is no service performance bottleneck in the current test scenario, the number of concurrent threads corresponding to the next test scenario is determined according to the preset concurrent rule library and test data, the next test scenario is updated to the current test scenario, and the execution control press cluster is returned to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script.
[0152] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can 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 (non-exhaustive list) of computer-readable storage media include: 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 this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0153] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals 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 a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0154] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0155] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0156] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0157] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for testing interface service performance, characterized in that: include: Control the stress machine cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test; Collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario according to a preset bottleneck rule library and the test data, wherein the test data includes server resource consumption information corresponding to each server in the server cluster; When there is no service performance bottleneck in the current test scenario, the number of concurrent threads corresponding to the next test scenario is determined according to the preset concurrent rule library and the test data, the next test scenario is updated to the current test scenario, and the operation of controlling the press cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-written test script is returned; The determining the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule base and the test data includes: Determine the target service performance indicator information and target server resource consumption information corresponding to the next test scenario according to the preset concurrent rule library, the service performance indicator information and server resource consumption information corresponding to the current test scenario, and calculate the performance indicator ratio information and server resource consumption ratio information between the next test scenario and the current test scenario; The number of concurrent threads corresponding to the next test scenario is determined based on the performance indicator ratio information, the server resource consumption ratio information, the preset performance indicator weight information, the preset server resource parameter weight information and the number of concurrent threads corresponding to the current test scenario.
2. The method according to claim 1, characterized in that Also includes: When there is a service performance bottleneck in the current test scenario, the test data collected during the concurrent stress test of each test scenario is automatically summarized and a test report is generated.
3. The method according to claim 1, characterized in that: Collect test data during the concurrent stress test of the current test scenario, including: Based on each of the first threads that are opened, collect each request data and the corresponding response data; A second thread is started in each server in the server cluster, and server resource consumption information corresponding to each server is collected based on each second thread.
4. The method according to claim 3, characterized in that According to the preset bottleneck rule base and the test data, detect whether there is a service performance bottleneck in the current test scenario, including: Determine the service performance indicator information corresponding to the tested interface service according to each of the request data and the corresponding response data; According to the preset bottleneck rule base, the service performance indicator information and the resource consumption information of each server, it is determined whether there is a service performance bottleneck in the current test scenario.
5. The method according to claim 4, characterized in that Determining whether there is a service performance bottleneck in the current test scenario according to a preset bottleneck rule base, the service performance indicator information, and each of the server resource consumption information, including: Detecting whether each indicator value in the service performance indicator information exceeds the corresponding indicator threshold in the preset indicator rule library, and whether each service resource consumption value in each server resource consumption information exceeds the corresponding service resource consumption threshold in the preset service resource consumption rule library; If any indicator value exceeds the corresponding indicator threshold, and / or any service resource consumption value exceeds the corresponding service resource consumption threshold, it is determined that there is a service performance bottleneck in the current test scenario; otherwise, it is determined that there is no service performance bottleneck in the current test scenario.
6. The method according to claim 2, characterized in that The test data collected during the concurrent stress test of each test scenario is automatically summarized and a test report is generated, including: Compare the number of transactions per second (TPS) corresponding to each test scenario, and determine the maximum processing capacity of the server cluster based on the test data of the test scenario corresponding to the highest TPS; Draw a TPS bar graph according to the TPS corresponding to each of the test scenarios; Based on the TPS bar chart, the test data during the concurrent stress test of each test scenario is linked.
7. The method according to any one of claims 1 to 6, characterized in that: Also includes: During the concurrent stress test of the current test scenario, a third thread is started in each press in the press cluster, and press resource consumption information corresponding to each press is collected based on each third thread.
8. The method according to claim 7, characterized in that After determining the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and the test data, the method further includes: According to the preset pressure resource consumption rule library and the resource consumption information of each of the pressure machines, detect whether there is a pressure performance bottleneck in the current test scenario; If so, determine the target number of presses to be added according to the number of concurrent threads corresponding to the current test scenario and the number of concurrent threads corresponding to the next test scenario, add the target number of idle presses to the press cluster, and update the press cluster.
9. The method according to claim 8, characterized in that According to the preset pressure resource consumption rule base and the pressure machine resource consumption information, detect whether there is a pressure performance bottleneck in the current test scenario, including: Detecting whether each pressure resource consumption value in each of the pressure machine resource consumption information exceeds a corresponding pressure resource consumption threshold in a preset pressure resource consumption rule library; If any pressure resource consumption value exceeds the corresponding pressure resource consumption threshold, it is determined that there is a pressure performance bottleneck in the current test scenario.
10. An interface service performance testing device, characterized in that: include: A press cluster control module, used to control the press cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to a pre-written test script, so as to perform concurrent stress testing on the server cluster corresponding to the interface service under test; A service performance bottleneck detection module is used to collect test data during the concurrent stress test of the current test scenario, and after the concurrent stress test of the current test scenario is completed, detect whether there is a service performance bottleneck in the current test scenario according to a preset bottleneck rule base and the test data, wherein the test data includes server resource consumption information corresponding to each server in the server cluster; The current test scenario update module is used to determine the number of concurrent threads corresponding to the next test scenario according to the preset concurrent rule library and the test data when there is no service performance bottleneck in the current test scenario, update the next test scenario to the current test scenario, and return to execute the operation of controlling the press cluster to start the first thread of the number of concurrent threads corresponding to the current test scenario according to the pre-compiled test script; The current test scenario update module includes a concurrent thread number determination unit, which is specifically used to: Determine the target service performance indicator information and target server resource consumption information corresponding to the next test scenario according to the preset concurrent rule library, the service performance indicator information and server resource consumption information corresponding to the current test scenario, and calculate the performance indicator ratio information and server resource consumption ratio information between the next test scenario and the current test scenario; The number of concurrent threads corresponding to the next test scenario is determined based on the performance indicator ratio information, the server resource consumption ratio information, the preset performance indicator weight information, the preset server resource parameter weight information and the number of concurrent threads corresponding to the current test scenario.
11. A device, characterized in that: The device comprises: 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 steps of the interface service performance testing method as described in any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the interface service performance testing method as described in any one of claims 1-9 are implemented.
