Method, device, equipment, and medium for adjusting the response time of a stress testing system
By obtaining the response information of the previous simulated service request and using the voltage stabilization component to adjust the response time of the current request, the problem of response time fluctuation in traditional stress testing is solved, and the accuracy and stability of stress testing are improved.
Patent Information
- Application Number
- CN202211015694.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-08-23
AI Technical Summary
In traditional stress testing methods, response time is affected by factors such as system fluctuations, network fluctuations, and system degradation, resulting in fluctuations in stress testing traffic and reduced stress testing accuracy.
By obtaining the response information of the previous simulated service request, using the adjustment time and unconsumed time of the voltage stabilizing component, determining the time to be consumed and the adjustment time, and adjusting the response time of the current request so that it converges to the preset response time.
This improves stress testing accuracy, reduces response time fluctuations, and achieves a more stable stress testing process.
Smart Images

Figure CN117667614B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, device, medium, and program product for adjusting the response time of a stress testing system. Background Art
[0002] Stress testing, or stress testing, is a method used to determine system stability. It's typically conducted outside the system's normal operating range to examine the system's functional limits and potential vulnerabilities. Traditional stress testing typically involves applying stress to simulated threads and calculating the stress test flow based on the stress test system's response time.
[0003] In the process of realizing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the related technology: since the response time will be affected by various factors such as system response fluctuations, network fluctuations, system degradation, switch operations, etc., the stress testing traffic will show a constantly fluctuating state, which reduces the stress testing accuracy. Summary of the Invention
[0004] In view of this, the present disclosure provides a method, apparatus, device, medium, and program product for adjusting the response time of a stress testing system.
[0005] One aspect of the present disclosure provides a method for adjusting the response time of a stress testing system, including:
[0006] In response to the nth simulated service request, obtaining response information for the (n-1)th simulated service request from the memory, wherein the response information includes a first response duration and adjustment information, the adjustment information including a first adjustment duration consumed by the voltage stabilizing component and a first pending time not consumed by the voltage stabilizing component during a process in which the stress testing system responds to the (n-1)th simulated service request;
[0007] Determine the second to-be-consumed time based on the first response time, the preset response time, and the first to-be-consumed time. The preset response time represents the expected response time of the stress testing system for the simulated service request. The preset response time is greater than the average response time of n-1 simulated service requests, where n is a positive integer greater than 2.
[0008] Determine a second adjustment time according to the second to-be-consumed time and the first adjustment time;
[0009] The voltage stabilizing component is used to adjust the response time of the nth simulated service request according to the second adjustment time.
[0010] According to an embodiment of the present disclosure, determining the second to-be-consumed time according to the first response time, the preset response time, and the first to-be-consumed time includes:
[0011] Determine the response deviation time of the (n-1)th simulated service request based on the first response time and the preset response time;
[0012] The second to-be-consumed time length is determined according to the response deviation time length and the first to-be-consumed time length.
[0013] According to an embodiment of the present disclosure, determining the second adjustment time according to the second to-be-consumed time and the first adjustment time includes:
[0014] When the second waiting time is less than the first adjustment time, the difference between the first adjustment time and the second waiting time is determined as the second adjustment time;
[0015] When the second waiting time is greater than the first adjustment time, the second adjustment time is determined to be zero.
[0016] According to an embodiment of the present disclosure, the method for adjusting the response time of the stress testing system further includes:
[0017] A third time to be consumed is determined according to the second time to be consumed and the first adjustment time. The third time to be consumed represents the remaining time recorded in the voltage stabilizing component after the second adjustment time is consumed by the voltage stabilizing component.
[0018] According to an embodiment of the present disclosure, determining a third time to be consumed based on the second time to be consumed and the first adjustment time includes:
[0019] When the second waiting time is less than the first adjustment time, the third waiting time is determined to be zero;
[0020] When the second waiting time is longer than the first adjusted time, the difference between the second waiting time and the first adjusted time is determined as the third waiting time.
[0021] According to an embodiment of the present disclosure, the method for adjusting the response time of the stress testing system further includes:
[0022] The third to-be-consumed time and the second adjustment time are overwritten and written into the memory, so as to be used for performing an adjustment operation on the response time of the (n+1)th simulated service request.
[0023] According to an embodiment of the present disclosure, using a voltage stabilizing component, adjusting the response time of the nth simulated service request according to the second adjustment time includes:
[0024] In response to the nth simulated service request, record the request start time information;
[0025] When the response to the nth simulated service request is completed, the second adjustment time is consumed by the voltage stabilizing component;
[0026] Determine the request end time based on the stress test start time and the second adjustment duration.
[0027] The adjusted response time of the nth simulated service request is determined based on the stress test start time information and the stress test end time information.
[0028] Another aspect of the present disclosure provides an apparatus for adjusting the response time of a stress testing system, comprising: an acquisition module, a first determination module, a second determination module, and an adjustment module. The acquisition module is configured to, in response to an nth simulated service request, obtain response information for an n-1th simulated service request from a memory, wherein the response information includes a first response time and adjustment information, wherein the adjustment information includes a first adjustment time consumed by a voltage stabilization component and a first pending time not consumed by the voltage stabilization component during the stress testing system's response to the n-1th simulated service request, where n is a positive integer greater than 2. The first determination module is configured to determine a second pending time based on the first response time, a preset response time, and the first pending time, wherein the preset response time represents the expected response time for each simulated service request and is greater than the average response time of the n simulated service requests. The second determination module is configured to determine a second adjustment time based on the second pending time and the first adjustment time. The adjustment module is configured to adjust the response time of the nth simulated service request using the voltage stabilization component based on the second adjustment time.
[0029] According to an embodiment of the present disclosure, the first determination module includes a first determination unit and a second determination unit. The first determination unit is configured to determine a response deviation duration for the (n-1)th simulated service request based on the first response duration and the preset response duration. The second determination unit is configured to determine a second pending duration based on the response deviation duration and the first pending duration.
[0030] According to an embodiment of the present disclosure, the second determination module includes a third determination unit and a fourth determination unit. The third determination unit is configured to determine the difference between the first adjusted time length and the second adjusted time length as the second adjusted time length if the second time length to be consumed is less than the first adjusted time length. The fourth determination unit is configured to determine the second adjusted time length to be zero if the second time length to be consumed is greater than the first adjusted time length.
[0031] According to an embodiment of the present disclosure, the above-mentioned device for adjusting the response time of the pressure measurement system also includes a third determination module, which is used to determine the third time to be consumed based on the second time to be consumed and the first adjustment time. The third time to be consumed represents the remaining time recorded in the voltage stabilizing component after the second adjustment time is consumed by the voltage stabilizing component.
[0032] According to an embodiment of the present disclosure, the third determination module includes a fifth determination unit and a sixth determination unit. The fifth determination unit is configured to determine that the third to-be-consumed time is zero if the second to-be-consumed time is less than the first adjusted time. The sixth determination unit is configured to determine that the difference between the second to-be-consumed time and the first adjusted time is the third to-be-consumed time if the second to-be-consumed time is greater than the first adjusted time.
[0033] According to an embodiment of the present disclosure, the above-mentioned device for adjusting the response time of the stress testing system also includes a storage module, which is used to overwrite the third to-be-consumed time and the second adjustment time into the memory, and is used to perform the adjustment operation of the response time of the n+1th simulated service request.
[0034] According to an embodiment of the present disclosure, the adjustment module includes a recording unit, a consumption unit, a seventh determination unit, and an eighth determination unit. The recording unit is used to record the request start time information in response to the nth simulated service request. The consumption unit is used to consume the second adjustment duration using the voltage stabilizing component when the response to the nth simulated service request ends. The seventh determination unit is used to determine the request end time information based on the stress test start time and the second adjustment duration. The eighth determination unit is used to determine the response duration of the nth simulated service request after adjustment based on the stress test start time information and the stress test end time information.
[0035] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the method described in the embodiment of the present disclosure.
[0036] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described in the embodiments of the present disclosure when executed.
[0037] Another aspect of the present disclosure provides a computer program product, which includes computer-executable instructions. When the instructions are executed, they are used to implement the method described in the embodiments of the present disclosure.
[0038] According to an embodiment of the present disclosure, a technical means is provided for determining a second to-be-consumed time by using the first response time in the response information of the n-1th simulated service request, the first unconsumed time to be consumed in the voltage stabilizing component, and the preset response time, and then determining a second adjustment time based on the second to-be-consumed time and the first adjustment time. The voltage stabilizing component is used to adjust the response time of the nth simulated service request based on the second adjustment time. Since the voltage stabilizing component is used to adjust the response time of the nth simulated service request based on the unconsumed time in the response information of the n-1th simulated service request, the response time of each simulated service request during the stress test converges to the preset response time. This at least partially overcomes the technical problem of response time fluctuations in the stress test system, thereby achieving the technical effect of improving stress test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0040] Figure 1 The following schematically illustrates an exemplary system architecture to which the method for adjusting the response time of a stress testing system disclosed herein can be applied;
[0041] Figure 2 A flowchart of a method for adjusting the response time of a stress measurement system according to an embodiment of the present disclosure is schematically shown;
[0042] Figure 3 Schematically shows a flow chart of a method for determining a second to-be-consumed time according to an embodiment of the present disclosure;
[0043] Figure 4 The following schematically shows a logic block diagram of a method for adjusting the response time of a stress testing system according to an embodiment of the present disclosure;
[0044] Figure 5 A block diagram schematically illustrates a device for adjusting the response duration of a stress measurement system according to an embodiment of the present disclosure; and
[0045] Figure 6 A block diagram of an electronic device suitable for implementing a method for adjusting the response duration of a stress measurement system according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0046] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0047] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0048] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0049] When expressions such as "at least one of A, B and C, etc." are used, they should generally be interpreted in accordance with the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0050] In the process of implementing the embodiments of the present disclosure, the inventors discovered that in the traditional stress testing mode, since the stress testing flow is determined based on the quotient of the request thread and the response time, the response time will fluctuate with the fluctuation of the system, causing the stress testing flow to also be in a fluctuating state, and the stress testing accuracy is low. In the case of a sudden drop in all response times, the stress testing flow will suddenly increase, which will cause online accidents. In order to solve this problem, manual real-time regulation is generally adopted. However, the timeliness of manual regulation is poor, which will only increase the stress testing response time and reduce the stress testing efficiency.
[0051] In view of this, an embodiment of the present disclosure provides a method for adjusting the response time of a stress testing system, which uses the first response time in the response information of the n-1th simulated service request, the first unconsumed time to be consumed in the voltage stabilization component, and the preset response time to determine the second time to be consumed, and then determines the second adjustment time based on the second time to be consumed and the first adjustment time, and uses the voltage stabilization component to adjust the response time of the nth simulated service request based on the second adjustment time. Since the voltage stabilization component is used to adjust the response time of the nth simulated service request according to the unconsumed time in the response information of the n-1 simulated service request, the response time of each simulated service request during the stress testing process converges to the preset response time, thereby at least partially overcoming the technical problem of response time fluctuation of the stress testing system, thereby achieving the technical effect of improving the stress testing accuracy.
[0052] Figure 1 The following schematically illustrates an exemplary system architecture 100 that can be used to adjust the response time of a stress testing system according to an embodiment of the present disclosure. Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.
[0053] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0054] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).
[0055] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0056] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0057] It should be noted that the method for adjusting the response time of the stress testing system provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the device for adjusting the response time of the stress testing system provided in the embodiment of the present disclosure can generally be set in the server 105. The method for adjusting the response time of the stress testing system provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the device for adjusting the response time of the stress testing system provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0058] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0059] Figure 2 The flowchart of the method for adjusting the response time of the stress testing system according to an embodiment of the present disclosure is schematically shown.
[0060] like Figure 2 As shown, the method includes operations S210 to S240.
[0061] In operation S210, in response to the nth simulated service request, response information of the n-1th simulated service request is obtained from the memory, wherein the response information includes a first response duration and adjustment information, and the adjustment information includes a first adjustment duration consumed by the voltage stabilizing component and a first to-be-consumed duration not consumed by the voltage stabilizing component in the process of the stress testing system responding to the n-1th simulated service request, wherein n is a positive integer greater than 2.
[0062] According to an embodiment of the present disclosure, the initial values of the first adjustment time length and the unconsumed first to-be-consumed time length recorded in the voltage stabilizing component may be 0. The first response time length AT n-1 It can be the total duration from the start time to the end time of the n-1th simulated service request. The total duration can include the actual duration T of the stress testing system responding to the n-1th simulated service request. n-1 And the time LT adjusted by the voltage regulator n-1The first waiting time RT n-1 It may be the remaining time in the voltage stabilizing component after the voltage stabilizing component has adjusted the response time of the (n-1)th simulated service request.
[0063] In operation S220, a second to-be-consumed time is determined based on the first response time, the preset response time, and the first to-be-consumed time. The preset response time represents the expected response time of the stress testing system for the simulated service request, and the preset response time is greater than the average response time of n-1 simulated service requests.
[0064] According to embodiments of the present disclosure, the preset response time TT may be the expected response time of the stress testing system for a simulated service request. This preset response time TT is the expected stable value of the stress testing system's response time, achieved through regulation by the voltage stabilization component. This value can be determined based on empirical data or the average response time during an actual stress testing process. For example, if the average response time for a simulated service request is 180ms, the preset response time may be set to 200ms.
[0065] According to an embodiment of the present disclosure, according to the first response time AT n-1 , preset response time TT and first waiting time RT n-1 , determine the second waiting time RT n The second waiting time RT represents the total waiting time that can be consumed in the voltage stabilizing component for the nth simulated service request. n It can be calculated using formula (1):
[0066] RT n =AT n-1 -TT+RT n-1 (one)
[0067] In operation S230 , a second adjusted time period is determined according to the second to-be-consumed time period and the first adjusted time period.
[0068] According to an embodiment of the present disclosure, the initial value of the first adjustment time length may be a preset response time length TT. n and the first adjustment time LT n-1 , determine the second waiting time RT remaining in the voltage stabilization component that can be consumed when the stress test system responds to the nth simulated service request n Is it possible to adjust the first adjustment time LT according to the n-1th simulated service request? n-1 Continue to adjust. When the first adjustment time is LT n-1 Less than the second waiting time RT nSince the adjustment time of the voltage stabilizing component cannot be less than 0, in this case, the nth simulation service request does not require the voltage stabilizing component to adjust the response time, that is, the second adjustment time is 0, and the remaining time to be consumed (RT n -LT n-1 ) can be used to adjust the response time of the n+1th simulated service request. n-1 Greater than the second waiting time RT n When , it means that the nth simulation service request requires the voltage stabilizing component to adjust the response time, that is, the second adjustment time is LT n-1 -RT n .
[0069] In operation S240 , the voltage stabilizing component is used to adjust the response time of the n-th simulated service request according to the second adjustment time.
[0070] According to an embodiment of the present disclosure, a voltage stabilization component can be set in a stress test tool, and in the process of the stress test system responding to the nth simulated service request, the response time of the nth simulated service request can be adjusted according to the second adjustment time. For example, the response time XT of the stress test system responding to the nth simulated service request can be set to XT. n Add the second adjustment time LT n-1 -RT n .
[0071] According to an embodiment of the present disclosure, a technical means is provided for determining a second to-be-consumed time by using the first response time in the response information of the n-1th simulated service request, the first unconsumed time to be consumed in the voltage stabilizing component, and the preset response time, and then determining a second adjustment time based on the second to-be-consumed time and the first adjustment time. The voltage stabilizing component is used to adjust the response time of the nth simulated service request based on the second adjustment time. Since the voltage stabilizing component is used to adjust the response time of the nth simulated service request based on the unconsumed time in the response information of the n-1th simulated service request, the response time of each simulated service request during the stress test converges to the preset response time. This at least partially overcomes the technical problem of response time fluctuations in the stress test system, thereby achieving the technical effect of improving stress test accuracy.
[0072] Reference below Figures 3 and 4 , combined with specific embodiments Figure 2 The method shown is further explained.
[0073] Figure 3 A flowchart of a method for determining a second to-be-consumed time according to an embodiment of the present disclosure is schematically shown.
[0074] like Figure 3 As shown, this embodiment includes S310 to S320.
[0075] In operation S310 , a response deviation duration of the (n−1)th simulated service request is determined according to the first response duration and the preset response duration.
[0076] According to an embodiment of the present disclosure, the response deviation duration of the (n-1)th simulated service request can be calculated according to formula (2):
[0077] ST n-1 =AT n-1 -TT (2)
[0078] Among them, ST n-1 Indicates the response deviation time of the n-1th simulated service request; AT n-1 It indicates the first response time of the (n-1)th simulated service request; TT indicates the preset response time.
[0079] According to an embodiment of the present disclosure, for example: the first response time of the n-1th simulated service request can be 230ms, and the preset response time can be 200ms. Then, according to formula (2), the response deviation time of the n-1th simulated service request can be calculated to be 30ms.
[0080] In operation S320 , a second waiting time is determined according to the response deviation time and the first waiting time.
[0081] According to an embodiment of the present disclosure, the second waiting time of the n-th simulated service request can be calculated according to formula (3):
[0082] RT n =ST n-1 +RT n-1 (three)
[0083] Among them, RT n Indicates the second waiting time of the nth simulated service request; ST n-1 Indicates the response deviation time of the n-1th simulated service request; RT n-1 Indicates the first waiting time of the (n-1)th simulated service request.
[0084] According to an embodiment of the present disclosure, for example, the first waiting time of the (n-1)th simulated service request may be 10 ms, and then according to formula (3), the second waiting time of the (n)th simulated service request may be 40 ms.
[0085] According to an embodiment of the present disclosure, the to-be-consumed time that can be used for the n-th simulated service request is determined by the response deviation time of the n-1th simulated service request and the first to-be-consumed time that is not consumed by the voltage stabilizing component in the n-1th simulated service request. Since the to-be-consumed time consumed by the n-1th simulated service request is regulated in real time by utilizing the stress test response time information of the n-1th simulated service request, regulation that does not rely on human subjective factors can be achieved, so that the stress test response time tends to be stable continuously, thereby improving the stress test accuracy.
[0086] According to an embodiment of the present disclosure, determining the second adjustment time according to the second to-be-consumed time and the first adjustment time includes:
[0087] When the second waiting time is less than the first adjustment time, the difference between the first adjustment time and the second waiting time is determined as the second adjustment time;
[0088] When the second waiting time is greater than the first adjustment time, the second adjustment time is determined to be zero.
[0089] According to an embodiment of the present disclosure, in the second waiting time RT n Less than the first adjustment time LT n-1 In the case of, the second adjustment time LT can be determined according to formula (4): n .
[0090] LT n =LT n-1 -RT n (Four)
[0091] According to an embodiment of the present disclosure, for example, if the second waiting time is 40 ms and the first adjustment time is 60 ms, it can be determined that the second adjustment time is 10 ms.
[0092] According to embodiments of the present disclosure, when the second pending time is longer than the first adjustment time, since the second adjustment time obtained according to formula (4) is less than 0, the remaining time can be used to adjust the response time of the (n+1)th simulated service request, and the adjustment time of the nth simulated service request is 0. For example, if the second pending time is 40ms and the first adjustment time is 30ms, the second adjustment time can be determined to be 0, that is, for the nth simulated service request, there is no need to use the voltage stabilization component to increase the response time of the stress testing system.
[0093] According to an embodiment of the present disclosure, the second adjustment time is determined based on the second waiting time and the first adjustment time. Since the stress test response time information of the n-1th simulated service request is used to determine in real time whether the voltage stabilizing component needs to adjust the stress test system response time, it is possible to achieve regulation that does not rely on human subjective factors, so that the stress test response time continues to stabilize, thereby improving the stress test.
[0094] According to an embodiment of the present disclosure, the method for adjusting the response time of the stress testing system further includes:
[0095] A third time to be consumed is determined according to the second time to be consumed and the first adjustment time. The third time to be consumed represents the remaining time recorded in the voltage stabilizing component after the second adjustment time is consumed by the voltage stabilizing component.
[0096] According to an embodiment of the present disclosure, the second waiting time RT n and the first adjustment time LT n-1 , determine the third waiting time. For example: when the second waiting time RT n Less than the first adjustment time LT n-1 At this time, the second adjustment time LT n LT n-1 -RT n , indicating that in the nth simulated service request, after the voltage stabilization component has adjusted the response time of the stress testing system, the remaining time to be consumed in the voltage stabilization component has been consumed. Therefore, it can be determined that the third time to be consumed is 0.
[0097] According to the embodiments of the present disclosure, by updating the pending time recorded in the voltage stabilization component in real time and automatically adjusting the unconsumed pending time in the voltage stabilization component for the n+1th simulated service request, it is possible to automatically adjust the response time of the stress testing system for each simulated service request in real time without changing the response time of the overall simulated service request, so that it continuously approaches stability, thereby improving the stress testing accuracy.
[0098] According to an embodiment of the present disclosure, determining a third time to be consumed based on the second time to be consumed and the first adjustment time includes:
[0099] When the second waiting time is less than the first adjustment time, the third waiting time is determined to be zero;
[0100] When the second waiting time is longer than the first adjusted time, the difference between the second waiting time and the first adjusted time is determined as the third waiting time.
[0101] According to an embodiment of the present disclosure, for example: the second waiting time is 30ms, the first adjustment time is 40ms, and according to formula (4), the second adjustment time can be determined to be 10ms, which means that at this time, the remaining time in the voltage stabilizing component is 0, and the third waiting time can be determined to be zero.
[0102] According to an embodiment of the present disclosure, the second waiting time RTn is greater than the first adjustment time LT n-1 In the case of , the third waiting time RT can be calculated according to formula (5)n* .
[0103] RT n* =RT n -LT n-1 (five)
[0104] Among them, RT n* Indicates the third waiting time; RT n Indicates the second waiting time; LT n-1 Indicates the first adjustment duration.
[0105] According to the embodiments of the present disclosure, by updating the pending time recorded in the voltage stabilization component in real time and automatically adjusting the unconsumed pending time in the voltage stabilization component for the n+1th simulated service request, it is possible to automatically adjust the response time of the stress testing system for each simulated service request in real time without changing the response time of the overall simulated service request, so that it continuously approaches stability, thereby improving the stress testing accuracy.
[0106] According to an embodiment of the present disclosure, the above-mentioned method for adjusting the response time of the stress testing system also includes: overwriting the third to-be-consumed time and the second adjustment time into the memory to perform the adjustment operation of the response time of the n+1th simulated service request.
[0107] According to an embodiment of the present disclosure, in order to not affect the actual response time of the stress testing system itself when using the voltage stabilization component to adjust the response time of the stress testing system, the embodiment of the present disclosure adopts map storage in Java to store the adjustment time of each simulated service request and the unconsumed time in the voltage stabilization component, which can also be called the remaining time.
[0108] According to an embodiment of the present disclosure, due to the characteristics of map storage in Java, it is necessary to overwrite the time to be consumed and the adjustment time after each update into the map storage, and then obtain the corresponding time to be consumed and the adjustment time from the memory when performing the adjustment operation.
[0109] According to an embodiment of the present disclosure, for example, in response to the nth simulation service request, the first to-be-consumed time RT is obtained from the map storage. n-1 , and then RT calculated according to formula (1) in the embodiment of the present disclosure n First overwrite the time to be consumed in the map storage, and then get the RT from the map storage n , used to determine the second adjustment time LT n Then the second adjustment time LT nThen overwrite the map storage of the adjustment duration and update the adjustment duration in the map storage of the adjustment duration to the adjustment duration of the nth simulated service request, so that the n+1th simulated service request can be obtained from the map storage of the adjustment duration according to the method of the embodiment of the present disclosure.
[0110] According to an embodiment of the present disclosure, the third to-be-consumed time and the second adjustment time are overwritten and written into the memory, so that the nth simulated service request uses the adjustment information of the n-1th simulated service request to determine the adjustment status of the stress testing system response time of the nth simulated service request, thereby achieving the purpose of automatic control and precise stress testing.
[0111] According to an embodiment of the present disclosure, using a voltage stabilizing component, adjusting the response time of the nth simulated service request according to the second adjustment time includes:
[0112] In response to the nth simulated service request, record the request start time information;
[0113] When the response to the nth simulated service request is completed, the second adjustment time is consumed by the voltage stabilizing component;
[0114] Determine the request end time based on the stress test start time and the second adjustment duration.
[0115] The adjusted response time of the nth simulated service request is determined based on the stress test start time information and the stress test end time information.
[0116] According to an embodiment of the present disclosure, for example, in response to the nth simulated service request, the request start time information ST1 is recorded. The request start time information can be the specific time when the request starts recorded by the stress testing system.
[0117] According to an embodiment of the present disclosure, for example, the end time of the stress test system responding to the nth simulated service request is ST2. According to the method for adjusting the response time of the stress test system provided in an embodiment of the present disclosure, the second adjustment time is determined to be LT n LT can be extended based on the end time ST2 n Duration.
[0118] According to an embodiment of the present disclosure, for example: LT n It can be 10ms, and the request end time information ST3 can be determined as the time information obtained by extending the end time ST2 by 10ms.
[0119] According to an embodiment of the present disclosure, the adjusted response duration of the nth simulated service request may be the difference between the request end time ST3 and the request start time ST1 obtained by adjusting the voltage stabilizing component.
[0120] According to an embodiment of the present disclosure, by recording the start time and the end time of the request, the response time of the stress testing system of the nth simulated service request after adjustment by the voltage stabilizing component is determined, so as to calculate the deviation time between the response time of the stress testing system of the nth simulated service request and the preset response time, and determine the time that needs to be adjusted for the n+1th simulated service request. This cycle is repeated so that the response time continuously converges to the preset response time, that is, tends to a stable value, thereby realizing accurate traffic stress testing.
[0121] Figure 4 A logical block diagram of a method for adjusting the response time of a stress testing system according to an embodiment of the present disclosure is schematically shown.
[0122] like Figure 4 As shown, this embodiment includes operations S401 to S408
[0123] In operation S401, in response to the nth simulated service request, response information for the (n-1)th simulated service request is retrieved from a memory, wherein the response information includes a first response duration and adjustment information, wherein the adjustment information includes a first adjustment duration consumed by a voltage stabilizing component and a first pending time duration not consumed by the voltage stabilizing component during a process in which the stress testing system responds to the (n-1)th simulated service request, where n is a positive integer greater than 2.
[0124] In operation S402, a second to-be-consumed time is determined based on the first response time, the preset response time, and the first to-be-consumed time, where the preset response time represents the expected response time of the stress testing system to the simulated service request, and the preset response time is greater than the average response time of n-1 simulated service requests.
[0125] In operation S403 , it is determined whether the second to-be-consumed time is less than the first adjustment time. If so, S404 is executed; otherwise, S406 is executed.
[0126] In operation S404 , the difference between the first adjustment time and the second to-be-consumed time is determined as the second adjustment time, and the third to-be-consumed time is determined to be zero.
[0127] In operation S405 , the second adjusted duration and the third to-be-consumed duration determined in operation S404 are overwritten and written into the adjusted duration memory and the to-be-consumed duration memory, respectively.
[0128] In operation S406 , the second adjustment time is determined to be zero, and the difference between the second to-be-consumed time and the first adjustment time is determined as a third to-be-consumed time.
[0129] In operation S407 , the second adjusted duration and the third to-be-consumed duration determined in operation S406 are overwritten and written into the adjusted duration memory and the to-be-consumed duration memory, respectively.
[0130] In operation S408 , the voltage stabilizing component is used to adjust the response time of the n-th simulated service request according to the second adjustment time.
[0131] Based on the above method for adjusting the response time of the stress measurement system, the present disclosure also provides a device for adjusting the response time of the stress measurement system. Figure 5 The device is described in detail.
[0132] Figure 5 The structural block diagram of the device for adjusting the response time of the stress measurement system according to an embodiment of the present disclosure is schematically shown.
[0133] like Figure 5 As shown, the apparatus 500 for adjusting the response time of a stress testing system in this embodiment includes an acquisition module 510 , a first determination module 520 , a second determination module 530 , and an adjustment module 540 .
[0134] The acquisition module 510 is configured to obtain, from a memory, response information for the (n-1)th simulated service request in response to the (n)th simulated service request, wherein the response information includes a first response duration and adjustment information, wherein the adjustment information includes a first adjustment duration consumed by the voltage stabilizing component and a first pending duration not consumed by the voltage stabilizing component during the stress testing system's response to the (n-1)th simulated service request, where n is a positive integer greater than 2. In one embodiment, the acquisition module 510 may be configured to execute operation S210 described above, and will not be further described herein.
[0135] The first determination module 520 is configured to determine a second to-be-consumed time based on the first response time, a preset response time, and the first to-be-consumed time, wherein the preset response time represents an expected response time for each simulated service request, and the preset response time is greater than an average response time of n simulated service requests. In one embodiment, the first determination module 520 can be configured to perform operation S220 described above, which will not be further described herein.
[0136] The second determining module 530 is configured to determine the second adjusted duration according to the second to-be-consumed duration and the first adjusted duration. In one embodiment, the second determining module 530 may be configured to execute the operation S230 described above, which will not be described in detail herein.
[0137] The adjustment module 540 is used to use the voltage stabilizing component to adjust the response time of the nth simulated service request according to the second adjustment time. In one embodiment, the adjustment module 540 can be used to perform the operation S240 described above, which will not be repeated here.
[0138] According to an embodiment of the present disclosure, the first determination module includes a first determination unit and a second determination unit. The first determination unit is configured to determine a response deviation duration for the (n-1)th simulated service request based on the first response duration and the preset response duration. The second determination unit is configured to determine a second pending duration based on the response deviation duration and the first pending duration.
[0139] According to an embodiment of the present disclosure, the second determination module includes a third determination unit and a fourth determination unit. The third determination unit is configured to determine the difference between the first adjusted time length and the second adjusted time length as the second adjusted time length if the second time length to be consumed is less than the first adjusted time length. The fourth determination unit is configured to determine the second adjusted time length to be zero if the second time length to be consumed is greater than the first adjusted time length.
[0140] According to an embodiment of the present disclosure, the above-mentioned device for adjusting the response time of the pressure measurement system also includes a third determination module, which is used to determine the third time to be consumed based on the second time to be consumed and the first adjustment time. The third time to be consumed represents the remaining time recorded in the voltage stabilizing component after the second adjustment time is consumed by the voltage stabilizing component.
[0141] According to an embodiment of the present disclosure, the third determination module includes a fifth determination unit and a sixth determination unit. The fifth determination unit is configured to determine that the third to-be-consumed time is zero if the second to-be-consumed time is less than the first adjusted time. The sixth determination unit is configured to determine that the difference between the second to-be-consumed time and the first adjusted time is the third to-be-consumed time if the second to-be-consumed time is greater than the first adjusted time.
[0142] According to an embodiment of the present disclosure, the above-mentioned device for adjusting the response time of the stress testing system also includes a storage module, which is used to overwrite the third to-be-consumed time and the second adjustment time into the memory, and is used to perform the adjustment operation of the response time of the n+1th simulated service request.
[0143] According to an embodiment of the present disclosure, the adjustment module includes a recording unit, a consumption unit, a seventh determination unit, and an eighth determination unit. The recording unit is used to record the request start time information in response to the nth simulated service request. The consumption unit is used to consume the second adjustment duration using the voltage stabilizing component when the response to the nth simulated service request ends. The seventh determination unit is used to determine the request end time information based on the stress test start time and the second adjustment duration. The eighth determination unit is used to determine the response duration of the nth simulated service request after adjustment based on the stress test start time information and the stress test end time information.
[0144] According to the modules and units of the embodiments of the present invention, any multiple or at least part of the functions of any multiple thereof can be implemented in one module. According to the modules and units of the embodiments of the present invention, any one or more can be split into multiple modules for implementation. According to the modules and units of the embodiments of the present invention, any one or more can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any several thereof. Alternatively, according to the modules and units of the embodiments of the present invention, one or more can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.
[0145] For example, any multiple of the acquisition module 510, the first determination module 520, the second determination module 530, and the adjustment module 540 can be combined into one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the acquisition module 510, the first determination module 520, the second determination module 530, and the adjustment module 540 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the acquisition module 510 , the first determination module 520 , the second determination module 530 , and the adjustment module 540 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0146] Figure 6 A block diagram of an electronic device suitable for implementing the above-described method according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0147] like Figure 6As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0148] Various programs and data required for the operation of the electronic device 600 are stored in the RAM 603. The processor 601, ROM 602, and RAM 603 are connected to each other via a bus 604. The processor 601 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0149] According to an embodiment of the present disclosure, electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to bus 604. System 600 may also include one or more of the following components connected to I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 608 including a hard disk; and a communication section 609 including a network interface card such as a LAN card or a modem. Communication section 609 performs communication processing via a network such as the Internet. Drive 610 is also connected to I / O interface 605 as needed. Removable media 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in drive 610 as needed, so that computer programs read from the removable media can be installed into storage section 608 as needed.
[0150] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0151] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.
[0152] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0153] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .
[0154] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0155] Those skilled in the art will appreciate that various combinations and / or combinations of features described in the various embodiments and / or claims of this disclosure may be made, even if such combinations or combinations are not explicitly described in this disclosure. In particular, various combinations and / or combinations of features described in the various embodiments and / or claims of this disclosure may be made, without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0156] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for adjusting the response time of a stress testing system, comprising: In response to the nth simulated service request, obtaining response information for the (n-1)th simulated service request from the memory, wherein the response information includes a first response duration and adjustment information, wherein the adjustment information includes a first adjustment duration consumed by the voltage stabilizing component and a first pending time duration not consumed by the voltage stabilizing component during a process in which the stress testing system responds to the (n-1)th simulated service request, wherein n is a positive integer greater than 2; Determining a second to-be-consumed time based on the first response time, a preset response time, and the first to-be-consumed time, wherein the preset response time represents an expected response time of the stress testing system to the simulated service request, and the preset response time is greater than an average response time of n-1 simulated service requests; Determining a second adjustment time according to the second to-be-consumed time and the first adjustment time; The voltage stabilizing component is used to adjust the response duration of the n-th simulated service request according to the second adjustment duration.
2. The method according to claim 1, wherein The determining the second to-be-consumed time according to the first response time, the preset response time, and the first to-be-consumed time includes: Determine a response deviation duration for the (n-1)th simulated service request based on the first response duration and the preset response duration; The second to-be-consumed time is determined according to the response deviation time and the first to-be-consumed time.
3. The method according to claim 1, wherein The determining the second adjustment time according to the second to-be-consumed time and the first adjustment time includes: If the second waiting time is less than the first adjustment time, the difference between the first adjustment time and the second waiting time is determined as the second adjustment time; When the second waiting time is greater than the first adjustment time, the second adjustment time is determined to be zero.
4. The method according to claim 3, further comprising: A third time to be consumed is determined according to the second time to be consumed and the first adjustment time. The third time to be consumed represents the remaining time recorded in the voltage stabilizing component after the second adjustment time is consumed by the voltage stabilizing component.
5. The method according to claim 4, wherein The determining, based on the second to-be-consumed time and the first adjusted time, a third to-be-consumed time includes: When the second waiting time is less than the first adjustment time, determining the third waiting time to be consumed to be zero; When the second waiting time is greater than the first adjustment time, the difference between the second waiting time and the first adjustment time is determined as the third waiting time.
6. The method according to claim 5, further comprising: The third to-be-consumed time and the second adjustment time are overwritten and written into the memory, so as to be used to perform an adjustment operation on the response time of the (n+1)th simulated service request.
7. The method according to claim 1, wherein The step of adjusting the response time of the nth simulated service request according to the second adjustment time by using the voltage stabilizing component includes: In response to the nth simulated service request, recording request start time information; When the response to the nth simulated service request is completed, using the voltage stabilizing component to consume the second adjustment time; Determining request end time information based on the stress test start time and the second adjustment duration; Determine the adjusted response duration of the nth simulated service request according to the stress test start time information and the stress test end time information.
8. A device for adjusting the response time of a stress testing system, comprising: an acquisition module, configured to, in response to the nth simulated service request, acquire, from a memory, response information for the (n-1)th simulated service request, wherein the response information includes a first response duration and adjustment information, wherein the adjustment information includes a first adjustment duration consumed by a voltage stabilizing component and a first pending time duration not consumed by the voltage stabilizing component during a process in which the stress testing system responds to the (n-1)th simulated service request, wherein n is a positive integer greater than 2; a first determining module, configured to determine a second to-be-consumed time according to the first response time, a preset response time, and the first to-be-consumed time, wherein the preset response time represents an expected response time for each simulated service request, and the preset response time is greater than an average response time of n simulated service requests; a second determining module, configured to determine a second adjustment duration according to the second to-be-consumed time and the first adjustment time; An adjustment module is used to use the voltage stabilizing component to adjust the response time of the nth simulated service request according to the second adjustment time.
9. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having executable instructions stored thereon, wherein when the instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Session management method and device, terminal equipment and computer readable storage medium
CN112492704A
Server power consumption test method and device
CN113961413A