Website performance test method and device, equipment and storage medium

Through automated resource statistics and data analysis, performance test plans are automatically generated, which solves the problems of low efficiency and large difference in results of traditional performance testing methods, and achieves more accurate and efficient website performance testing.

CN119311537APending Publication Date: 2025-01-14GUANGZHOU YINGFENG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411181525.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Traditional performance testing methods rely on manual writing of test plans and cannot fully cover all possible requests in the actual business, resulting in large differences in the test results and low testing efficiency.

Method used

Through automated resource statistics, the target test interface is accurately determined, and through data analysis of the interface data corresponding to the target test interface, the test environment parameters and test case model are determined, thereby automatically generating a test plan and avoiding manual intervention.

Benefits of technology

It reduces the difference between test results and actual business performance, improves website performance testing efficiency, and achieves more accurate and efficient performance testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311537A_ABST
    Figure CN119311537A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a website performance test method and device, equipment and a storage medium, and the method comprises the steps: obtaining website access data, the website access data comprises the request time, request frequency, resource data and resource consumption of an interface corresponding to each operation event when a client accesses a website; calculating the request frequency according to the request time and the request times, and calculating the resource consumption proportion according to the resource consumption; determining a target test interface according to the request frequency and the resource consumption proportion of each request interface, determining the interface type of the target test interface, and determining test environment parameters according to the request frequency and the resource consumption proportion of the target test interface; and calling a test case model matched with the test type, and performing a website performance test based on the test environment parameters and the test case model to obtain a test result. The test plan can be automatically generated, manual intervention is avoided, the difference between the test result and the actual service performance is reduced, and the website performance test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a website performance testing method, device, equipment and storage medium. Background Art

[0002] Performance testing is a type of software testing that aims to evaluate the response time, throughput, resource utilization, and stability of a system under specific load, stress, or resource constraints. This testing method tests and evaluates the performance of a software system by simulating actual user operations. The purpose of performance testing is to discover the performance bottlenecks of a software system when processing large amounts of data or concurrent requests, and to optimize the response time and stability of the system. Through performance testing, performance bottlenecks, resource contention, and other potential problems in the system can be identified and resolved, ensuring that the system can still operate normally and provide a satisfactory user experience under high load and high concurrency.

[0003] Traditional performance testing methods are mainly completed by manually writing test plans and manually monitoring system resources. However, since the test plan is tested by manually selected specific interfaces, it is impossible to fully cover all possible requests in actual business, resulting in a large difference between the test results and the actual business performance. The process of adjusting the test plan based on the difference is also completely dependent on manual completion, which affects the test efficiency. Summary of the invention

[0004] The embodiments of the present application provide a website performance testing method, apparatus, equipment and storage medium, which solve the problem of large differences between test results and actual business and low test efficiency caused by personnel writing test plans during performance testing. The target test interface is accurately determined through automated resource statistics, and the test environment parameters and test case model are determined by performing data analysis on the interface data corresponding to the target test interface, thereby automatically generating a test plan, avoiding manual intervention, reducing the difference between test results and actual business performance, and improving the efficiency of website performance testing.

[0005] In a first aspect, an embodiment of the present application provides a website performance testing method, comprising:

[0006] Acquire website access data, wherein the website access data includes request time, request times, resource data, and resource consumption of a request interface corresponding to each operation event when a client accesses a website;

[0007] Calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption;

[0008] Determine a target test interface among the multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, determine the interface type of the target test interface, and determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface;

[0009] A test case model matching the test type is called, and test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result.

[0010] Optionally, determining a target test interface from a plurality of request interfaces according to a request frequency and a resource consumption ratio of each request interface includes:

[0011] Compare the request frequency of each request interface with a preset first frequency threshold and a second frequency threshold respectively, to obtain a first comparison result, wherein the first frequency threshold is greater than the second frequency threshold;

[0012] Compare the resource consumption ratio of each interface with the preset first consumption ratio and the second consumption ratio respectively, to obtain a second comparison result, wherein the first consumption ratio is greater than the second consumption ratio;

[0013] A target test interface is determined among the plurality of request interfaces according to the first comparison result and the second comparison result.

[0014] Optionally, determining a target test interface from the plurality of request interfaces according to the first comparison result and the second comparison result includes:

[0015] Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is greater than a first consumption ratio as a target test interface; and

[0016] Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is less than a second consumption ratio as a target test interface; and

[0017] According to the first comparison result and the second comparison result, a request interface whose request frequency is less than a second frequency threshold and whose resource consumption ratio is greater than a first consumption ratio is determined as a target test interface.

[0018] Optionally, determining the test environment parameters according to the request frequency and resource consumption ratio of the target test interface includes:

[0019] Determine, according to a preset level mapping table, the frequency level to which the request frequency of the target test interface belongs, and the consumption level to which the resource consumption ratio of the target test interface belongs;

[0020] The corresponding number of database connections is determined according to the frequency level, and the corresponding number of CPU cores is determined according to the consumption level.

[0021] Optionally, there are multiple target test interfaces, and determining the interface type of the target test interface includes:

[0022] A common interface identifier of each target test interface is determined according to one or more interface identifiers of each target test interface, and an interface type is determined according to the common interface identifier.

[0023] Optionally, after the test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result, the method further includes:

[0024] Perform data analysis based on the response time, CPU index and memory index in the test results to determine the performance bottleneck and the adjustment strategy matching the performance bottleneck;

[0025] The resource configuration of the target test interface is adjusted according to the adjustment strategy.

[0026] Optionally, after calling the test case model matching the test type, the method further includes:

[0027] Obtain the highest historical concurrent number of each target test interface in the historical database, calculate the average concurrent number according to each historical highest concurrent number, and modify the default concurrent number of the test case model according to the average concurrent number;

[0028] Accordingly, the step of generating test information based on the test environment parameters and the test case model to perform a website performance test and obtain a test result includes:

[0029] Test information is generated based on the environmental parameters and the modified test case model to perform website performance testing to obtain test results.

[0030] In a second aspect, an embodiment of the present application provides a website performance testing device, including:

[0031] A data acquisition module, used to acquire website access data, wherein the website access data includes the request time, request times, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website;

[0032] A calculation module, used to calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption;

[0033] A target test interface determination module, used to determine a target test interface among a plurality of request interfaces according to the request frequency and resource consumption ratio of each request interface, and to determine the interface type of the target test interface;

[0034] A test environment parameter determination module, used to determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface;

[0035] The performance testing module is used to call a test case model that matches the test type, generate test information based on the test environment parameters and the test case model, perform website performance testing, and obtain test results.

[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the website performance testing method described in the first aspect.

[0037] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the website performance testing method as described in the first aspect.

[0038] The embodiment of the present application obtains website access data, which includes the request time, request number, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website; the request frequency of each request interface is calculated according to the request time and request number, and the resource consumption ratio of each request interface is calculated according to the resource consumption; the target test interface is determined in multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, and the interface type of the target test interface is determined, and the test environment parameters are determined according to the request frequency and resource consumption ratio of the target test interface; the test case model matching the test type is called, and the test information is generated based on the test environment parameters and the test case model to perform website performance testing to obtain test results. The target test interface can be accurately determined through automated resource statistics, and the test environment parameters and test case model can be determined by data analysis of the interface data corresponding to the target test interface, thereby automatically generating a test plan, avoiding manual intervention, reducing the difference between the test results and the actual business performance, and improving the efficiency of website performance testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of a website performance testing method provided by an embodiment of the present application;

[0040] Figure 2It is a resource data line chart based on test results provided in an embodiment of the present application;

[0041] Figure 3 is a flow chart of a method for determining a target test interface provided by an embodiment of the present application;

[0042] Figure 4 is a flow chart of a method for determining test environment parameters provided in an embodiment of the present application;

[0043] Figure 5 is a level mapping table provided in an embodiment of the present application;

[0044] Figure 6 It is a flow chart of a parameter adjustment method of a test case model provided in an embodiment of the present application;

[0045] Figure 7 It is a structural schematic diagram of a website performance testing device provided in an embodiment of the present application;

[0046] Figure 8 It is a structural diagram of a website performance testing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0049] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0050] The website performance testing method, device, equipment and medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0051] The website performance testing method provided in the embodiment of the present application is applied to the scenario of testing the performance of various websites, such as the payment function and product search function in the shopping website. Based on the above application scenario, it can be understood that the execution subject of this solution can be a terminal device with performance testing function, such as a mobile phone, a laptop computer, a tablet computer, etc.

[0052] Figure 1 is a flow chart of a website performance testing method provided by an embodiment of the present application, such as Figure 1 As shown, including:

[0053] Step S101: Acquire website access data, wherein the website access data includes the request time, request times, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website.

[0054] In one embodiment, website access data is used to represent data generated when a client accesses a website, such as the function accessed, the time of access, and the number of users accessing the website. The website access data may be access data of one or more websites. The request time of the request interface corresponding to each operation event when the client accesses the website refers to the access time of the interface for accessing each function in the website by the client, such as the access time of the product search interface corresponding to the product search in the shopping website by the client, and the number of requests refers to the number of accesses to the product search interface. Resource data is used to represent the operation data of each access interface, such as the search data generated in the product search interface. Resource consumption is used to represent the CPU resources, memory resources, network resources, etc. of the server consumed in the process of accessing each request interface of the website.

[0055] Step S102: Calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption.

[0056] Among them, the request frequency is used to indicate the number of times the request interface is accessed within a period of time. The resource consumption ratio of each interface is the ratio of the resources consumed by each request interface to the total resource consumption of the server. In one embodiment, the request interface accessed within the preset time and the number of times accessed are determined according to the request time, and the request frequency of each request interface is calculated according to the preset time and the number of accesses of each request interface within the preset time. Exemplarily, the request times of the login interface are 10:00, 10:03, and 10:05, respectively, and the login interface is accessed 100 times at 10:00, 60 times at 10:03, and 50 times at 10:05. The preset time is the time period of 10:00-10:05, and the request frequency within the preset time can be calculated as 42 times / second. Calculate the total resource consumption of each request interface in the website, and calculate the resource consumption ratio of each request interface according to the resource consumption of each interface and the total resource consumption.

[0057] Step S103, determining a target test interface among the multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, determining the interface type of the target test interface, and determining test environment parameters according to the request frequency and resource consumption ratio of the target test interface.

[0058] Among them, the target test interface can be the test function interface to be tested in the website. The test environment parameters are evaluation criteria for measuring system performance, mainly including hardware configuration, network environment, database settings, operating system environment and application deployment specifications. The setting of these parameters can ensure the reliability and accuracy of the test environment, so as to effectively evaluate the performance of the system. In one embodiment, the request interface with the highest request frequency and the highest resource consumption ratio in each request interface is determined as the target test interface, and the interface type is determined according to the interface function of the target test interface. The test environment parameters are determined according to the request frequency and resource consumption ratio of the target test interface, the first parameter value is calculated according to the preset first weight value and the request frequency, the second parameter value is calculated according to the preset second weight value and the resource consumption ratio, and the first parameter value and the second parameter value are summed to obtain the total parameter value, and the test environment parameters corresponding to the total parameter value are determined according to the preset environment parameter mapping table.

[0059] Step S104: calling a test case model that matches the test type, generating test information based on the test environment parameters and the test case model, performing a website performance test to obtain a test result.

[0060] The test case model is a model used to describe the software testing process, which details how to perform software testing. In one embodiment, different test case models are configured in advance according to the functions of different request interfaces or based on the types of different websites, and the mapping relationship between the test type and the test case model is stored. After determining the interface type of the target test interface, the test case model that matches the interface type of the target test interface is called according to the stored mapping relationship between the test type and the test case model, thereby generating test information based on the test environment parameters and the test case model. The test information may include test tools, input data, test steps, expected results, etc., and the performance, reliability and stability of the system can be evaluated by analyzing the test information to obtain the final test results.

[0061] Figure 2 This is a resource data line chart based on test results provided by an embodiment of the present application, such as Figure 2 As shown, the test results include the usage of resources such as CPU, memory, and disk, and the usage is displayed through a line graph, which can intuitively understand the changes in each resource data, and can predict the time when performance bottlenecks may occur in each resource data based on the resource data line graph, thereby reducing the probability of performance bottlenecks.

[0062] The above method obtains website access data, which includes the request time, request times, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website; calculates the request frequency of each request interface according to the request time and request times, and calculates the resource consumption ratio of each request interface according to the resource consumption; determines the target test interface among multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, and determines the interface type of the target test interface, and determines the test environment parameters according to the request frequency and resource consumption ratio of the target test interface; calls the test case model matching the test type, generates test information based on the test environment parameters and the test case model to perform website performance testing to obtain test results. The target test interface can be accurately determined through automated resource statistics, and the test environment parameters and test case model can be determined by data analysis of the interface data corresponding to the target test interface, thereby automatically generating a test plan, avoiding manual intervention, reducing the difference between the test results and the actual business performance, and improving the efficiency of website performance testing.

[0063] In one embodiment, the number of the target test interfaces is multiple, and determining the interface type of the target test interface includes:

[0064] A common interface identifier of each target test interface is determined according to one or more interface identifiers of each target test interface, and an interface type is determined according to the common interface identifier.

[0065] In the case where there are multiple target test interfaces, the interface identifier of each target test interface is determined separately. A target test interface may have one or more interface identifiers, and the interface identifier is used to identify the website to which the test interface belongs and the function of the interface. The public interface identifier is an identifier representing the same website. Exemplary, if the target test interface is a login interface and a product search interface, the game website includes a login interface, and the shopping website also includes a login interface and a product search interface. The interface identifier representing the game website is an A identifier, the interface identifier representing the login function is an 1 identifier, the interface identifier representing the shopping website is a B identifier, and the interface identifier representing the product search interface is a 2 identifier. Therefore, the interface identifier representing the login interface of the game website is an A1 identifier, the interface identifier representing the login interface of the shopping website is a B1 identifier, and the interface identifier representing the product search interface of the shopping website is a B2 identifier, wherein the B1 identifier and the B2 identifier are public interface identifiers, and the interface type corresponding to the public interface identifier is determined according to the preset mapping relationship table of interface identifiers.

[0066] As described above, by determining the common interface identifier of each target test interface according to one or more interface identifiers of each target test interface, and determining the interface type according to the common interface identifier, a unified interface type can be quickly determined among multiple target test interfaces, thereby improving the performance testing efficiency of each target test interface.

[0067] In one embodiment, after the test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result, the method further includes:

[0068] Perform data analysis based on the response time, CPU index and memory index in the test results to determine the performance bottleneck and the adjustment strategy matching the performance bottleneck;

[0069] The resource configuration of the target test interface is adjusted according to the adjustment strategy.

[0070] Among them, response time is an important performance test indicator, which measures the system's response speed to user requests. Response time includes the time required for the entire process from the user initiating a request from the client to the client receiving the response returned by the server. This process may involve the processing time of multiple middleware, such as servers, databases, etc. CPU indicators can include CPU utilization, CPU idle time, etc. Memory indicators can include memory usage, memory capacity, and memory speed. Memory usage refers to the proportion of memory currently in use in the system to total memory. This memory usage can facilitate understanding of the current usage of system memory. Memory capacity refers to the size of available memory in the computer. This indicator is directly related to the amount of data that the system can handle and its multi-tasking capabilities. Memory speed indicates how fast the memory is in data transmission and processing. This indicator directly affects the response speed and performance of the system. Performance bottlenecks can be factors or problems that limit server performance or cause performance degradation, including CPU bottlenecks, memory bottlenecks, and network bottlenecks. By analyzing the response time, CPU indicators, and memory indicators in the test results, determine whether there is a performance bottleneck. Exemplarily, the response time, CPU index and memory index are compared with the dependent performance judgment thresholds respectively. If any value of the response time, CPU index and memory index exceeds the corresponding performance judgment threshold, it can be determined that there is a performance bottleneck, and the specific performance bottleneck type is determined according to the specific abnormal value. If the memory index exceeds the set memory index value, the memory index is determined to be abnormal, and the performance bottleneck is determined to be a memory bottleneck. And the adjustment strategy of the memory bottleneck is determined based on the historical adjustment records. If it is detected that the number of database connections is insufficient, the size of the database connection pool is automatically increased according to the content bottleneck adjustment strategy. In one embodiment, the detected performance bottleneck can be adjusted and the performance test can be re-executed.

[0071] In the above, data analysis is performed based on the response time, CPU indicators, and memory indicators in the test results to determine the performance bottleneck and the adjustment strategy that matches the performance bottleneck, and the resource configuration of the target test interface is adjusted according to the adjustment strategy. The test results can be automatically analyzed and the performance bottleneck conditions obtained from the analysis can be automatically adjusted to avoid affecting the normal use of the target test interface with performance bottlenecks, thereby improving the user experience.

[0072] Figure 3 is a flow chart of a method for determining a target test interface provided by an embodiment of the present application, such as Figure 3 As shown, including:

[0073] Step S301: Compare the request frequency of each request interface with a preset first frequency threshold and a preset second frequency threshold respectively to obtain a first comparison result, wherein the first frequency threshold is greater than the second frequency threshold.

[0074] The first frequency threshold may be a higher request frequency value, the second frequency threshold may be a lower request frequency value, and the first frequency threshold is greater than the second frequency threshold. In one embodiment, the request frequency of each request interface is compared with the first frequency threshold and the second frequency threshold, respectively. If the request frequency is greater than the first frequency threshold, the request interface is determined to be a high-frequency interface, and if the request frequency is less than the second frequency threshold, the request interface is determined to be a low-frequency interface.

[0075] Step S302: Compare the resource consumption ratio of each interface with the preset first consumption ratio and second consumption ratio respectively to obtain a second comparison result, wherein the first consumption ratio is greater than the second consumption ratio.

[0076] The first consumption ratio may be a higher consumption ratio value, the second consumption ratio may be a lower consumption ratio value, and the first consumption ratio is greater than the second consumption ratio. In one embodiment, the resource consumption ratio of each request interface is compared with the first consumption ratio and the second consumption ratio respectively. If the resource consumption ratio is greater than the first consumption ratio, the request interface is determined to be a high resource consumption interface, and if the resource consumption ratio is less than the second consumption ratio, the request interface is determined to be a low resource consumption interface.

[0077] Step S303: Determine a target test interface from the plurality of request interfaces according to the first comparison result and the second comparison result.

[0078] In one embodiment, the high-frequency interface is determined as the target test interface according to the first comparison result, and the high-resource consumption interface is determined as the target test interface according to the second comparison result.

[0079] In the above, the request frequency of each request interface is compared with the preset first frequency threshold and the second frequency threshold to obtain a first comparison result; the resource consumption ratio of each interface is compared with the preset first consumption ratio and the second consumption ratio to obtain a second comparison result; and the target test interface is determined from multiple request interfaces according to the first comparison result and the second comparison result. The target test interface with the highest probability of performance bottleneck can be quickly and accurately determined, and performance testing can be performed based on actual business requests, thereby improving the detection efficiency and accuracy of performance bottlenecks.

[0080] In one embodiment, determining a target test interface from the plurality of request interfaces according to the first comparison result and the second comparison result includes:

[0081] Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is greater than a first consumption ratio as a target test interface; and

[0082] Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is less than a second consumption ratio as a target test interface; and

[0083] According to the first comparison result and the second comparison result, a request interface whose request frequency is less than a second frequency threshold and whose resource consumption ratio is greater than a first consumption ratio is determined as a target test interface.

[0084] Exemplarily, if the request frequency is greater than the first frequency threshold, the request interface is determined to be a high-frequency interface, and if the request frequency is less than the second frequency threshold, the request interface is determined to be a low-frequency interface. If the resource consumption ratio is greater than the first consumption ratio, the request interface is determined to be a high-resource consumption interface, and if the resource consumption ratio is less than the second consumption ratio, the request interface is determined to be a low-resource consumption interface. Since the probability of high request frequency and high resource consumption causing performance bottlenecks is relatively high, an interface that is both a high-frequency interface and a high-resource consumption interface can be determined as the first target test interface. In addition, since under normal circumstances, a high request frequency will correspondingly lead to an increase in resource consumption frequency, an interface that is both a high-frequency interface and a low-resource consumption interface may have an abnormal situation, and an interface that is both a high-frequency interface and a low-resource consumption interface can be determined as the second target test interface, and an interface that is both a low-frequency interface and a high-resource consumption interface can be determined as the third target test interface.

[0085] In the above, based on the first comparison result and the second comparison result, the target test interface with high frequency and high resource consumption, the target test interface with high frequency and low resource consumption, and the target test interface with low frequency and high resource consumption that may have performance bottlenecks are quickly and accurately determined. The target test interface can be determined based on actual business requests, which improves the detection efficiency and accuracy of performance bottlenecks.

[0086] Figure 4 is a flow chart of a method for determining test environment parameters provided in an embodiment of the present application, such as Figure 4 As shown, including:

[0087] Step S401: Determine, according to a preset level mapping table, the frequency level to which the request frequency of the target test interface belongs, and the consumption level to which the resource consumption ratio of the target test interface belongs.

[0088] Step S402: Determine the corresponding number of database connections according to the frequency level, and determine the corresponding number of CPU cores according to the consumption level.

[0089] The number of database connections refers to the number of connections that the database server can handle simultaneously at a given time. Each database connection represents a communication channel with the database server, which can be requests from different applications, users, or processes. The number of CPU cores refers to the number of computing units inside the processor, also known as the number of physical cores or cores.

[0090] Figure 5 This is a level mapping table provided in the embodiment of the present application. After determining the request frequency and resource consumption ratio of the target test interface, by querying Figure 5 The level mapping table shown determines the frequency level to which the request frequency belongs and the consumption level to which the resource consumption ratio belongs. For example, if the request frequency is 60 times / second, the frequency level is level 3, and if the resource consumption ratio is 55%, the consumption level is level 2. The number of CPU cores corresponding to the consumption level and the number of database connections corresponding to the frequency level are determined based on the consumption level, the frequency level, and the historical resource configuration information.

[0091] In the above, the frequency level of the request frequency of the target test interface and the consumption level of the resource consumption ratio of the target test interface are determined according to the preset level mapping table; the corresponding number of database connections is determined according to the frequency level, and the corresponding number of CPU cores is determined according to the consumption level. The test environment parameters can be determined according to the actual business data, which can reduce the difference between the test results and the actual business, and improve the accuracy of the test.

[0092] Figure 6 is a flow chart of a parameter adjustment method for a test case model provided in an embodiment of the present application, such as Figure 6 As shown, including:

[0093] Step S601: Acquire website access data, wherein the website access data includes the request time, request times, resource data, and resource consumption of the request interface corresponding to each operation event when the client accesses the website.

[0094] Step S602: Calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption.

[0095] Step S603, determine a target test interface among the multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, determine the interface type of the target test interface, and determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface.

[0096] Step S604, call the test case model that matches the test type, obtain the historical maximum concurrency number of each target test interface in the historical database, calculate the average concurrency number based on the historical maximum concurrency number, and modify the default concurrency number of the test case model based on the average concurrency number.

[0097] Step S605: Generate test information based on the environmental parameters and the modified test case model to perform website performance testing to obtain test results.

[0098] Among them, the maximum concurrency refers to the ability of the system to process many requests in parallel at the same time. During the performance test, it is necessary to pre-set the appropriate concurrency. In one embodiment, the test case model includes a concurrency parameter. In order to make the concurrency parameter in the test case model more in line with the actual business scenario, the historical maximum concurrency of each target test interface is obtained in the historical database, and the average concurrency is calculated based on the historical maximum concurrency. The default concurrency in the test case model is modified to the average concurrency. After the concurrency modification is completed, the test information is generated based on the modified test case model to perform website performance testing to obtain test results.

[0099] Figure 7 is a schematic diagram of the structure of a website performance testing device provided in an embodiment of the present application, such as Figure 7 As shown, including:

[0100] The data acquisition module 71 is used to acquire website access data, wherein the website access data includes the request time, request times, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website;

[0101] A calculation module 72, configured to calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption;

[0102] A target test interface determination module 73, configured to determine a target test interface from a plurality of request interfaces according to a request frequency and a resource consumption ratio of each request interface, and to determine an interface type of the target test interface;

[0103] A test environment parameter determination module 74, configured to determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface;

[0104] The performance testing module 75 is used to call the test case model that matches the test type, generate test information based on the test environment parameters and the test case model, perform website performance testing, and obtain test results.

[0105] The embodiment of the present application obtains website access data, which includes the request time, request number, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website; the request frequency of each request interface is calculated according to the request time and request number, and the resource consumption ratio of each request interface is calculated according to the resource consumption; the target test interface is determined in multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, and the interface type of the target test interface is determined, and the test environment parameters are determined according to the request frequency and resource consumption ratio of the target test interface; the test case model matching the test type is called, and the test information is generated based on the test environment parameters and the test case model to perform website performance testing to obtain test results. The target test interface can be accurately determined through automated resource statistics, and the test environment parameters and test case model can be determined by data analysis of the interface data corresponding to the target test interface, thereby automatically generating a test plan, avoiding manual intervention, reducing the difference between the test results and the actual business performance, and improving the efficiency of website performance testing.

[0106] In a possible embodiment, the target test interface determination module 73 is used to:

[0107] Compare the request frequency of each request interface with a preset first frequency threshold and a second frequency threshold respectively, to obtain a first comparison result, wherein the first frequency threshold is greater than the second frequency threshold;

[0108] Compare the resource consumption ratio of each interface with the preset first consumption ratio and the second consumption ratio respectively, to obtain a second comparison result, wherein the first consumption ratio is greater than the second consumption ratio;

[0109] A target test interface is determined among the plurality of request interfaces according to the first comparison result and the second comparison result.

[0110] In a possible embodiment, the target test interface determination module 73 is used to:

[0111] Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is greater than a first consumption ratio as a target test interface; and

[0112] According to the first comparison result and the second comparison result, determine that the request interface whose request frequency is greater than the first frequency threshold and whose resource consumption ratio is less than the second consumption ratio is the target test interface; and, according to the first comparison result and the second comparison result, determine that the request interface whose request frequency is less than the second frequency threshold and whose resource consumption ratio is greater than the first consumption ratio is the target test interface.

[0113] In a possible embodiment, the test environment parameter determination module 74 is used to:

[0114] Determine, according to a preset level mapping table, the frequency level to which the request frequency of the target test interface belongs, and the consumption level to which the resource consumption ratio of the target test interface belongs;

[0115] The corresponding number of database connections is determined according to the frequency level, and the corresponding number of CPU cores is determined according to the consumption level.

[0116] In a possible embodiment, the target test interface determination module 73 is used to:

[0117] A common interface identifier of each target test interface is determined according to one or more interface identifiers of each target test interface, and an interface type is determined according to the common interface identifier.

[0118] In a possible embodiment, the website performance testing device further includes a resource configuration adjustment module, and the resource configuration adjustment module is used to:

[0119] Perform data analysis based on the response time, CPU index and memory index in the test results to determine the performance bottleneck and the adjustment strategy matching the performance bottleneck;

[0120] The resource configuration of the target test interface is adjusted according to the adjustment strategy.

[0121] In a possible embodiment, the website performance testing device further includes a model parameter modification module, and the model parameter modification module is used to:

[0122] The historical highest concurrent number of each target test interface is obtained in the historical database, the average concurrent number is calculated according to each historical highest concurrent number, and the default concurrent number of the test case model is modified according to the average concurrent number.

[0123] The performance testing module 75 is used to generate test information based on the environmental parameters and the modified test case model to perform website performance testing to obtain test results.

[0124] An embodiment of the present application also provides an electronic device, which can integrate a website performance testing device provided in an embodiment of the present application. Figure 8 Schematic diagram of a website performance testing device provided by an embodiment of the present application. Figure 8The website performance testing device includes: an input device 83, an output device 84, a memory 82 and one or more processors 81; the memory 82 is used to store one or more programs; when one or more programs are executed by one or more processors 81, the one or more processors 81 implement the website performance testing method provided in the above embodiment. The input device 83, the output device 84, the memory 82 and the processor 81 can be connected by a bus or other means. Figure 8 The example of connecting through bus is taken in the following.

[0125] The memory 82, as a computing device readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the website performance testing method provided in any embodiment of the present application. The memory 82 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the device, etc. In addition, the memory 82 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 82 may further include a memory remotely arranged relative to the processor 81, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The input device 83 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 84 may include a display device such as a display screen.

[0127] The processor 81 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 82, that is, implements the above-mentioned website performance testing method.

[0128] The website performance testing apparatus, device and computer provided above can be used to execute the website performance testing method provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0129] The embodiment of the present application also provides a storage medium storing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to perform the website performance testing method provided in the above embodiment. The website performance testing method includes:

[0130] Acquire website access data, wherein the website access data includes request time, request times, resource data, and resource consumption of a request interface corresponding to each operation event when a client accesses a website;

[0131] Calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption;

[0132] Determine a target test interface among the multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, determine the interface type of the target test interface, and determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface;

[0133] A test case model matching the test type is called, and test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result.

[0134] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0135] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the website performance testing method described above, can also execute related operations in the website performance testing method provided in any embodiment of the present application.

[0136] The website performance testing apparatus, device and storage medium provided in the above embodiments can execute the website performance testing method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the website performance testing method provided in any embodiment of the present application.

[0137] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

Claims

1. A website performance testing method, characterized in that: include: Acquire website access data, wherein the website access data includes request time, request times, resource data, and resource consumption of a request interface corresponding to each operation event when a client accesses a website; Calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption; Determine a target test interface among the multiple request interfaces according to the request frequency and resource consumption ratio of each request interface, determine the interface type of the target test interface, and determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface; A test case model matching the test type is called, and test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result.

2. The website performance testing method according to claim 1, characterized in that: The step of determining a target test interface from a plurality of request interfaces according to the request frequency and resource consumption ratio of each request interface includes: Compare the request frequency of each request interface with a preset first frequency threshold and a second frequency threshold respectively, to obtain a first comparison result, wherein the first frequency threshold is greater than the second frequency threshold; Compare the resource consumption ratio of each interface with the preset first consumption ratio and the second consumption ratio respectively, to obtain a second comparison result, wherein the first consumption ratio is greater than the second consumption ratio; A target test interface is determined among the plurality of request interfaces according to the first comparison result and the second comparison result.

3. The website performance testing method according to claim 2, characterized in that: Determining a target test interface from the plurality of request interfaces according to the first comparison result and the second comparison result includes: Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is greater than a first consumption ratio as a target test interface; and Determine, according to the first comparison result and the second comparison result, a request interface whose request frequency is greater than a first frequency threshold and whose resource consumption ratio is less than a second consumption ratio as a target test interface; and According to the first comparison result and the second comparison result, a request interface whose request frequency is less than a second frequency threshold and whose resource consumption ratio is greater than a first consumption ratio is determined as a target test interface.

4. The website performance testing method according to claim 1, characterized in that: The determining of the test environment parameters according to the request frequency and resource consumption ratio of the target test interface includes: Determine, according to a preset level mapping table, the frequency level to which the request frequency of the target test interface belongs, and the consumption level to which the resource consumption ratio of the target test interface belongs; The corresponding number of database connections is determined according to the frequency level, and the corresponding number of CPU cores is determined according to the consumption level.

5. The website performance testing method according to claim 1, characterized in that: The number of the target test interfaces is multiple, and determining the interface type of the target test interface includes: A common interface identifier of each target test interface is determined according to one or more interface identifiers of each target test interface, and an interface type is determined according to the common interface identifier.

6. The website performance testing method according to claim 1, characterized in that: After the test information is generated based on the test environment parameters and the test case model to perform a website performance test to obtain a test result, the method further includes: Perform data analysis based on the response time, CPU index and memory index in the test results to determine the performance bottleneck and the adjustment strategy matching the performance bottleneck; The resource configuration of the target test interface is adjusted according to the adjustment strategy.

7. The website performance testing method according to claim 1, characterized in that: After calling the test case model matching the test type, the method further includes: Obtain the highest historical concurrent number of each target test interface in the historical database, calculate the average concurrent number according to each historical highest concurrent number, and modify the default concurrent number of the test case model according to the average concurrent number; Accordingly, the step of generating test information based on the test environment parameters and the test case model to perform a website performance test and obtain a test result includes: Test information is generated based on the environmental parameters and the modified test case model to perform website performance testing to obtain test results.

8. A website performance testing device, characterized in that: include: A data acquisition module, used to acquire website access data, wherein the website access data includes the request time, request times, resource data and resource consumption of the request interface corresponding to each operation event when the client accesses the website; A calculation module, used to calculate the request frequency of each request interface according to the request time and the number of requests, and calculate the resource consumption ratio of each request interface according to the resource consumption; A target test interface determination module, used to determine a target test interface among a plurality of request interfaces according to the request frequency and resource consumption ratio of each request interface, and to determine the interface type of the target test interface; A test environment parameter determination module, used to determine the test environment parameters according to the request frequency and resource consumption ratio of the target test interface; The performance testing module is used to call a test case model that matches the test type, generate test information based on the test environment parameters and the test case model, perform website performance testing, and obtain test results.

9. An electronic device, comprising: 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 website performance testing method as described in any one of claims 1-7.

10. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the website performance testing method according to any one of claims 1 to 7 when executed by a computer processor.