Automatic positioning performance inflection point method and device, storage medium and electronic equipment
By comprehensively considering multiple indicators and reasonably setting the concurrency step size in performance testing, and using multi-stage judgment and binary search to find the performance inflection point, the problem of insufficient consideration of factors in existing technologies is solved, and efficient and accurate performance inflection point positioning is achieved.
Patent Information
- Application Number
- CN202311260058.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-09-27
AI Technical Summary
Existing technologies have fewer factors to consider when automatically locating performance inflection points, resulting in low algorithm accuracy, low coverage of TPS change stages, insufficient handling of abnormal scenarios, and unreasonable setting of concurrent step size, leading to low positioning efficiency.
By configuring the initial conditions of the performance test scenario, and comprehensively considering indicators such as TPS, response time, resource utilization and transaction success rate, the system uses multi-stage judgment and binary search to find performance inflection points, reasonably sets the concurrency step size, and considers concurrency rollback and termination conditions to achieve fully automatic and accurate positioning.
It improves the accuracy and efficiency of performance inflection point location, reduces the number of test cycles, lowers labor costs, and lowers the barrier to entry for testers.
Smart Images

Figure CN117453533B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a method, apparatus, storage medium, and electronic device for automatically locating performance inflection points. Background Technology
[0002] In performance testing, the number of users simultaneously online within a certain time period is defined as the concurrent user count. When searching for performance inflection points, the change in concurrent user count is often described using the concurrency step size, which refers to the difference in concurrent user count between two performance tests. One of the core objectives of performance testing is to find the system's maximum TPS (Transactions Per Second), using TPS to reflect a system's processing capacity. During performance testing, as the number of concurrent users increases, the TPS curve exhibits a parabolic trend, and the performance inflection point is generally defined as the peak of the TPS curve.
[0003] To address the issue of low efficiency in manual positioning performance inflection points, there are currently a few automatic positioning performance inflection point methods in the industry. However, in the process of developing this application, the inventors discovered that these existing automatic positioning performance inflection point methods have at least the following drawbacks:
[0004] (1) The step size algorithm has low accuracy because it considers fewer indicator factors: For example, when automatically locating the performance inflection point, it only calculates based on TPS and does not consider factors such as response time, resource utilization and transaction success rate. However, the location of the performance inflection point is closely related to these key factors, so the algorithm has low accuracy.
[0005] (2) Less consideration of TPS change phase and low coverage: For example, the algorithm only considers the inflection point calculation of the TPS increase phase. Continuously increasing the number of concurrent users will cause TPS to cross the inflection point. At this time, it is necessary to roll back the number of concurrent users and locate the performance inflection point.
[0006] (3) Few abnormal scenarios are considered and do not conform to actual scenarios: For example, the TPS performance inflection point is only located based on ideal scenarios, but when other indicators (response time, resource utilization, transaction success rate, etc.) are abnormal, no judgment or handling is made.
[0007] (4) The concurrent step size setting strategy is unreasonable and the inflection point positioning efficiency is low: For example, some existing concurrent step size calculation methods are relatively simple, consider fewer factors, and do not take into account the step size setting strategy under various situations such as concurrent rollback, concurrent range reduction, and test termination. Summary of the Invention
[0008] This application provides a method, apparatus, storage medium, and electronic device for automatically locating performance inflection points to solve one or more of the aforementioned problems.
[0009] According to a first aspect of this application, an automatic method for locating performance inflection points is proposed, the method comprising the steps of:
[0010] S1, Configure the initial conditions for the performance test scenario. The initial conditions include performance test metrics, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test metrics include response time metrics, transaction success rate metrics, and system resource utilization threshold. The concurrency termination condition is that the concurrency value growth rate is less than the preset concurrency value growth rate threshold. The initial run corresponds to test phase n=1. After each run, the test phase n value increases by 1, and by default, n=0 when not running. At this time, the concurrency value V0=0, and the transaction processing per second (TPS) count TPS0=0.
[0011] S2, for the nth test phase, with its corresponding concurrency value V n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization.
[0012] S3. Determine whether all the collected performance test data meet the performance test indicators configured in the initial conditions. If any indicator does not meet the requirements, proceed to step S4; otherwise, proceed to step S5.
[0013] S4, the concurrency value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process;
[0014] S5, compare the transactions per second (TPS) in the (n-1)th test phase. n-1 Transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then proceed to step S6. If TPS n >TPS n-1 If so, proceed to step S7;
[0015] S6, the concurrency value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) maxEnd the testing process;
[0016] S7, calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to the preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n And execute step S8;
[0017] S8, according to P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is not met, proceed to step S9; otherwise, proceed to the (n+1)th test phase, using its concurrency value V. n+1 Return to step S2;
[0018] S9, take the concurrency value V in the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0019] According to a second aspect of this application, an automatic positioning performance inflection point device is provided, the device comprising:
[0020] The initial condition configuration unit is used to configure the initial conditions of the performance test scenario. The initial conditions include performance test metrics, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test metrics include response time metrics, transaction success rate metrics, and system resource utilization threshold. The concurrency termination condition is that the concurrency value growth rate is less than a preset concurrency value growth rate threshold. The initial run corresponds to test phase n=1. After each run, the test phase n value increases by 1, and by default, n=0 when not running, at which time the concurrency value V0=0 and the transaction processing per second (TPS) count TPS0=0.
[0021] The scenario execution unit is used for the nth test phase, with its corresponding concurrency value V. n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization.
[0022] The test index judgment unit is used to determine whether all the collected performance test data meet the performance test indexes configured in the initial conditions. If any index does not meet the requirements, the first case processing unit is executed; otherwise, the TPS comparison unit is executed.
[0023] The first case processing unit is used for the concurrent value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process;
[0024] The TPS comparison unit is used to compare the transactions per second (TPS) in the (n-1)th test phase. n-1 and the number of transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then the second case processing unit is executed; if TPS n >TPS n-1 Then the step size calculation unit is executed;
[0025] The second case handling unit is used for the concurrent value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process;
[0026] The step size calculation unit is used to calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to a preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n And execute the termination condition judgment unit;
[0027] Termination condition judgment unit, used to determine P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is reached, the third case handling unit will be executed; otherwise, the (n+1)th test phase will proceed, based on its concurrency value V. n+1Return to the execution scenario unit;
[0028] The third case handling unit is used to retrieve the concurrent value V of the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0029] According to a third aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing one or more programs that, when the programs are executed, control the device where the computer-readable storage medium is located to perform the aforementioned automatic location performance inflection point method.
[0030] According to a fourth aspect of this application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned automatic location performance inflection point method.
[0031] The technical solution of this application embodiment can achieve the following beneficial effects:
[0032] In the initial conditions of the configured performance test scenario, this application embodiment comprehensively considers multiple key test indicators, such as TPS, response time, resource utilization, and transaction success rate, making the consideration more comprehensive and feasible. For each test stage, the scenario is run with its corresponding concurrency value, and TPS and performance test data are collected within a single test run. First, it is determined whether all the collected performance test data meets the performance test indicators configured in the initial conditions. If any indicator does not meet the requirements, the first processing scenario is entered. If all indicators meet the requirements, the second or third processing scenario is determined by comparing the TPS of the previous test stage with the TPS of the current test stage. This comprehensively considers the TPS change trend and abnormal test scenarios, enabling efficient location of performance inflection points at different stages and under different conditions. Moreover, the concurrency step size strategy is reasonable and takes into account various situations such as concurrency rollback, concurrency range reduction, and test termination, effectively reducing the number of test loops and improving the efficiency of inflection point location. It can achieve fully automatic and accurate finding of performance inflection points, effectively reducing labor costs and lowering the threshold for test personnel. Attached Figure Description
[0033] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0034] Figure 1 The graph shows the trends of TPS, response time, and resource utilization as a function of the number of concurrent users.
[0035] Figure 2 This paper shows a schematic diagram of the main process of an automatic performance inflection point method proposed in an embodiment of this application;
[0036] Figure 3 This diagram illustrates the performance inflection point under test metric constraints.
[0037] Figure 4 A flowchart of subroutine 1 in an embodiment of this application is shown;
[0038] Figure 5 This diagram illustrates the use of the bisection method to find the performance inflection point under test metric constraints.
[0039] Figure 6 A flowchart of subroutine 2 in an embodiment of this application is shown;
[0040] Figure 7 This diagram illustrates the performance inflection point when TPS surpasses its peak.
[0041] Figure 8 This diagram illustrates the binary search method for finding the performance inflection point when TPS exceeds its maximum value.
[0042] Figure 9 A schematic diagram of the structure of an automatic positioning performance inflection point device according to an embodiment of this application is shown;
[0043] Figure 10 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0044] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0046] In performance testing, the currently widely accepted industry metrics for TPS, response time, and resource utilization as a function of concurrent users are as follows: Figure 1 As shown, Figure 1 The graph shows the trends of TPS, response time, and resource utilization as a function of the number of concurrent users. Based on these trends, this application proposes a method, apparatus, storage medium, and electronic device for automatically locating performance inflection points.
[0047] Example 1
[0048] According to a first aspect of this application, embodiments of this application propose a method for automatically locating performance inflection points, referring to... Figure 2 The main process flow diagram shown includes steps S1 to S9:
[0049] S1, Configure the initial conditions for the performance test scenario. The initial conditions include performance test metrics, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test metrics include response time metrics, transaction success rate metrics, and system resource utilization threshold. The concurrency termination condition is that the concurrency value growth rate is less than the preset concurrency value growth rate threshold. The initial run corresponds to test phase n=1. After each run, the test phase n value increases by 1, and by default, n=0 when not running. At this time, the concurrency value V0=0, and the transaction processing per second (TPS0) is 0.
[0050] The system resources mentioned above include, but are not limited to: CPU, memory, disk I / O, network throughput, etc. The runtime of a single test refers to the runtime of each test phase, which, once set, remains fixed throughout the entire test period.
[0051] Considering that when the concurrency value increases too little, the test results obtained by continuing the test will be relatively similar, this application configures the concurrency value growth rate to be less than a preset concurrency value growth rate threshold as the concurrency termination condition. Once the concurrency value growth rate reaches the threshold, the test will be terminated, which can improve the efficiency of finding the performance inflection point.
[0052] S2, for the nth test phase, with its corresponding concurrency value V n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization.
[0053] S3. Determine whether all the collected performance test data meet the performance test indicators configured in the initial conditions. If any indicator does not meet the requirements, proceed to step S4; otherwise, proceed to step S5.
[0054] For example, if the response time is greater than the response time indicator, or the transaction success rate is less than the transaction success rate indicator, or the system resource utilization rate exceeds the system resource utilization rate threshold, then step S4 is executed. Step S5 is executed only if all three indicators are met simultaneously.
[0055] S4, the concurrency value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0056] Reference Figure 3 The diagram shown illustrates the performance inflection point under the test metric constraints. Skipping to step S4 indicates that the concurrency value is V. n-1 When the test criteria are met, the concurrency value is V. n If the test metrics are not met, then the TPS under the test metrics is met. max The corresponding V max In (V) n-1 V n In ), there exists Figure 3 Cases (a) and (b) are presented. How to find the performance inflection point (TPS)? max The corresponding V max This will be explained in the following description.
[0057] S5, compare the transactions per second (TPS) in the (n-1)th test phase. n-1 and the number of transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then proceed to step S6. If TPS n >TPS n-1 Then proceed to step S7.
[0058] If TPS n ≤TPS n-1This indicates that TPS has exceeded its peak, and the process proceeds to step S6 to find the optimal concurrency value V. max If TPS n >TPS n-1 This indicates that there is still room for improvement in TPS, so proceed to step S7 to find the optimal concurrency value V. max .
[0059] S6, the concurrency value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0060] The step of jumping to S6 indicates that TPS has exceeded its highest point, and there is a possibility of... Figure 7 Cases (a) and (b) are provided. (Refer to...) Figure 7 The diagram illustrates the performance inflection point when TPS surpasses its peak. At this point, TPS shows a downward trend, and the current concurrency value V... n TPS has been exceeded max The corresponding V max The concurrency fallback condition is triggered, requiring a reduction in the concurrency value and (V) n-2 V n Continuing to run the test, how to find the performance inflection point (TPS)? max The corresponding V max This will be explained in the following description.
[0061] S7, calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to the preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n Then proceed to step S8.
[0062] The step of jumping to S7 indicates that there is still room for improvement in TPS. It is necessary to use the preset step size algorithm formula to obtain the concurrent step size P of the (n+1)th test phase relative to the nth test phase. n Increase the concurrency value in the nth test phase, i.e., V. n+1 =V n +P n Then proceed to step S8.
[0063] The following are two preset step size algorithms given in the embodiments of this application.
[0064] The first step length algorithm: The preset step length algorithm is related to the concurrent step length of the previous test phase and the remaining available system resources in the current test phase, and specifically uses the following first step length algorithm to obtain the concurrent step length P. n :
[0065]
[0066] Among them, V n V represents the concurrency value in the nth test phase. n-1 Let V be the concurrency value for the (n-1)th test phase. n -V n-1 ) represents the concurrent step size of the nth test phase relative to the (n-1)th test phase, RS max To preset the system resource utilization threshold, RS n RS represents the system resource utilization rate in the nth test phase. n-1 This represents the system resource utilization rate during the (n-1)th test phase. This represents the maximum step size growth factor that the remaining available system resources can support in the nth test phase.
[0067] Theoretically, considering only resource constraints, the current maximum supported concurrent step size is (V n -V n-1 )*(RS max -RS n ) / (RS n -RS n-1 However, considering Figure 1 The curve showing TPS versus concurrency value indicates that a larger step size should be set when TPS grows rapidly, and a smaller step size should be set when TPS grows slowly and is approaching its maximum. Therefore, this application introduces a TPS growth rate K to optimize the first concurrency step size algorithm, based on the first step size algorithm, and presents a second step size algorithm.
[0068] Second step size algorithm: The preset step size algorithm is also related to the TPS growth rate of the previous test phase, and the concurrency step size P is obtained by the following second step size algorithm. n :
[0069]
[0070]
[0071] Among them, TPS n Let TPS be the number of transactions per second in the nth test phase. n-1 Let K be the number of transactions per second in the (n-1)th test phase, and K be the TPS growth rate of the nth test phase relative to the (n-1)th test phase.
[0072] To prevent excessive concurrent step size from causing resource overload, this application further preferably limits the maximum value of the TPS growth rate K, for example, by limiting it to K≤0.5.
[0073] S8, according to P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is not met, proceed to step S9; otherwise, proceed to the (n+1)th test phase, using its concurrency value V. n+1 Return to step S2 and continue until a performance inflection point is found;
[0074] S9, This step indicates that TPS has been found. max The corresponding V max The V max That is, V n Take the concurrency value V in the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0075] Therefore, it can be seen that the embodiments of this application comprehensively consider multiple key test indicators, such as TPS, response time, resource utilization, and transaction success rate, in the initial conditions of the configured performance test scenarios. The consideration of factors is more comprehensive and the feasibility is higher. For each test stage, the scenario is run with its corresponding concurrency value, and TPS and performance test data within a single test runtime are collected. First, it is determined whether all the collected performance test data meets the performance test indicators configured in the initial conditions. If any indicator does not meet the requirements, the first processing situation is entered. If all indicators meet the requirements, the second or third processing situation is determined by comparing the TPS of the previous test stage with the TPS of the current test stage. This comprehensively considers the TPS change trend and test anomaly scenarios, and can efficiently locate performance inflection points in different stages and under different conditions. Moreover, the concurrency step size strategy is reasonable and takes into account various situations such as concurrency rollback, concurrency range reduction, and test termination, which effectively reduces the number of test loops, improves the efficiency of inflection point location, and can realize fully automatic and accurate search for performance inflection points, effectively reducing labor costs and lowering the threshold for test personnel.
[0076] against Figure 3 In cases (a) and (b), subroutine 1 is executed to find the performance inflection point. (Refer to...) Figure 4 The flowchart of subroutine 1 shown above, specifically includes step S4:
[0077] S41, due to the concurrent value V n The test metrics were no longer met during runtime, triggering the concurrency rollback condition. Therefore, the concurrency value needs to be reduced and (V) n-1 V n The test is executed in ), so first let V start =V n-1 V end =V n .
[0078] S42, in (V) start V end The test is performed using a binary search method to find the TPS. max The corresponding V max .
[0079] S43, according to (V end -V start ) / V start Calculate the concurrent value growth rate and determine (V) end -V start ) / V start Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, (V end -V start ) / V start If the preset concurrent value growth rate threshold is met, proceed to step S48; otherwise, proceed to step S44.
[0080] S44, refer to Figure 5 The diagram shown illustrates the binary search method for finding the performance inflection point under test metric constraints. Let V... m =(V start +V end ) / 2, with concurrent value V m The test scenario collects the number of transactions per second (TPS) within a single test run. m And performance test data, and execute step S45.
[0081] S45, determine the concurrency value V m If all the performance test data collected during the running scenario meets the performance test indicators configured in the initial conditions, proceed to step S46; otherwise, proceed to step S47.
[0082] S46, concurrency value V m When the test criteria are met, the concurrency value is V. end If the test criteria are not met, the search scope is narrowed to (V). m V end ), let V start =V m V end =Vend And return to step S42;
[0083] S47, concurrency value V m The test metric is not met, and the concurrency value is V. start If the test criteria are met, the search range is narrowed down to (V). start V m ), let V start =V start V end =V m And return to step S42;
[0084] S48, take V max For V start V end The values of the performance test metrics that meet the initial configuration conditions are obtained, and the V value is acquired. max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0085] against Figure 7 In cases (a) and (b), subroutine 2 is executed to find the performance inflection point. (Refer to...) Figure 6 The flowchart of subroutine 2 shown above, specifically includes step S6:
[0086] S61, let V start =V n-2 V mid =V n-1 V end =V n Proceed to step S62.
[0087] Since TPS is trending downwards, the current concurrency value V n TPS has been exceeded max The corresponding V max The concurrency fallback condition is triggered, requiring a reduction in the concurrency value and (V) n-2 V n Execute the test in ) and find TPS max The corresponding V max Therefore, let V first start =V n-2 V mid =V n-1 V end =V n .
[0088] S62, looking for TPS in the most recent 3 test data. max The corresponding concurrency values are V start V mid V end .
[0089] S63, according to (V end -V start ) / V start Calculate the concurrent value growth rate and determine (V) end -V start ) / V start Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, (V end -V start ) / V start If the preset concurrent value growth rate threshold is met, proceed to step S69; otherwise, proceed to step S64.
[0090] S64, using the bisection method, let V p =(V start +V mid ) / 2、V q =(V mid +V end ) / 2, respectively with concurrency value V p V q The test scenario collects the number of transactions per second (TPS) within a single test run. p and TPS q Then proceed to step S65.
[0091] S65, compare the concurrency value V p V q V mid The number of transactions per second (TPS) of each running, if mid ≥max{TPS p TPS q Then proceed to step S66; if TPS p ≥TPS mid >TPS q Then proceed to step S67; if TPS q ≥TPS mid >TPS p Then proceed to step S68.
[0092] Reference Figure 8 The diagram illustrates the binary search method for finding the performance inflection point when TPS exceeds its maximum. mid ≥max{TPS p TPS q} represents the concurrency value TPS. max The corresponding V max In (V) p V q In ) such as Figure 8 As shown in (a), proceed to step S66; if TPS p ≥TPSmid >TPS q This indicates the concurrency value V. mid Corresponding TPS mid TPS has been exceeded max ,like Figure 8 As shown in (b), proceed to step S67; if TPS q ≥TPS mid >TPS p This indicates the concurrency value V. mid Corresponding TPS mid TPS not yet reached max ,like Figure 8 As shown in (c), step S68 is executed.
[0093] S66, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V p V mid =V mid V end =V q and return to step S62;
[0094] S67, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V start V mid =V p V end =V mid and return to step S62;
[0095] S68, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V mid V mid =V q V end =V end and return to step S62;
[0096] S69, take V max =max{V start V mid V end}, and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0097] Combination Figure 4 and Figure 6 As shown in the flowchart, both subroutines 1 and 2 use the binary search method to find the performance inflection point, which can achieve fully automatic and accurate finding of the performance inflection point, effectively reducing labor costs and lowering the threshold for testers.
[0098] Example 2
[0099] According to the second aspect of this application, such as Figure 9 As shown in the figure, this application proposes an automatic positioning performance inflection point device, which includes the following units:
[0100] The initial condition configuration unit 910 is used to configure the initial conditions of the performance test scenario. The initial conditions include performance test indicators, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test indicators include response time indicator, transaction success rate indicator, and system resource utilization threshold. The concurrency termination condition is that the concurrency value growth rate is less than the preset concurrency value growth rate threshold. The initial run corresponds to test phase n=1. After each run, the test phase n value increases by 1, and by default, when not running, n=0. At this time, the concurrency value V0=0, and the transaction processing per second (TPS) count TPS0=0.
[0101] Scenario execution unit 920 is used for the nth test phase, with its corresponding concurrency value V. n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization.
[0102] The test index judgment unit 930 is used to determine whether all the collected performance test data meets the performance test indexes configured in the initial conditions. If any index does not meet the requirements, the first case processing unit 940 is executed; otherwise, the TPS comparison unit 950 is executed.
[0103] The first case processing unit 940 is used for the concurrent value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process;
[0104] TPS comparison unit 950 is used to compare the transactions per second (TPS) in the (n-1)th test phase. n-1 Transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then the second case processing unit 960 is executed. If TPS n >TPS n-1 Then execute step size calculation unit 970;
[0105] The second case processing unit 960 is used for the concurrent value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process;
[0106] Step size calculation unit 970 is used to calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to a preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n And execute the termination condition judgment unit 980;
[0107] Termination condition judgment unit 980, used to determine P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is reached, the third case handling unit will be executed; otherwise, the (n+1)th test phase will proceed, based on its concurrency value V. n+1 Return to execution scenario running unit 92;
[0108] The third case processing unit 990 is used to retrieve the concurrent value V of the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
[0109] The preset step size algorithm used in the aforementioned step size calculation unit 970 can be specifically as follows:
[0110]
[0111]
[0112] Among them, P n V represents the concurrent step size of the (n+1)th test phase relative to the nth test phase. n V represents the concurrency value in the nth test phase. n-1 Let V be the concurrency value for the (n-1)th test phase. n -V n-1) represents the concurrent step size of the nth test phase relative to the (n-1)th test phase, RS max To preset the system resource utilization threshold, RS n RS represents the system resource utilization rate in the nth test phase. n-1 This represents the system resource utilization rate during the (n-1)th test phase. The maximum step growth factor that the remaining available system resources can support in the nth test phase; TPS n Let TPS be the number of transactions per second in the nth test phase. n-1 Let K be the number of transactions per second in the (n-1)th test phase, and K be the TPS growth rate of the nth test phase relative to the (n-1)th test phase.
[0113] Figure 9 The implementation process and principle explanation of each unit in the device can be found in the foregoing method embodiments, and will not be repeated here. It should also be noted that the units described in the embodiments of this application can be implemented in software or hardware. Furthermore, the names of the units do not necessarily constitute a limitation on the unit itself.
[0114] Example 3
[0115] According to a third aspect of this application, embodiments of this application provide a computer-readable storage medium storing one or more programs that, when the programs are executed, control the device where the computer-readable storage medium is located to perform the automatic performance inflection point method of this application.
[0116] The computer-readable storage medium of this application embodiment can be any tangible medium containing a stored program, or it can be a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Furthermore, the computer-readable storage medium of this application embodiment can be located in any computer terminal within a group of computer terminals in a computer network, or in any communication device within a group of communication devices.
[0117] Example 4
[0118] According to a fourth aspect of this application, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the automatic location performance inflection point method of this application.
[0119] The following is for reference. Figure 10 The diagram illustrates a structural schematic of an electronic device suitable for implementing the embodiments of this application. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0120] like Figure 10 As shown, an electronic device may include a processing unit (such as a central processing unit, graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0121] Typically, the following systems can be connected to the I / O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0122] Specifically, according to embodiments of this application, the processes described in the flowcharts above can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, it performs the functions defined in the methods of embodiments of this application.
[0123] Finally, it should be noted that:
[0124] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the above embodiments of this application, the descriptions of each embodiment have their own emphasis; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. The embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, units, or modules, and may be electrical or other forms.
[0126] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods, apparatus, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Moreover, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0129] The above description is merely a preferred embodiment of this application. It should be noted that various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A method for automatically locating performance inflection points, characterized in that, The method includes the following steps: S1, Configure the initial conditions of the performance test scenario, including performance test metrics, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test metrics include response time, transaction success rate, and system resource utilization threshold. The concurrency termination condition is that the concurrency growth rate is less than the preset concurrency growth rate threshold. The initial test phase n = 1, and the test phase n value increases by 1 after each run. By default, n = 0 when not running, at which time the concurrency value V0 = 0 and the transaction processing per second (TPS) 0 = 0. S2, for the nth test phase, with its corresponding concurrency value V n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization. S3. Determine whether all the collected performance test data meet the performance test indicators configured in the initial conditions. If any indicator does not meet the requirements, proceed to step S4; otherwise, proceed to step S5. S4, the concurrency value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process; S5, compare the transactions per second (TPS) in the (n-1)th test phase. n-1 and the number of transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then proceed to step S6. If TPS n >TPS n-1 Then proceed to step S7; S6, the concurrency value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process; S7, calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to the preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n And execute step S8; S8, according to P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is not met, proceed to step S9; otherwise, proceed to the (n+1)th test phase, using its concurrency value V. n+1 Return to step S2; S9, take the concurrency value V in the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
2. The method according to claim 1, characterized in that, Step S4 specifically includes: S41, let V start =V n-1 , V end =V n ; S42, in (V) start V end The test is performed using a binary search method to find the TPS. max The corresponding V max ; S43, according to (V end -V start ) / V start Calculate the concurrent value growth rate and determine (V) end -V start ) / V start Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, (V end -V start ) / V start If the preset concurrency growth rate threshold is met, proceed to step S48; otherwise, execute step S44. S44, using the bisection method, let V m =(V start +V end ) / 2, with concurrent value V m The test scenario collects the number of transactions per second (TPS) within a single test run. m And performance test data, and execute step S45; S45, determine the concurrency value V m If all the performance test data collected during the running scenario meets the performance test indicators configured in the initial conditions, then proceed to step S46; otherwise, proceed to step S47. S46, narrow the search range to (V) m V end ), let V start =V m V end =V end And return to step S42; S47, narrow the search range to (V start V m ), let V start =V start V end =V m And return to step S42; S48, take V max For V start V end The values of the performance test metrics that meet the initial configuration conditions are obtained, and the V value is acquired. max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
3. The method according to claim 1, characterized in that, Step S6 specifically includes: S61, let V start =V n-2 V mid =V n-1 V end =V n Execute step S62; S62, looking for TPS in the most recent 3 test data. max The corresponding concurrency values are V start V mid V end ; S63, according to (V end -V start ) / V start Calculate the concurrent value growth rate and determine (V) end -V start ) / V start Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, (V end -V start ) / V start If the preset concurrency growth rate threshold is met, proceed to step S69; otherwise, proceed to step S64. S64, using the bisection method, let V p =(V start +V mid ) / 2、V q =(V mid +V end ) / 2, respectively with concurrency value V p V q The test scenario collects the number of transactions per second (TPS) within a single test run. p and TPS q and proceed to step S65; S65, compare the concurrency value V p V q V mid The number of transactions per second (TPS) of each running, if mid ≥max{TPS p TPS q Then proceed to step S66; if TPS p ≥TPS mid >TPS q Then proceed to step S67; if TPS q ≥TPS mid >TPS p Then proceed to step S68; S66, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V p V mid =V mid V end =V q And return to step S62; S67, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V start V mid =V p V end =V mid And return to step S62; S68, narrow down the search scope and determine the concurrency values of the new reference data as V. start =V mid V mid =V q V end =V end And return to step S62; S69, take V max =max{V start V mid V end }, and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
4. The method according to any one of claims 1 to 3, characterized in that, The preset step size algorithm in step S7 is related to the concurrent step size of the previous test phase and the remaining available system resources in the current test phase, and specifically uses the following first step size algorithm to obtain the concurrent step size P. n : Among them, V n V represents the concurrency value in the nth test phase. n-1 Let V be the concurrency value for the (n-1)th test phase. n -V n-1 ) represents the concurrent step size of the nth test phase relative to the (n-1)th test phase, RS max To preset the system resource utilization threshold, RS n RS represents the system resource utilization rate in the nth test phase. n-1 This represents the system resource utilization rate during the (n-1)th test phase. This represents the maximum step size growth factor that the remaining available system resources can support in the nth test phase.
5. The method according to claim 4, characterized in that, The preset step size algorithm in step S7 is also related to the TPS growth rate in the previous test phase, and specifically uses the second step size algorithm described below to obtain the concurrent step size P. n : Among them, TPS n Let TPS be the number of transactions per second in the nth test phase. n-1 Let K be the number of transactions per second in the (n-1)th test phase, and K be the TPS growth rate of the nth test phase relative to the (n-1)th test phase.
6. The method according to claim 5, characterized in that, Step S7 further includes limiting the maximum value of the TPS growth rate K.
7. An automatic positioning performance inflection point device, characterized in that, The device includes: The initial condition configuration unit is used to configure the initial conditions of the performance test scenario. The initial conditions include performance test metrics, initial concurrency value, initial concurrency step size, concurrency termination condition, and single test runtime. The performance test metrics include response time metrics, transaction success rate metrics, and system resource utilization threshold. The concurrency termination condition is that the concurrency value growth rate is less than a preset concurrency value growth rate threshold. The initial run corresponds to test phase n=1. After each run, the test phase n value increases by 1, and by default, n=0 when not running, at which time the concurrency value V0=0 and the transaction processing per second (TPS) count TPS0=0. The scenario execution unit is used for the nth test phase, with its corresponding concurrency value V. n The test scenario collects the number of transactions per second (TPS) within a single test run. n The collected performance test data includes response time, transaction success rate, and system resource utilization. The test index judgment unit is used to determine whether all the collected performance test data meet the performance test indexes configured in the initial conditions. If any index does not meet the requirements, the first case processing unit is executed; otherwise, the TPS comparison unit is executed. The first case processing unit is used for the concurrent value V in the (n-1)th test phase. n-1 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process; The TPS comparison unit is used to compare the transactions per second (TPS) in the (n-1)th test phase. n-1 and the number of transactions per second (TPS) in the nth test phase n The size, if TPS n ≤TPS n-1 Then the second case processing unit is executed; if TPS n >TPS n-1 Then the step size calculation unit is executed; The second case handling unit is used for the concurrent value V in the (n-2)th test phase. n-2 The concurrency value V in the nth test phase n Find the optimal concurrency value V corresponding to the performance inflection point. max and obtain the V max The corresponding optimal number of transactions per second (TPS) max End the testing process; The step size calculation unit is used to calculate the concurrent step size P of the (n+1)th test phase relative to the nth test phase according to a preset step size algorithm. n The concurrency value V in the (n+1)th test phase is obtained. n+1 =V n +P n And execute the termination condition judgment unit; Termination condition judgment unit, used to determine P n / V n Calculate the concurrent value growth rate and determine P. n / V n Does the concurrent termination condition configured in the initial condition configuration meet? If it does, that is, P... n / V n If the preset concurrency growth rate threshold is reached, the third case handling unit will be executed; otherwise, the (n+1)th test phase will proceed, based on its concurrency value V. n+1 Return to the execution scenario unit; The third case handling unit is used to retrieve the concurrent value V of the nth test phase. n The optimal concurrency value V corresponding to the performance inflection point max and obtain the V max The corresponding optimal number of transactions per second (TPS) max The testing process ends here.
8. The apparatus according to claim 7, characterized in that, The preset step size algorithm in the step size calculation unit is as follows: Among them, P n V represents the concurrent step size of the (n+1)th test phase relative to the nth test phase. n V represents the concurrency value in the nth test phase. n-1 Let V be the concurrency value for the (n-1)th test phase. n -V n-1 ) represents the concurrent step size of the nth test phase relative to the (n-1)th test phase, RS max To preset the system resource utilization threshold, RS n RS represents the system resource utilization rate in the nth test phase. n-1 This represents the system resource utilization rate during the (n-1)th test phase. The maximum step size growth factor that the remaining available system resources can support in the nth test phase; TPS n Let TPS be the number of transactions per second in the nth test phase. n-1 Let K be the number of transactions per second in the (n-1)th test phase, and K be the TPS growth rate of the nth test phase relative to the (n-1)th test phase.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when the programs are executed, control the device on which the computer-readable storage medium is located to perform the automatic location performance inflection point method according to any one of claims 1 to 6.
10. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the automatic performance inflection point method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Server complete machine performance comparison test method and device, equipment and medium
CN112506751A
Software performance testing method and device
CN113360368A
