Pressure testing method and device, storage medium and computer equipment
By introducing traffic models and performance evaluations into stress testing, the optimal stress machine cluster is determined, solving the inefficiency problem caused by tool and environment switching in existing technologies and achieving more efficient stress testing.
Patent Information
- Application Number
- CN202511778877.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
Existing stress testing methods require frequent switching between different tools and environments, resulting in operational gaps and low efficiency.
By introducing a pre-created traffic model, traffic is recorded on the target interface to evaluate the performance of each stress machine cluster. The optimal stress machine cluster is determined by combining performance indicators and recorded data, and stress tests are performed using the optimal cluster.
By optimizing resource utilization, improving testing efficiency, and integrating the resource assessment and selection decision-making process, the operational disconnect caused by frequent switching of tools and environments has been resolved, further improving stress testing efficiency.
Smart Images

Figure CN121579362A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software testing, and particularly relates to a stress testing method and device, a storage medium and computer equipment. BACKGROUND
[0002] With the continuous expansion of the Internet business scale, high-concurrency systems have become the key infrastructure supporting core businesses, and the performance stability thereof is directly related to business continuity and user experience. Therefore, sufficient stress testing before system online has become an important link of software quality assurance.
[0003] At present, many enterprises still generally adopt the manual testing mode to perform stress testing. Testers need to manually deploy test tools on multiple independent physical servers, simulate user load through segmented execution, and rely on manual recording and sorting of various performance index data.
[0004] However, the above testing method needs to frequently switch between different tools and environments, and each link from script configuration, test environment construction to result collection is disconnected, forming multiple discrete operation faults. Therefore, the efficiency of stress testing is low. SUMMARY
[0005] The present application aims to at least solve one of the above technical defects, in particular, the testing method in the prior art needs to frequently switch between different tools and environments, and each link from script configuration, test environment construction to result collection is disconnected, forming multiple discrete operation faults. Therefore, the efficiency of stress testing is low.
[0006] In a first aspect, the present application provides a stress testing method, which comprises:
[0007] obtaining a pre-created traffic model;
[0008] recording traffic of a target interface based on the traffic model to obtain recording data;
[0009] evaluating the performance of each stressor cluster to obtain performance indicators of each stressor cluster, and determining an optimal stressor cluster in each stressor cluster in combination with the performance indicators of each stressor cluster and the recording data;
[0010] performing stress testing on the target interface according to the recording data and using the optimal stressor cluster.
[0011] In one of the embodiments, the recording traffic of the target interface based on the traffic model to obtain recording data comprises:
[0012] intercept network data packets of the target interface by using the flow model;
[0013] preprocess the intercepted network data packets, and generate structured recording data according to the preprocessed network data packets.
[0014] In one of the embodiments, the method further comprises:
[0015] obtaining average network delay and current resource surplus of each stressor cluster;
[0016] calculating the performance index of each stressor cluster according to the average network delay and the current resource surplus of each stressor cluster.
[0017] In one of the embodiments, the method further comprises:
[0018] obtaining data attributes of the recording data;
[0019] matching the data attributes with the performance index of each stressor cluster respectively, to obtain matching degrees between the performance index of each stressor cluster and the data attributes;
[0020] selecting the stressor cluster with the highest matching degree from the stressor clusters, and determining the selected stressor cluster as the optimal stressor cluster.
[0021] In one of the embodiments, the method further comprises:
[0022] obtaining preset stress test parameters;
[0023] distributing the recording data and the stress test parameters to each stressor in the optimal stressor cluster, so that each stressor in the optimal stressor cluster sends a request to the target interface according to the recording data and the stress test parameters.
[0024] In one of the embodiments, the method further comprises:
[0025] recording parameter indexes of each stressor in the optimal stressor cluster during the stress test performed by the optimal stressor cluster on the target interface;
[0026] When the optimal stressor cluster completes the stress test on the target interface, a performance index of the target interface is recorded, and a stress test file is generated according to the parameter index of each stressor in the optimal stressor cluster and the performance index of the target interface.
[0027] In one of the embodiments, the method further comprises:
[0028] When the stress test is performed on the target interface by using the optimal stressor cluster, a stress test progress and a test success rate are calculated;
[0029] The stress test progress and the test success rate are dynamically visualized in real time.
[0030] In a second aspect, the present application provides a stress test device, which comprises:
[0031] a model obtaining module, configured to obtain a pre-created traffic model;
[0032] a traffic recording module, configured to record traffic of a target interface based on the traffic model to obtain recording data;
[0033] a cluster determining module, configured to evaluate performance of each stressor cluster to obtain a performance index of each stressor cluster, and determine an optimal stressor cluster in each stressor cluster in combination with the performance index of each stressor cluster and the recording data;
[0034] a stress test module, configured to perform a stress test on the target interface by using the optimal stressor cluster according to the recording data.
[0035] In a third aspect, the present application provides a storage medium, which stores computer readable instructions, and the computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of the stress test method according to any one of the above embodiments.
[0036] In a fourth aspect, the present application provides a computer device, which comprises one or more processors and a memory.
[0037] The memory stores computer readable instructions, and the one or more processors, when executing the computer readable instructions, perform the steps of the stress test method according to any one of the above embodiments.
[0038] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:
[0039] The stress testing method, apparatus, storage medium, and computer equipment provided in this application introduce a pre-created standardized traffic model, and then record traffic to the target interface based on the traffic model to obtain recorded data. Next, the performance of each stress machine cluster is evaluated, and the optimal stress machine cluster is determined by combining the performance indicators of each cluster with the recorded data. Finally, stress testing is performed on the target interface using the optimal stress machine cluster based on the recorded data. This allows stress testing to be performed using the stress machine cluster most closely matched to the current recorded data, which optimizes resource utilization and improves testing efficiency. Furthermore, it integrates the originally fragmented resource evaluation and selection decision-making process into a coherent adaptive process, fundamentally solving the "operational disconnect" problem caused by frequent switching of tools and environments, and further improving the efficiency of stress testing. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart illustrating a stress testing method provided in an embodiment of this application;
[0042] Figure 2 This is a schematic diagram of the structure of a pressure testing device provided in an embodiment of this application;
[0043] Figure 3 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] In one embodiment, this application provides a stress testing method, which is described below using an example of applying the method to a server. It is understood that the stress testing method can be performed on a single server or on a server cluster consisting of multiple servers; this application does not impose any specific limitations on this.
[0046] like Figure 1As shown, this application provides a stress testing method, the method comprising:
[0047] S101: Obtain the pre-created traffic model.
[0048] Among them, a traffic model refers to a model used to record and analyze network traffic behavior, which can be used for traffic recording.
[0049] In this step, when stress testing a specific interface is required, you can check if a traffic model corresponding to that interface exists among the currently created traffic models. If it exists, you can directly retrieve that pre-created traffic model. If it does not exist, you can create a corresponding traffic model based on the interface's port, IP address, and other information.
[0050] Specifically, when creating the corresponding traffic model based on the port, IP and other information of the interface, a creation task is initiated based on the positioning information of the interface (such as IP address, port number, etc.). By listening to and recording the actual network traffic of the interface, a data model is analyzed and constructed to record its typical traffic behavior and can be used for subsequent test cycles, i.e., traffic model.
[0051] S102: Record traffic to the target interface based on the traffic model to obtain the recorded data.
[0052] Recorded data refers to the dataset obtained by capturing and recording network traffic of a specific target interface in real time through a traffic model.
[0053] In this step, during traffic recording of the target interface based on the traffic model, the recording module of the traffic model is first activated and connected to the target interface to ensure real-time capture of all network traffic passing through that interface. During recording, the traffic model parses each captured data packet, extracts key information, and records it according to a predetermined format, ultimately forming the recording data. In practical applications, such as in a corporate network environment, traffic through the target interface may include employees' daily office communications, access requests to external services, etc. The traffic model can record every request and response in this traffic, thereby helping administrators understand network usage.
[0054] S103: Evaluate the performance of each press cluster, obtain the performance index of each press cluster, and determine the optimal press cluster among all press clusters by combining the performance index of each press cluster and the recorded data.
[0055] Performance metrics refer to quantitative parameters used to measure the operating efficiency and quality of a press cluster under specific working conditions. A press cluster consists of multiple presses, which are tools used for pressure testing that can simulate concurrent requests.
[0056] In this step, the performance of each load generator cluster can be evaluated from multiple aspects, such as resource availability, historical load, and network latency. Then, performance metrics for each load generator cluster can be calculated through standardization and weighted summation. Finally, the optimal load generator cluster is selected based on the matching degree between the recorded data and the performance metrics of each cluster. For example, when the recorded data is large, it may be necessary to select a load generator cluster with higher performance metrics as the optimal cluster.
[0057] S104: Based on the recorded data, perform stress testing on the target interface using the optimal stress machine cluster.
[0058] In this step, the recorded data is sent to the optimal stress testing cluster, which then performs stress tests on the target interface, ultimately producing a stress test file. This stress test file allows testers to quickly understand the parameter changes and test results during the stress test.
[0059] In the above embodiments, a pre-created standardized traffic model is introduced, and then traffic is recorded on the target interface based on the traffic model to obtain recorded data. Next, the performance of each stress test cluster is evaluated, and the optimal stress test cluster is determined by combining the performance indicators of each cluster with the recorded data. Finally, stress testing is performed on the target interface using the optimal stress test cluster based on the recorded data. This allows stress testing to be performed using the stress test cluster that best matches the current recorded data, optimizing resource utilization and improving testing efficiency. Furthermore, it integrates the originally fragmented resource evaluation and selection decision-making process into a coherent adaptive flow, fundamentally solving the "operational disconnect" problem caused by frequent switching of tools and environments, further improving the efficiency of stress testing.
[0060] In one embodiment, traffic is recorded on the target interface based on a traffic model to obtain recorded data, including:
[0061] S1: Use traffic models to intercept network packets at the target interface.
[0062] S2: Preprocess the intercepted network data packets and generate structured recording data based on the preprocessed network data packets.
[0063] Among them, network data packets refer to the basic data units transmitted in a network.
[0064] In this embodiment, network packets of the target interface are intercepted using a traffic model. First, the traffic model configuration is checked to accurately identify and capture all packets passing through the target interface. This process can be achieved using built-in network packet capture tools (such as Wireshark, tcpdump, etc.) or by utilizing custom network middleware to intercept the data stream. The intercepted network packets then enter a preprocessing stage, where operations such as removing invalid data, parsing packet structure, and extracting key information are performed to obtain accurate and structured recording data, improving the accuracy of subsequent stress tests. It can be understood that the purpose of preprocessing is to transform the raw, potentially chaotic data packets into a clean and ordered data format for subsequent processing.
[0065] In one embodiment, the performance of each press cluster is evaluated to obtain performance metrics for each press cluster, including:
[0066] S1: Obtain the average network latency and current resource availability for each pressure machine cluster.
[0067] S2: Calculate the performance metrics for each pressure machine cluster based on the average network latency and current resource availability of each pressure machine cluster.
[0068] The current resource availability refers to the total amount of resources available to the stress machine cluster at the current moment, such as CPU utilization and remaining memory.
[0069] In this embodiment, to obtain the average network latency and current resource availability of each load generator cluster, a monitoring tool can be pre-deployed. This tool can collect data on network latency and resource usage in real time. Specifically, a network performance monitoring tool can measure the round-trip time from the monitoring point to each load generator cluster, thereby calculating the average network latency. Simultaneously, a system resource monitoring tool can be used to obtain resource information such as cluster CPU utilization, remaining memory, and disk space. This data is collected periodically and stored in the monitoring system for subsequent analysis. Then, based on the average network latency and current resource availability of each load generator cluster, a performance metric for evaluating each cluster, i.e., a comprehensive performance score, can be calculated. This comprehensive performance score can be calculated by combining the average network latency and current resource availability using a specific weighting formula.
[0070] Furthermore, when calculating performance metrics, the acquired data can be normalized to obtain the weights of these data, and the performance metrics for each pressure machine cluster can be obtained through weighted summation. In addition, the specific weight settings can be determined based on experience, testing, etc., and this application does not impose any restrictions on them.
[0071] Understandably, calculating performance metrics for each pressure machine cluster integrates multiple performance parameters into a comprehensive evaluation system. This approach can more accurately reflect the overall performance of the cluster, providing a scientific basis for resource allocation and task scheduling, thereby optimizing resource utilization and improving testing efficiency.
[0072] In one embodiment, the optimal press cluster is determined among the various press clusters by combining the performance metrics and recorded data of each press cluster, including:
[0073] S1: Get the data attributes of the recorded data.
[0074] S2: Match the data attributes with the performance indicators of each press machine cluster to obtain the matching degree between the performance indicators and data attributes of each press machine cluster.
[0075] S3: Select the press cluster with the highest matching degree among all press clusters, and determine the selected press cluster as the optimal press cluster.
[0076] Data attributes refer to the characteristics and features of recorded data, including but not limited to data size, data type, and business scenario.
[0077] In this embodiment, the recorded data undergoes detailed analysis and classification. This includes statistically analyzing the scale of the data, identifying the data type, and determining the business scenario involved. For example, the data scale can be determined by analyzing the size and number of data packets; the data type can be identified by parsing the content of the data packets; and the business scenario can be determined by analyzing the source and purpose of the data. Next, these data attributes are matched with the performance metrics of each pressure server cluster. This process can be specifically implemented by establishing a matching model that can calculate the matching degree of each pressure server cluster based on the similarity or correlation between data attributes and performance metrics. For example, if a pressure server cluster exhibits high performance when processing large-scale data, then its matching degree with large-scale data attributes will be high.
[0078] Specifically, by establishing a matching model and calculating the matching degree between the performance indicators of each stress test cluster and the data attributes, the adaptability between each stress test cluster and the data attributes can be quantified, thus providing a scientific basis for selecting the optimal stress test cluster. For example, when processing large-scale text data, selecting a cluster with a high matching degree can improve the efficiency and quality of data processing. Selecting the cluster with the highest matching degree among all stress test clusters and determining it as the optimal stress test cluster ensures that the selected cluster meets the requirements of actual applications in terms of performance, resources, and business needs. This approach avoids performance bottlenecks and resource waste caused by blindly selecting clusters, thereby improving the efficiency and performance of stress testing.
[0079] In one embodiment, stress testing of the target interface is performed based on recorded data and using an optimal stress machine cluster, including:
[0080] S1: Obtain the preset pressure test parameters.
[0081] S2: Distribute the recorded data and stress test parameters to each stress machine in the optimal stress machine cluster, so that each stress machine in the optimal stress machine cluster can send a request to the target interface based on the recorded data and stress test parameters.
[0082] This refers to the various parameters used to control and configure the testing process during stress testing. These parameters include, but are not limited to, the number of concurrent users, request frequency, test duration, and request type.
[0083] In this embodiment, preset stress test parameters are obtained. These parameters are typically predefined based on test objectives and requirements. For example, if the objective is to test the system's performance under high concurrency, a higher number of concurrent users and request frequency might be set. After obtaining the stress test parameters, the recorded data and stress test parameters are distributed to each stress machine in the optimal stress machine cluster. This step can be accomplished using automated scripts or test management tools to ensure that each stress machine receives the same test data and parameter configuration.
[0084] For example, suppose we are testing the API of an online video platform, and the goal is to evaluate its performance under high concurrency. Preset stress test parameters include 1000 concurrent users, a request frequency of 10 requests per second, and a test duration of 1 hour. Automated tools can distribute these parameters and recorded user request data to each stress machine in an optimal stress machine cluster. Each stress machine, based on the received recorded data and stress test parameters, sends requests to the target API, simulating real user access scenarios.
[0085] In one embodiment, the stress testing method further includes:
[0086] S1: During the stress test of the target interface by the optimal stress machine cluster, record the parameter indicators of each stress machine in the optimal stress machine cluster.
[0087] S2: When the optimal stress test cluster completes the stress test on the target interface, record the performance indicators of the target interface, and generate a stress test file based on the parameter indicators of each stress tester in the optimal stress test cluster and the performance indicators of the target interface.
[0088] Among them, the parameter metric refers to the number of queries per second, which can be used to measure the number of requests that can be processed per unit of time.
[0089] In this embodiment, by recording the parameter indicators of each pressure machine in the optimal pressure machine cluster during the stress test, and recording the performance indicators of the target interface upon completion of the stress test, this recorded data is written into a specific template to obtain a stress test file. This stress test file allows testers to intuitively understand the parameter changes during the stress test.
[0090] In one embodiment, the stress testing method further includes:
[0091] S1: When performing stress tests on the target interface using the optimal stress machine cluster, calculate the stress test progress and test success rate.
[0092] S2: Real-time dynamic visualization of stress test progress and success rate.
[0093] In this embodiment, the stress test progress and success rate are calculated in real time during the stress test, and then this data is dynamically displayed in chart form. This improves the intuitiveness and intelligence of the stress test, while also saving labor costs and increasing the efficiency of the stress test.
[0094] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0095] The pressure testing apparatus provided in the embodiments of this application is described below. The pressure testing apparatus described below and the pressure testing method described above can be referred to in correspondence.
[0096] like Figure 2 As shown, this application provides a pressure testing device 200, the device comprising:
[0097] Model acquisition module 201 is used to acquire pre-created traffic models.
[0098] The traffic recording module 202 is used to record traffic to the target interface based on the traffic model and obtain the recorded data.
[0099] Cluster determination module 203 is used to evaluate the performance of each press machine cluster, obtain the performance index of each press machine cluster, and determine the optimal press machine cluster among the various press machine clusters by combining the performance index of each press machine cluster and the recorded data.
[0100] The stress testing module 204 is used to perform stress tests on the target interface based on recorded data and by utilizing the optimal stress machine cluster.
[0101] In the above embodiments, a pre-created standardized traffic model is introduced, and then traffic is recorded on the target interface based on the traffic model to obtain recorded data. Next, the performance of each stress test cluster is evaluated, and the optimal stress test cluster is determined by combining the performance indicators of each cluster with the recorded data. Finally, stress testing is performed on the target interface using the optimal stress test cluster based on the recorded data. This allows stress testing to be performed using the stress test cluster that best matches the current recorded data, optimizing resource utilization and improving testing efficiency. Furthermore, it integrates the originally fragmented resource evaluation and selection decision-making process into a coherent adaptive flow, fundamentally solving the "operational disconnect" problem caused by frequent switching of tools and environments, further improving the efficiency of stress testing.
[0102] In one embodiment, the traffic recording module includes:
[0103] The request interception submodule is used to intercept network packets of the target interface using a traffic model;
[0104] The data generation submodule is used to preprocess the intercepted network data packets and generate structured recording data based on the preprocessed network data packets.
[0105] In one embodiment, the cluster determination module includes:
[0106] The information acquisition submodule is used to obtain the average network latency and current resource availability of each pressure machine cluster;
[0107] The performance evaluation submodule is used to calculate the performance metrics for each pressure machine cluster based on the average network latency and current resource availability of each pressure machine cluster, thus obtaining the performance metrics for each pressure machine cluster.
[0108] In one embodiment, the cluster determination module includes:
[0109] The attribute retrieval submodule is used to retrieve the data attributes of the recorded data;
[0110] The performance matching submodule is used to match data attributes with the performance metrics of each press cluster to obtain the matching degree between the performance metrics and data attributes of each press cluster.
[0111] The cluster determination submodule is used to select the press machine cluster with the highest matching degree among various press machine clusters, and determine the selected press machine cluster as the optimal press machine cluster.
[0112] In one embodiment, the stress testing module includes:
[0113] The parameter acquisition submodule is used to acquire preset stress test parameters;
[0114] The stress testing submodule is used to distribute recorded data and stress test parameters to each stress machine in the optimal stress machine cluster, so that each stress machine in the optimal stress machine cluster can send a request to the target interface based on the recorded data and stress test parameters.
[0115] In one embodiment, the pressure testing apparatus further includes:
[0116] The first recording module is used to record the parameter indicators of each pressure machine in the optimal pressure machine cluster during the process of performing stress test on the target interface by the optimal pressure machine cluster.
[0117] The second recording module is used to record the performance indicators of the target interface when the optimal pressure machine cluster completes the stress test on the target interface, and generate a stress test file based on the parameter indicators of each pressure machine in the optimal pressure machine cluster and the performance indicators of the target interface.
[0118] In one embodiment, the pressure testing apparatus further includes:
[0119] The calculation module is used to calculate the stress test progress and test success rate when performing stress tests on the target interface using the optimal stress machine cluster;
[0120] The visualization module is used to dynamically display the progress and success rate of stress testing in real time.
[0121] The division of modules in the above-described stress testing device is merely illustrative. In other embodiments, the stress testing device can be divided into different modules as needed to complete all or part of its functions. Each module in the stress testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0122] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the stress testing method as described in any of the above embodiments.
[0123] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the stress testing method as described in any of the above embodiments.
[0124] Indicatively, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the stress testing methods of any of the above embodiments.
[0125] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0126] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0127] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having” specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.
[0128] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0129] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A pressure testing method, characterized in that, The method includes: Retrieve the pre-created traffic model; Based on the traffic model, traffic is recorded at the target interface to obtain recorded data; The performance of each press cluster is evaluated to obtain the performance index of each press cluster. The optimal press cluster is determined by combining the performance index of each press cluster with the recorded data. Based on the recorded data, stress tests are performed on the target interface using the optimal stress machine cluster.
2. The pressure testing method according to claim 1, characterized in that, The process of recording traffic to the target interface based on the traffic model to obtain recorded data includes: Intercept network packets of the target interface using the traffic model; The intercepted network data packets are preprocessed, and structured recording data is generated based on the preprocessed network data packets.
3. The pressure testing method according to claim 1, characterized in that, The evaluation of the performance of each press cluster yields performance metrics for each press cluster, including: Obtain the average network latency and current resource availability for each pressure machine cluster; Based on the average network latency and current resource availability of each press cluster, performance metrics for evaluating each press cluster are calculated, resulting in the performance metrics for each press cluster.
4. The pressure testing method according to claim 1, characterized in that, The step of determining the optimal press cluster among the various press clusters by combining the performance indicators of each press cluster with the recorded data includes: Obtain the data attributes of the recorded data; The data attributes are matched with the performance indicators of each press machine cluster to obtain the matching degree between the performance indicators of each press machine cluster and the data attributes. The press cluster with the highest matching degree is selected from all press clusters, and the selected press cluster is determined as the optimal press cluster.
5. The pressure testing method according to claim 1, characterized in that, The step of performing a stress test on the target interface based on the recorded data and using the optimal stress machine cluster includes: Obtain the preset stress test parameters; The recorded data and the stress test parameters are distributed to each pressure machine in the optimal pressure machine cluster, so that each pressure machine in the optimal pressure machine cluster sends a request to the target interface based on the recorded data and the stress test parameters.
6. The pressure testing method according to claim 1, characterized in that, The method further includes: During the stress test performed on the target interface by the optimal pressure machine cluster, the parameter indicators of each pressure machine in the optimal pressure machine cluster are recorded. When the optimal pressure machine cluster completes the stress test on the target interface, it records the performance indicators of the target interface and generates a stress test file based on the parameter indicators of each pressure machine in the optimal pressure machine cluster and the performance indicators of the target interface.
7. The pressure testing method according to any one of claims 1 to 6, characterized in that, The method further includes: When the optimal stress machine cluster is used to perform stress testing on the target interface, the stress test progress and test success rate are calculated. The progress of the stress test and the success rate of the test are dynamically and visually displayed in real time.
8. A pressure testing device, characterized in that, The device includes: The model acquisition module is used to acquire pre-created traffic models; The traffic recording module is used to record traffic to the target interface based on the traffic model to obtain recorded data. The cluster determination module is used to evaluate the performance of each press machine cluster, obtain the performance index of each press machine cluster, and determine the optimal press machine cluster among the various press machine clusters by combining the performance index of each press machine cluster and the recorded data. The stress testing module is used to perform stress testing on the target interface based on the recorded data and using the optimal stress machine cluster.
9. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the stress testing method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the stress testing method as described in any one of claims 1 to 7.