CN114490374A - Applied stress testing methods, electronic equipment, storage media and program products - Google Patents
Applied stress testing methods, electronic equipment, storage media and program products Download PDFInfo
- Publication number
- CN114490374A CN114490374A CN202210073140.6A CN202210073140A CN114490374A CN 114490374 A CN114490374 A CN 114490374A CN 202210073140 A CN202210073140 A CN 202210073140A CN 114490374 A CN114490374 A CN 114490374A
- Authority
- CN
- China
- Prior art keywords
- test
- stress
- pressure value
- resources
- resource
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 137
- 238000009662 stress testing Methods 0.000 title claims abstract description 89
- 238000012360 testing method Methods 0.000 claims abstract description 253
- 238000004891 communication Methods 0.000 claims description 14
- 238000013101 initial test Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 11
- 239000000243 solution Substances 0.000 description 11
- 239000012085 test solution Substances 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 230000007423 decrease Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3698—Environments for analysis, debugging or testing of software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Tests Of Electronic Circuits (AREA)
Abstract
本申请实施例提供了一种应用的压力测试方法、电子设备、存储介质及程序产品,应用的压力测试方法,其中,方法包括:在压力测试过程中,确定针对待测应用的目标压力值;根据当前压力值与目标压力值确定变更的资源量,并根据变更的资源量生成资源调度请求;发送资源调度请求至调度单元,以通过调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照目标压力值对所述待测应用进行压力测试。
The embodiments of the present application provide an applied stress testing method, an electronic device, a storage medium and a program product, and an applied stress testing method, wherein the method includes: during the stress testing process, determining a target stress value for the application to be tested; Determine the changed resource amount according to the current pressure value and the target pressure value, and generate a resource scheduling request according to the changed resource amount; send the resource scheduling request to the scheduling unit, and use the scheduling unit to schedule the stress test process according to the changed resource amount for the stress test process. resources for stress testing, and perform stress testing on the application under test according to the target stress value.
Description
技术领域technical field
本申请实施例涉及计算机技术领域,尤其涉及一种应用的压力测试方法、电子设备、存储介质及程序产品。The embodiments of the present application relate to the field of computer technology, and in particular, to an applied stress testing method, an electronic device, a storage medium, and a program product.
背景技术Background technique
压力测试可模拟实际应用的软硬件环境及用户使用过程的系统负荷,长时间或超大负荷地运行待测应用,来测试待测应用的性能、可靠性、稳定性、网络性能等。通常,进行压力测试时,需要测试者指定压力测试上限,测试单元可以根据压力测试上限确定本次压力测试所需要的资源,在资源就绪后可以进行压力测试,且在一次压力测试过程中无法修改资源。The stress test can simulate the software and hardware environment of the actual application and the system load of the user's use process, and run the application under test for a long time or under a heavy load to test the performance, reliability, stability, and network performance of the application under test. Usually, when performing a stress test, the tester is required to specify the upper limit of the stress test. The test unit can determine the resources required for this stress test according to the upper limit of the stress test. After the resources are ready, the stress test can be performed, and cannot be modified during a stress test. resource.
但是,压力测试上限是用户根据自身经验设置的,为了保证能够顺利得到测试对象的参数,需要设置较高的压力测试上限,导致测试资源的利用率较低。However, the upper limit of the stress test is set by the user based on their own experience. In order to ensure that the parameters of the test object can be obtained smoothly, a higher upper limit of the stress test needs to be set, resulting in a low utilization rate of test resources.
有鉴于此,现有技术亟需解决的技术问题是如何提供一种资源利用率较高的压力测试方案的方案。In view of this, an urgent technical problem to be solved in the prior art is how to provide a stress test solution with high resource utilization.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请实施例提供一种应用的压力测试方案,以至少部分解决上述问题。In view of this, the embodiments of the present application provide an applied stress test solution to at least partially solve the above problems.
根据本申请实施例的第一方面,提供了一种应用的压力测试方法,其中,所述方法包括:在压力测试过程中,确定针对待测应用的目标压力值;根据当前压力值与所述目标压力值确定变更的资源量,并根据变更的资源量生成资源调度请求;发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值对所述待测应用进行压力测试。According to a first aspect of the embodiments of the present application, an application pressure testing method is provided, wherein the method includes: during the pressure testing process, determining a target pressure value for the application to be tested; The target pressure value determines the changed resource amount, and generates a resource scheduling request according to the changed resource amount; sends the resource scheduling request to the scheduling unit, so that the scheduling unit can schedule the stress test process according to the changed resource amount for stress testing. test resources, and perform a stress test on the application to be tested according to the target pressure value.
根据本申请实施例的第二方面,提供了一种应用的压力测试方法,其中,所述方法包括:获得用户输入的初始测试信息,所述初始测试信息中包括初始压力值且不包括压力测试上限;确定按照所述初始压力值进行压力所对应的初始资源量并调度资源,以按照所述初始压力值开始对待测应用进行压力测试;在压力测试过程中,确定针对所述待测应用的目标压力值;根据当前压力值与所述目标压力值确定变更的资源量,并根据变更的资源量生成资源调度请求;发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值对待测应用进行压力测试。According to a second aspect of the embodiments of the present application, an applied stress testing method is provided, wherein the method includes: obtaining initial testing information input by a user, where the initial testing information includes an initial stress value and does not include stress testing upper limit; determine the initial resource amount corresponding to the pressure according to the initial pressure value and schedule resources to start the stress test of the application to be tested according to the initial pressure value; during the stress test, determine the amount of resources for the application to be tested target pressure value; determine the changed resource amount according to the current pressure value and the target pressure value, and generate a resource scheduling request according to the changed resource amount; send the resource scheduling request to the scheduling unit, so that the scheduling unit can The amount of resources is the resources used for the stress test schedule in the stress test process, and the stress test is performed on the application to be tested according to the target stress value.
根据本申请实施例的第三方面,提供了一种电子设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行如上所述的应用的压力测试方法对应的操作。According to a third aspect of the embodiments of the present application, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface complete each other through the communication bus The memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the stress testing method of the application as described above.
根据本申请实施例的第四方面,提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上所述的应用的压力测试方法。According to a fourth aspect of the embodiments of the present application, there is provided a computer storage medium on which a computer program is stored, and when the program is executed by a processor, implements the above-mentioned application stress testing method.
根据本申请实施例的第五方面,提供了一种计算机程序产品,包括计算机指令,所述计算机指令指示计算设备执行如上所述的应用的压力测试方法对应的操作。According to a fifth aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, the computer instructions instructing a computing device to perform operations corresponding to the above-mentioned applied stress testing method.
根据本申请实施例提供的方案,在进行压力测试的过程中,按照目标压力值以及进行压力测试的当前压力值进行资源调度,从而按照目标压力值对待测应用进行压力测试,在进行压力测试的过程中可以根据测试情况不断调整目标压力值,从而通过一次压力测试过程即可得到待测应用的压力极限,且在进行压力测试的过程中对资源进行动态调度,可以尽量避免出现测试资源闲置的情况,极大地提高了测试资源的资源利用率;另外,本申请实施例提供的测试方案,可以动态调整用于进行压力测试的资源,使得本申请实施例提供的测试方案的可扩展性较强。According to the solution provided by the embodiment of the present application, in the process of performing the stress test, resource scheduling is performed according to the target pressure value and the current pressure value for the stress test, so that the stress test is performed on the application to be tested according to the target pressure value. During the process, the target pressure value can be continuously adjusted according to the test situation, so that the pressure limit of the application to be tested can be obtained through a single stress test process, and resources are dynamically scheduled during the stress test process, so as to avoid the occurrence of idle test resources as much as possible. In addition, the test solution provided by the embodiment of the present application can dynamically adjust the resources used for stress testing, which makes the test solution provided by the embodiment of the present application more scalable .
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments described in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.
图1A为本申请实施例的一种应用的压力测试方法的步骤流程图;FIG. 1A is a flowchart of steps of an applied stress testing method according to an embodiment of the present application;
图1B为图1A所示实施例中的一种场景示例的示意图;FIG. 1B is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 1A;
图2A为本申请实施例的一种应用的压力测试方法的步骤流程图;2A is a flowchart of steps of an applied stress testing method according to an embodiment of the present application;
图2B为图2A所示实施例中的一种场景示例的示意图;FIG. 2B is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 2A;
图2C为图2A所示实施例中的一种场景示例的示意图;FIG. 2C is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 2A;
图3A为本申请实施例的一种应用的压力测试方法的步骤流程图;3A is a flowchart of steps of an applied stress testing method according to an embodiment of the present application;
图3B为图3A所示实施例中的一种场景示例的示意图;FIG. 3B is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 3A;
图4A为本申请实施例的一种应用的压力测试方法的步骤流程图;4A is a flowchart of steps of an applied stress testing method according to an embodiment of the present application;
图4B为图4A所示实施例中的一种场景示例的示意图;FIG. 4B is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 4A;
图5为本申请实施例的一种应用的压力测试方法的步骤流程图;FIG. 5 is a flow chart of steps of an applied stress testing method according to an embodiment of the present application;
图6为根据本申请实施例的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本领域的人员更好地理解本申请实施例中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请实施例一部分实施例,而不是全部的实施例。基于本申请实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于本申请实施例保护的范围。In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. The embodiments described above are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the embodiments of the present application should fall within the protection scope of the embodiments of the present application.
下面结合本申请实施例附图进一步说明本申请实施例具体实现。The specific implementation of the embodiments of the present application is further described below with reference to the accompanying drawings of the embodiments of the present application.
图1A为本申请实施例提供的一种应用的压力测试方法的流程示意图,如图所示,其包括:FIG. 1A is a schematic flowchart of an applied stress testing method provided by an embodiment of the present application. As shown in the figure, the method includes:
S101、在压力测试过程中,确定针对待测应用的目标压力值。S101. During the pressure test, determine a target pressure value for the application to be tested.
需要说明的是,待测应用具体可以是待测系统、待测应用程序,待测的应用程序具体可以为单体应用程序、分布式应用程序等,或者,待测应用程序还可为单机应用程序或者网络应用程序等,本实施例对此不进行限定。It should be noted that the application to be tested may specifically be the system to be tested, the application to be tested, the application to be tested may specifically be a single application, a distributed application, etc., or the application to be tested may also be a stand-alone application A program or a network application program, etc., which is not limited in this embodiment.
一般情况下,在对待测应用进行压力测试时,需要用户指定压力测试上限。测试单元可以根据压力测试上限准备对应的测试资源,在测试资源就绪后,可以基于测试资源进行压力测试。在压力测试过程中,会从低到高逐步增大压力值直至到达用户指定的压力测试上限。但这种测试过程中,压力测试上限只能在压力测试开始前进行设置,开始进行压力测试后不能调整压力测试上限。Generally, when stress testing the application under test, the user is required to specify the upper limit of the stress test. The test unit can prepare corresponding test resources according to the upper limit of the stress test, and after the test resources are ready, the stress test can be performed based on the test resources. During the stress test, the pressure value will be gradually increased from low to high until the upper limit of the stress test specified by the user is reached. However, in this test process, the upper limit of the stress test can only be set before the start of the stress test, and the upper limit of the stress test cannot be adjusted after the start of the stress test.
然而,压力测试上限一般是用户根据经验或者历史测试结果设置的,导致压力测试上限可能与待测应用实际的压力极限不匹配,极大地增加了压力测试过程的复杂度。However, the upper limit of the stress test is generally set by the user based on experience or historical test results. As a result, the upper limit of the stress test may not match the actual stress limit of the application under test, which greatly increases the complexity of the stress test process.
示例地,若用户设置的压力测试上限较小,远小于测试对象能够承载的压力时,当前测试过程无法得到测试对象的压力上限,也无法得到测试对象的性能、可靠性、稳定性等。用户需要调大压力测试上限并再次进行测试,导致测试过程较为复杂,且消耗的测试资源较多,测试资源的利用率较低。For example, if the upper limit of the stress test set by the user is small, far less than the pressure that the test object can bear, the current test process cannot obtain the upper limit of the pressure of the test object, nor the performance, reliability, stability, etc. of the test object. The user needs to increase the upper limit of the stress test and perform the test again, which results in a more complicated test process, consumes more test resources, and lowers the utilization rate of the test resources.
若用户设置的压力测试上限较大,则需要为测试过程准备较多的测试资源。具体进行压力测试时,会从较小的压力值开始逐渐增加,直至达到待测应用的压力极限或者用户设定的压力测试上限。但为测试过程准备的测试资源是根据用户设置的压力测试上限准备的,在从较小的压力值逐渐增加的过程中,会有很大部分测试资源处于闲置状态,导致测试资源的利用率较低。If the upper limit of the stress test set by the user is large, more test resources need to be prepared for the test process. During the specific pressure test, it will gradually increase from a smaller pressure value until it reaches the pressure limit of the application to be tested or the upper limit of the pressure test set by the user. However, the test resources prepared for the test process are prepared according to the upper limit of the stress test set by the user. In the process of gradually increasing from a small pressure value, a large part of the test resources will be in an idle state, resulting in a relatively high utilization rate of the test resources. Low.
而本申请实施例中,在进行压力测试的过程中,允许动态地设置目标压力值来调整测试过程。具体地,本实施例中,可以根据用户输入的调整操作确定目标压力值,或者按照测试系统预设的测试方法确定目标压力值,本实施例对此不进行限定。测试单元可以基于目标压力值通过后续步骤进行资源调度,以按照目标压力值进行测试。However, in the embodiment of the present application, in the process of performing the pressure test, it is allowed to dynamically set the target pressure value to adjust the test process. Specifically, in this embodiment, the target pressure value may be determined according to an adjustment operation input by the user, or the target pressure value may be determined according to a test method preset by the test system, which is not limited in this embodiment. The test unit may perform resource scheduling through subsequent steps based on the target pressure value, so as to perform the test according to the target pressure value.
S102、根据当前压力值与所述目标压力值确定变更的资源量,并根据变更的资源量生成资源调度请求。S102. Determine the changed resource amount according to the current pressure value and the target pressure value, and generate a resource scheduling request according to the changed resource amount.
当前压力值为压力测试过程中待测应用当前承载的压力值,当前压力值可以为上次确定的目标压力值,或者为用户设置的初始压力值。The current pressure value is the pressure value currently carried by the application to be tested during the pressure test. The current pressure value can be the target pressure value determined last time, or the initial pressure value set by the user.
本实施例中,若当前压力值小于目标压力值,则需要增加用于进行压力测试的资源,若当前压力值大于目标压力值,则可以减少用于进行压力测试的资源,具体的资源值可以根据当前压力值和目标压力值的差值确定。在确定需要增加或减少的资源值后,可以生成资源调度请求。In this embodiment, if the current pressure value is less than the target pressure value, it is necessary to increase the resources for performing the stress test. If the current pressure value is greater than the target pressure value, the resources for performing the stress test can be reduced. The specific resource value can be Determined according to the difference between the current pressure value and the target pressure value. After determining the resource value that needs to be increased or decreased, a resource scheduling request can be generated.
S103、发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值对所述待测应用进行压力测试。S103. Send the resource scheduling request to a scheduling unit, so that the scheduling unit schedules resources for performing stress testing for the stress testing process according to the changed resource amount, and performs the testing on the application to be tested according to the target stress value. pressure test.
本实施例中,用于进行压力测试的资源对应有调度单元,调度单元用于根据资源调度请求对资源进行调度和管理。In this embodiment, a resource used for stress testing corresponds to a scheduling unit, and the scheduling unit is configured to schedule and manage resources according to a resource scheduling request.
具体地,调度单元可以接收根据多个测试任务的目标压力值分别生成的资源调度请求,并为多个用户分别对应的压力测试过程进行资源调度。在调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源后,可以基于调度后的资源按照目标压力值进行压力测试。Specifically, the scheduling unit may receive resource scheduling requests generated according to target pressure values of multiple test tasks, and perform resource scheduling for stress testing processes corresponding to multiple users respectively. After the scheduling unit schedules the resources for performing the stress testing for the stress testing process according to the changed amount of resources, the stress testing may be performed according to the target pressure value based on the scheduled resources.
下面通过一具体实现场景,对本申请的方案进行示例性说明。The solution of the present application is exemplarily described below through a specific implementation scenario.
如图1B所示,用户侧开始流程,用户可以输入压力调整操作,用户侧可以判断压力调整操作的目标压力值和当前压力值的大小关系,若目标压力值和当前压力值的差值大于预设差值,则可以确定变更的资源量,并生成资源调度请求。As shown in Figure 1B, the user side starts the process, the user can input a pressure adjustment operation, and the user side can determine the relationship between the target pressure value of the pressure adjustment operation and the current pressure value, if the difference between the target pressure value and the current pressure value is greater than the predetermined value If the difference is set, the amount of changed resources can be determined, and a resource scheduling request can be generated.
本实施例中,预设差值可以由本领域的技术人员按照需求确定。若目标压力值比当前压力值大且两者差值大于预设值,可以表征通过已用于进行压力测试的资源,不能按照目标压力值进行压力测试;若目标压力值比当前压力值小且两者差值大于预设值,可以表征通过已用于进行压力测试的资源按照目标压力值进行压力测试时,闲置的资源比较多。In this embodiment, the preset difference value can be determined by those skilled in the art as required. If the target pressure value is greater than the current pressure value and the difference between the two is greater than the preset value, it can indicate that the resource used for the pressure test has passed, and the pressure test cannot be performed according to the target pressure value; if the target pressure value is smaller than the current pressure value and The difference between the two is greater than the preset value, which can indicate that when the stress test is performed according to the target pressure value through the resources that have been used for the stress test, there are many idle resources.
资源调度请求可以发送至调度单元,调度单元可以增加或减少用于进行压力测试的资源。The resource scheduling request can be sent to the scheduling unit, and the scheduling unit can increase or decrease the resources used for stress testing.
本实施例提供的方案,可以在进行压力测试的过程中,按照目标压力值以及进行压力测试的当前压力值进行资源调度,从而按照目标压力值进行压力测试,在进行压力测试的过程中可以根据测试情况不断调整目标压力值,从而通过一次压力测试过程即可得到待测应用的压力极限,且在进行压力测试的过程中对资源进行动态调度,可以尽量避免出现测试资源闲置的情况,极大地提高了测试资源的资源利用率;另外,本申请实施例提供的测试方案,可以动态调整用于进行压力测试的资源,使得本申请实施例提供的测试方案的可扩展性较强。In the solution provided by this embodiment, during the stress test process, resource scheduling can be performed according to the target pressure value and the current pressure value of the stress test, so that the stress test can be performed according to the target pressure value. The test situation continuously adjusts the target pressure value, so that the pressure limit of the application to be tested can be obtained through a single stress test process, and the resources are dynamically scheduled during the stress test process, so as to avoid the situation of idle test resources as much as possible. The resource utilization rate of test resources is improved; in addition, the test solution provided by the embodiment of the present application can dynamically adjust the resources used for stress testing, so that the test solution provided by the embodiment of the present application has strong scalability.
本实施例中应用的压力测试方法可以由任意适当的具有数据处理能力的电子设备执行,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。The stress testing method applied in this embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.), a PC, and the like.
图2为本申请实施例提供的一种应用的压力测试方法的流程示意图,如图所示,其包括:FIG. 2 is a schematic flowchart of an applied stress testing method provided by an embodiment of the present application. As shown in the figure, the method includes:
S201、在压力测试过程中,确定针对待测应用的目标压力值。S201. During the pressure test, determine a target pressure value for the application to be tested.
本步骤的具体实现方式可参考上述实施例,在此不再赘述。For the specific implementation of this step, reference may be made to the foregoing embodiments, and details are not described herein again.
压力测试过程可以测试多种压力值,例如并发量或者RPS。目标压力值可以为一种压力值或者多种压力值,本实施例对此不进行限定。The stress testing process can test various stress values, such as concurrency or RPS. The target pressure value may be one pressure value or multiple pressure values, which is not limited in this embodiment.
参见图2B,示出了三种压力随着用户的压力调整操作而变化的示意图。Referring to FIG. 2B , there is shown a schematic diagram of three kinds of pressures changing with the user's pressure adjustment operation.
如图2B左侧所示,目标压力可以随着时间成阶梯状递增,表征用户可以间隔一定时间输入一次压力调整操作,多个压力调整操作对应的目标压力值递增。As shown on the left side of FIG. 2B , the target pressure can increase in steps with time, which means that the user can input a pressure adjustment operation at certain intervals, and the target pressure values corresponding to multiple pressure adjustment operations increase.
如图2B中部所示,目标压力值可以随着时间成均匀递增,表征用户可以直接输入一压力增长参数或者压力增长公式,测试单元可以按照用户输入的压力增长参数或者压力增长公式确定目标压力值。As shown in the middle of Fig. 2B, the target pressure value can increase uniformly with time, which means that the user can directly input a pressure increase parameter or pressure increase formula, and the test unit can determine the target pressure value according to the pressure increase parameter or pressure increase formula input by the user .
如图2B右侧所示,目标压力值可以随着时间成阶梯状动态变化,目标压力值具体可以增大或减小,具体根据用户输入的压力调整操作确定。As shown on the right side of FIG. 2B , the target pressure value may change dynamically in a step-like manner with time, and the target pressure value may increase or decrease specifically, which is specifically determined according to the pressure adjustment operation input by the user.
可选地,S201可以包括:确定待测应用对应的压力测试模型,所述压力测试模型用于表征目标压力值随时间的变化,所述压力测试模型包括:阶梯变化的测试模型、线性变化的测试模型;基于所述压力测试模型,确定当前时刻针对待测应用的目标压力值。Optionally, S201 may include: determining a stress test model corresponding to the application to be tested, where the stress test model is used to characterize the change of the target pressure value over time, and the stress test model includes: a step-change test model, a linear-change test model A test model; based on the stress test model, determine the target pressure value for the application to be tested at the current moment.
示例地,压力测试模型可以如图2B所示,压力测试模型中可以用于表征目标压力值随时间的变化规律。如图2B左侧所示,目标压力值可以随时间的增加随之呈递增的阶梯式递增;如图2B中部所示,目标压力值可以与随时间的增加呈线性递增;如图2B右侧所示,目标压力值可以随时间的增加呈上升或下降的阶梯式变化。For example, the stress test model may be as shown in FIG. 2B , and the stress test model may be used to characterize the variation law of the target pressure value with time. As shown on the left side of Fig. 2B, the target pressure value can increase in a stepwise manner with the increase of time; as shown in the middle of Fig. 2B, the target pressure value can increase linearly with the increase of time; on the right side of Fig. 2B As shown, the target pressure value can be stepped up or down as time increases.
S202、根据当前压力值与所述目标压力值,判断是否需要增加进行压力测试的资源。S202 , according to the current pressure value and the target pressure value, determine whether it is necessary to increase the resources for performing the pressure test.
若需要,则执行步骤S203,并继续执行步骤S204;若不需要,则执行步骤S205。If necessary, execute step S203, and continue to execute step S204; if not, execute step S205.
本实施例中,若当前压力值小于目标压力值,则需要增加进行压力测试的资源。In this embodiment, if the current pressure value is less than the target pressure value, it is necessary to increase the resources for performing the pressure test.
S203、根据当前压力值与所述目标压力值确定增加的资源量,并根据增加的资源量生成所述资源调度请求。S203. Determine an increased resource amount according to the current pressure value and the target pressure value, and generate the resource scheduling request according to the increased resource amount.
本实施例中,可以按照预设的计算规则,根据当前压力值与目标压力值的差值,计算得到需要增加的资源量,并生成资源调度请求。In this embodiment, according to a preset calculation rule, according to the difference between the current pressure value and the target pressure value, the amount of resources that need to be increased can be calculated, and a resource scheduling request can be generated.
S204、发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值对待测应用进行压力测试。S204. Send the resource scheduling request to a scheduling unit, so that the scheduling unit schedules resources for performing stress testing for the stress testing process according to the changed resource amount, and performs stress testing on the application to be tested according to the target stress value.
本步骤的具体实现方式可以参考上述实施例,在此不再赘述。For the specific implementation of this step, reference may be made to the foregoing embodiments, and details are not described herein again.
可选地,本申请任意实施例中,所述调度单元为云平台的调度单元,所述发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值进行压力测试,包括:通过所述云平台接收所述资源调度请求,所述资源调度请求中携带有变更的资源量;通过所述云平台的所述调度单元,根据变更的资源量为所述压力测试过程调度云平台中用于进行压力测试的资源,以照所述目标压力值进行压力测试。Optionally, in any embodiment of the present application, the scheduling unit is a scheduling unit of a cloud platform, and the resource scheduling request is sent to the scheduling unit to schedule the stress test process according to the changed resource amount by the scheduling unit. resources used for stress testing, and performing stress testing according to the target pressure value, including: receiving the resource scheduling request through the cloud platform, the resource scheduling request carrying the changed resource amount; The scheduling unit of the platform schedules the resources used for performing the stress testing in the cloud platform for the stress testing process according to the changed amount of resources, so as to perform the stress testing according to the target pressure value.
通过使用云平台的调度单元以及通过云平台的资源进行压力测试,可以充分利用云平台的弹性能力,达到更好的资源调度效果,且无需专门搭建用于进行测试的集群。By using the scheduling unit of the cloud platform and performing stress testing through the resources of the cloud platform, the elastic capability of the cloud platform can be fully utilized to achieve better resource scheduling effect, and there is no need to build a special cluster for testing.
本实施例中,用于进行压力测试的资源包括以下至少之一:CPU核、内存、网络带宽。具体地,可以包括测试机的CPU核数、内存数、网络带宽处理能力等。In this embodiment, the resources for performing the stress test include at least one of the following: CPU cores, memory, and network bandwidth. Specifically, it may include the number of CPU cores, the number of memory, and the network bandwidth processing capability of the test machine.
本申请任意实施例中的测试机可以为物理机也可以为虚拟机,本申请对此不进行限定。The testing machine in any embodiment of this application may be a physical machine or a virtual machine, which is not limited in this application.
S205、根据当前压力值与所述目标压力值,为压力测试过程对应的已有测试机进行压力释放操作,以按照所述目标压力值对待测应用进行压力测试。S205 , according to the current pressure value and the target pressure value, perform a pressure release operation for the existing testing machine corresponding to the pressure test process, so as to perform a pressure test on the application to be tested according to the target pressure value.
具体地,本实施例中,可以根据当前压力值与目标压力值的差值,确定减少的压力,并根据减少的压力对已有测试机进行压力释放操作。进行压力释放操作后,可以按照目标压力值进行压力测试。Specifically, in this embodiment, the reduced pressure can be determined according to the difference between the current pressure value and the target pressure value, and a pressure release operation is performed on the existing testing machine according to the reduced pressure. After the pressure release operation, the pressure test can be performed according to the target pressure value.
本实施例中,通过对已有测试机进行压力释放操作,可以通过已有的测试机模拟更加接近真实的使用场景,进而获得更好的测试效果。In this embodiment, by performing a pressure release operation on an existing testing machine, a more realistic usage scenario can be simulated by the existing testing machine, thereby obtaining a better test effect.
示例地,通过压力释放操作可以释放已有测试机的部分资源,通过该资源可以模拟更加细节的测试场景,例如地理位置等,从而获得更好的测试效果。For example, part of the resources of the existing test machine can be released through the pressure release operation, and more detailed test scenarios, such as geographic location, can be simulated through the resources, so as to obtain better test results.
本实施例中,可以按照预设的计算规则,根据当前压力值与目标压力值的差值,计算得到需要增加的资源量,并生成资源调度请求。In this embodiment, according to a preset calculation rule, according to the difference between the current pressure value and the target pressure value, the amount of resources that need to be increased can be calculated, and a resource scheduling request can be generated.
参见图2C,示出了三种压力测试过程中资源量的变化示意图。Referring to FIG. 2C , a schematic diagram of changes in the amount of resources during the three stress tests is shown.
图2C左侧的资源量变化过程与图2B左侧所示的压力变化过程对应。当目标压力随着时间成阶梯状递增时,用于进行压力测试的资源量也成阶梯状增长。The resource change process on the left side of FIG. 2C corresponds to the pressure change process shown on the left side of FIG. 2B . When the target pressure increases stepwise over time, the amount of resources used for stress testing also increases stepwise.
图2C左侧的资源量变化过程与图2B左侧所示的压力变化过程对应。当目标压力随着时间成阶梯状递增时,用于进行压力测试的资源量也成阶梯状增长。The resource change process on the left side of FIG. 2C corresponds to the pressure change process shown on the left side of FIG. 2B . When the target pressure increases stepwise over time, the amount of resources used for stress testing also increases stepwise.
图2C中部的资源量变化过程与图2B中部所示的压力变化过程对应。当目标压力随着时间成均匀递增时,由于一份资源对应的压力值大于1(例如为10),当已进行测试的多份资源不能按照变化后的压力值进行测试时会增加一份新的资源,因此,用于进行压力测试的资源量也成阶梯状增长。示例地,10份资源最多可以按照100的压力值进行压力测试,当目标压力值变更为101时,需要增加新的资源,当目标压力值变更为101-110时,无需新增资源,直至目标压力值增加至111时,新增一份资源。The resource change process in the middle of FIG. 2C corresponds to the pressure change process shown in the middle of FIG. 2B . When the target pressure increases uniformly over time, since the pressure value corresponding to one resource is greater than 1 (for example, 10), when multiple resources that have been tested cannot be tested according to the changed pressure value, a new one will be added. Therefore, the amount of resources used for stress testing also increases in steps. For example, 10 resources can be stress tested with a maximum pressure value of 100. When the target pressure value is changed to 101, new resources need to be added. When the target pressure value is changed to 101-110, there is no need to add new resources until the target pressure value is changed. When the pressure value increases to 111, a new resource is added.
图2C右侧的资源量变化过程与图2B右侧所示的压力变化过程对应。当目标压力随着用户的设置增大时或减小时,用于进行压力测试的资源量成阶梯状增长。The resource change process on the right side of FIG. 2C corresponds to the pressure change process shown on the right side of FIG. 2B . When the target pressure increases or decreases with the user's settings, the amount of resources used for stress testing increases in steps.
可选地,本申请实施例中,步骤S201之前,所述方法还包括:根据用户输入的初始压力值,确定按照所述初始压力值进行压力对应的初始资源量;调度所述初始资源量对应资源,并按照所述初始压力值开始进行测试,以启动压力测试过程。Optionally, in the embodiment of the present application, before step S201, the method further includes: according to the initial pressure value input by the user, determining an initial resource amount corresponding to the pressure according to the initial pressure value; scheduling the initial resource amount corresponding to the pressure resources, and start testing according to the initial stress value to initiate the stress testing process.
本实施例中,可以根据用户输入的初始压力值启动压力测试过程,并在压力测试过程中,重复执行上述步骤S201-S205,直至用户获得测试对象的压力极限,以通过一次测试过程得到待测应用的压力极限,且消耗的资源较少。In this embodiment, the pressure test process can be started according to the initial pressure value input by the user, and during the pressure test process, the above steps S201-S205 are repeatedly executed until the user obtains the pressure limit of the test object, so as to obtain the test object through one test process The pressure limit of the application, and consumes less resources.
本实施例中应用的压力测试方法可以由任意适当的具有数据处理能力的电子设备执行,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。The stress testing method applied in this embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.), a PC, and the like.
图3本申请实施例提供的一种应用的压力测试方法的流程示意图,如图所示,其包括:FIG. 3 is a schematic flowchart of an applied stress testing method provided by an embodiment of the present application. As shown in the figure, the method includes:
S301、在压力测试过程中,确定对待测应用目标压力值。S301 , during the pressure test, determine the target pressure value to be tested.
S302、根据当前压力值与所述目标压力值,判断是否需要增加进行压力测试的资源。S302 , according to the current pressure value and the target pressure value, determine whether it is necessary to increase the resources for performing the pressure test.
若需要,则执行步骤S303,并继续执行步骤S304、S305;若不需要,则执行步骤S306。If necessary, execute step S303, and continue to execute steps S304 and S305; if not, execute step S306.
S303、根据当前压力值与所述目标压力值确定增加的资源量,并根据增加的资源量生成所述资源调度请求。S303 . Determine an increased resource amount according to the current pressure value and the target pressure value, and generate the resource scheduling request according to the increased resource amount.
步骤S301-S303的具体实现方式参考上述实施例,在此不再赘述。For the specific implementation manner of steps S301-S303, reference is made to the foregoing embodiment, and details are not described herein again.
S304、发送所述资源调度请求至调度单元,得到所述调度单元根据增加的资源量为压力测试过程调度新的测试机。S304. Send the resource scheduling request to a scheduling unit, and obtain that the scheduling unit schedules a new test machine for the stress testing process according to the increased resource amount.
本实施例中,测试机可以为物理机也可以为虚拟机,本实施例对此不进行限定。In this embodiment, the testing machine may be a physical machine or a virtual machine, which is not limited in this embodiment.
新的测试机可以包括一个或多个,新的测试机中包括的资源可以根据增加的资源量确定,本实施例对此不进行限定。The new testing machine may include one or more resources, and the resources included in the new testing machine may be determined according to the amount of increased resources, which is not limited in this embodiment.
S305、为所述测试机分配压力测试过程对应的测试任务,以按照所述目标压力值对待测应用进行压力测试。S305. Allocate a test task corresponding to the stress testing process to the testing machine, so as to perform stress testing on the application to be tested according to the target pressure value.
具体地,可以根据目标压力值与当前压力值的差值,为新的测试机分配对应的测试任务。示例地,若目标压力值和当前压力值的差值为9,则可以为新的测试机分配压力值为9对应的测试任务。Specifically, a corresponding test task can be assigned to the new test machine according to the difference between the target pressure value and the current pressure value. For example, if the difference between the target pressure value and the current pressure value is 9, a test task corresponding to the pressure value of 9 may be assigned to the new testing machine.
S306、根据当前压力值与所述目标压力值,为压力测试过程对应的已有测试机进行压力释放操作,以按照所述目标压力值对待测应用进行压力测试。S306 , according to the current pressure value and the target pressure value, perform a pressure release operation for the existing testing machine corresponding to the pressure test process, so as to perform a pressure test on the application to be tested according to the target pressure value.
本步骤的具体实现方式可参考上述实施例,在此不再赘述。For the specific implementation of this step, reference may be made to the foregoing embodiments, and details are not described herein again.
参见图3B,示出了本申请的一中使用场景示意图。Referring to FIG. 3B , a schematic diagram of a usage scenario of the present application is shown.
如图所示,用户可以向压力测试单元输入压力调整操作以调整测试压力,测试单元可以比较当前压力值与压力调整操作对应的目标压力值。As shown in the figure, the user can input a pressure adjustment operation to the pressure test unit to adjust the test pressure, and the test unit can compare the current pressure value with the target pressure value corresponding to the pressure adjustment operation.
若目标压力值大于当前压力值,则根据目标压力值和当前压力值的差值,计算需要增加的资源量,并生成资源调度请求。If the target pressure value is greater than the current pressure value, the amount of resources to be increased is calculated according to the difference between the target pressure value and the current pressure value, and a resource scheduling request is generated.
调度单元可以根据资源调度请求,为压力测试过程增加新的测试机,当确定增加完成后,可以将新的测试机的相关信息返回至测试单元,测试单元可以为新的测试机下发测试任务并启动。The scheduling unit can add a new test machine to the stress testing process according to the resource scheduling request. When it is determined that the addition is complete, it can return the relevant information of the new test machine to the test unit, and the test unit can issue test tasks for the new test machine. and start.
新的测试机启动后,与已有的测试机结合,可以按照目标压力值进行测试。After the new test machine is started, it can be combined with the existing test machine to test according to the target pressure value.
本实施例提供的方案,通过响应于资源调度请求增加新的测试机,使得增加测试资源的过程与已有的测试机之间的关联性较低,降低了增加资源的过程的复杂度;且增加资源的过程中已有的测试机可以持续进行测试,进一步提高了测试资源的利用率。In the solution provided by this embodiment, by adding a new test machine in response to a resource scheduling request, the correlation between the process of adding test resources and the existing test machine is low, and the complexity of the process of adding resources is reduced; and In the process of increasing resources, the existing test machine can continue to test, which further improves the utilization rate of test resources.
本实施例中应用的压力测试方法可以由任意适当的具有数据处理能力的电子设备执行,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。The stress testing method applied in this embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.), a PC, and the like.
图4示出了本申请实施例提供的一种应用的压力测试方法的流程示意图,如图所示,其包括:FIG. 4 shows a schematic flowchart of an applied stress testing method provided by an embodiment of the present application. As shown in the figure, the method includes:
S401、在压力测试过程中,确定针对待测应用目标压力值。S401. During the pressure test process, determine a target pressure value for the application to be tested.
S402、根据当前压力值与所述目标压力值,判断是否需要增加进行压力测试的资源。S402 , according to the current pressure value and the target pressure value, determine whether it is necessary to increase the resources for performing the pressure test.
若需要,则执行步骤S403,并继续执行步骤S404;若不需要,则执行步骤S405。If necessary, execute step S403, and continue to execute step S404; if not, execute step S405.
S403、根据当前压力值与所述目标压力值确定增加的资源量,并根据增加的资源量生成所述资源调度请求。S403. Determine an increased resource amount according to the current pressure value and the target pressure value, and generate the resource scheduling request according to the increased resource amount.
步骤4301-S403的具体实现方式参考上述实施例,在此不再赘述。For the specific implementation manner of steps 4301-S403, reference is made to the foregoing embodiment, and details are not described herein again.
S404、发送所述资源调度请求至调度单元,以通过所述调度单元根据增加的资源量,为压力测试过程对应的已有测试机增加用于进行压力测试的资源,并按照所述目标压力值对待测应用进行压力测试。S404. Send the resource scheduling request to a scheduling unit, so that the scheduling unit adds resources for performing stress testing to the existing testing machine corresponding to the stress testing process according to the increased resource amount, and according to the target pressure value Stress test the application under test.
本实施例中,测试机可以为物理机也可以为虚拟机,本实施例对此不进行限定。In this embodiment, the testing machine may be a physical machine or a virtual machine, which is not limited in this embodiment.
本申请实施例中,部分资源增加过程需要暂停测试机的测试任务,示例地,在增加CPU核数、增加内存量、硬盘数量等,需要暂停已有测试机执行的测试任务;另一部分资源增加过程中无需暂停已有测试机的测试任务,例如网络带宽等资源。In the embodiment of the present application, the test task of the test machine needs to be suspended during the process of adding some resources. For example, when increasing the number of CPU cores, the amount of memory, the number of hard disks, etc., it is necessary to suspend the test task executed by the existing test machine; another part of the resource increases During the process, there is no need to suspend the test tasks of the existing test machine, such as network bandwidth and other resources.
具体是否需要暂停已有测试机的测试任务,本领域的技术人员可以根据需求确定,本实施例对此不进行限定。Specifically, whether it is necessary to suspend the testing task of the existing testing machine can be determined by those skilled in the art according to requirements, which is not limited in this embodiment.
S405、根据当前压力值与所述目标压力值,为压力测试过程对应的已有测试机进行压力释放操作,以按照所述目标压力值对待测应用进行压力测试。S405. According to the current pressure value and the target pressure value, perform a pressure release operation for the existing testing machine corresponding to the pressure test process, so as to perform a pressure test on the application to be tested according to the target pressure value.
本步骤的具体实现方式可参考上述实施例,在此不再赘述。For the specific implementation of this step, reference may be made to the foregoing embodiments, and details are not described herein again.
参见图4B,示出了本申请的一中使用场景示意图。Referring to FIG. 4B , a schematic diagram of a usage scenario of the present application is shown.
如图所示,用户可以向压力测试单元输入压力调整操作以调整测试压力,测试单元可以比较当前压力值与压力调整操作对应的目标压力值。As shown in the figure, the user can input a pressure adjustment operation to the pressure test unit to adjust the test pressure, and the test unit can compare the current pressure value with the target pressure value corresponding to the pressure adjustment operation.
若目标压力值大于当前压力值,则根据目标压力值和当前压力值的差值,计算需要增加的资源量,并生成资源调度请求。If the target pressure value is greater than the current pressure value, the amount of resources to be increased is calculated according to the difference between the target pressure value and the current pressure value, and a resource scheduling request is generated.
调度单元可以根据资源调度请求,增加压力测试过程中的已有测试机的资源量,当确定增加完成后,可以将资源增加成功的消息返回至测试单元,测试单元可以调整已有测试机的测试任务,以按照目标压力值进行测试。The scheduling unit can increase the resources of the existing test machine during the stress test process according to the resource scheduling request. When it is determined that the increase is completed, it can return the message that the resource was added successfully to the test unit, and the test unit can adjust the test of the existing test machine. task to test against the target pressure value.
本实施例提供的方案,通过响应于资源调度请求增加已有测试机中的资源量,使得测试单元无需下发新的测试任务。In the solution provided by this embodiment, the amount of resources in the existing test machine is increased in response to the resource scheduling request, so that the test unit does not need to issue a new test task.
本实施例中应用的压力测试方法可以由任意适当的具有数据处理能力的电子设备执行,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。The stress testing method applied in this embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.), a PC, and the like.
图5为本申请实施例提供的一种应用的压力测试方法的流程示意图,如图所示,其包括:FIG. 5 is a schematic flowchart of an applied stress testing method provided by an embodiment of the present application. As shown in the figure, the method includes:
S501、获得用户输入的初始测试信息,所述初始测试信息中包括初始压力值且不包括压力测试上限。S501. Obtain initial test information input by a user, where the initial test information includes an initial pressure value and does not include an upper limit of the pressure test.
与一般进行压力测试过程不同的是,本实施例中,在获取初始测试信息时,获取的初始测试信息不包括压力测试上限,而包括初始压力值。初始压力值为开始进行压力测试时的初始值,用于启动压力测试过程。Different from the general stress test process, in this embodiment, when the initial test information is obtained, the obtained initial test information does not include the upper limit of the stress test, but includes the initial pressure value. The initial pressure value is the initial value when the pressure test starts, and is used to start the pressure test process.
S502、确定按照所述初始压力值进行压力所对应的初始资源量并调度资源,以按照所述初始压力值开始对待测应用进行压力测试。S502. Determine the initial resource amount corresponding to the pressure according to the initial pressure value and schedule resources, so as to start the stress test of the application to be tested according to the initial pressure value.
具体确定初始压力值对应的初始资源量的方法可参考相关技术,在此不再赘述。For a specific method for determining the initial resource amount corresponding to the initial pressure value, reference may be made to the related art, and details are not described herein again.
确定初始资源量后,可以按照初始资源量进行资源调度,并使用调度的资源按照初始压力值开始进行压力测试,以启动压力测试过程。After the initial resource amount is determined, resource scheduling can be performed according to the initial resource amount, and a stress test can be started by using the scheduled resource according to the initial pressure value to start the stress test process.
S503、在压力测试过程中,确定针对所述待测应用的目标压力值。S503. During the pressure test, determine a target pressure value for the application to be tested.
S504、根据当前压力值与所述目标压力值确定变更的资源量,并根据变更的资源量生成资源调度请求。S504. Determine the changed resource amount according to the current pressure value and the target pressure value, and generate a resource scheduling request according to the changed resource amount.
S505、发送所述资源调度请求至调度单元,以通过所述调度单元根据变更的资源量为压力测试过程调度用于进行压力测试的资源,并按照所述目标压力值对待测应用进行压力测试。S505. Send the resource scheduling request to a scheduling unit, so that the scheduling unit schedules resources for performing stress testing for the stress testing process according to the changed resource amount, and performs stress testing on the application to be tested according to the target stress value.
步骤S503-S505的具体实现方式可参考上述实施例,在此不再赘述。For the specific implementation manner of steps S503-S505, reference may be made to the foregoing embodiments, and details are not described herein again.
本实施例提供的方案,在测试压力前,可以不再获得压力测试上限,而获得初始压力值,并按照初始压力值开始进行压力测试的过程,在进行压力测试的过程中,按照目标压力值以及进行压力测试的当前压力值进行资源调度,从而按照目标压力值进行压力测试,在进行压力测试的过程中可以根据测试情况不断调整目标压力值,从而通过一次压力测试过程即可得到待测应用的压力极限,且在进行压力测试的过程中对资源进行动态调度,可以尽量避免出现测试资源闲置的情况,极大地提高了测试资源的资源利用率;另外,本申请实施例提供的测试方案,可以动态调整用于进行压力测试的资源,使得本申请实施例提供的测试方案的可扩展性较强。In the solution provided by this embodiment, before testing the pressure, the upper limit of the pressure test can no longer be obtained, but the initial pressure value can be obtained, and the process of the pressure test can be started according to the initial pressure value. And the current pressure value of the stress test is used for resource scheduling, so that the stress test is performed according to the target pressure value. During the stress test process, the target pressure value can be continuously adjusted according to the test situation, so that the application to be tested can be obtained through a single stress test process. In addition, the dynamic scheduling of resources in the process of stress testing can avoid idle test resources as much as possible, and greatly improve the resource utilization rate of test resources; The resources used for stress testing can be dynamically adjusted, so that the test solution provided by the embodiments of the present application has strong scalability.
本实施例中应用的压力测试方法可以由任意适当的具有数据处理能力的电子设备执行,包括但不限于:服务器、移动终端(如手机、PAD等)和PC机等。The stress testing method applied in this embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.), a PC, and the like.
参照图6,示出了本申请实施例提供的一种电子设备的结构示意图,本申请具体实施例并不对电子设备的具体实现做限定。Referring to FIG. 6 , a schematic structural diagram of an electronic device provided by an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
如图6所示,该电子设备可以包括:处理器(processor)602、通信接口(Communications Interface)604、存储器(memory)606、以及通信总线608。As shown in FIG. 6 , the electronic device may include: a processor (processor) 602 , a communication interface (Communications Interface) 604 , a memory (memory) 606 , and a communication bus 608 .
其中:in:
处理器602、通信接口604、以及存储器606通过通信总线608完成相互间的通信。The processor 602 , the
通信接口604,用于与其它电子设备或服务器进行通信。A
处理器602,用于执行程序610,具体可以执行上述应用的压力测试方法实施例中的相关步骤。The processor 602 is configured to execute the program 610, and specifically may execute the relevant steps in the above-mentioned embodiments of the applied stress testing method.
具体地,程序610可以包括程序代码,该程序代码包括计算机操作指令。Specifically, the program 610 may include program code including computer operation instructions.
处理器602可能是处理器CPU,或者是特定集成电路ASIC(Application SpecificIntegrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。智能设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。The processor 602 may be a processor CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the smart device may be the same type of processors, such as one or more CPUs; or may be different types of processors, such as one or more CPUs and one or more ASICs.
存储器606,用于存放程序610。存储器606可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 606 is used to store the program 610 . Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.
程序610中各步骤的具体实现可以参见上述应用的压力测试方法实施例中的相应步骤和单元中对应的描述,在此不赘述。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。For the specific implementation of the steps in the program 610, reference may be made to the corresponding descriptions in the corresponding steps and units in the above-applied stress testing method embodiments, which are not repeated here. Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and modules, reference may be made to the corresponding process descriptions in the foregoing method embodiments, which will not be repeated here.
本申请实施例还提供了一种计算机程序产品,包括计算机指令,该计算机指令指示计算设备执行上述多个方法实施例中的任一应用的压力测试对应的操作。An embodiment of the present application further provides a computer program product, including computer instructions, where the computer instructions instruct a computing device to perform an operation corresponding to a stress test of any application in the foregoing multiple method embodiments.
需要指出,根据实施的需要,可将本申请实施例中描述的各个部件/步骤拆分为更多部件/步骤,也可将两个或多个部件/步骤或者部件/步骤的部分操作组合成新的部件/步骤,以实现本申请实施例的目的。It should be pointed out that, according to the needs of implementation, each component/step described in the embodiments of the present application may be split into more components/steps, or two or more components/steps or part of operations of components/steps may be combined into New components/steps to achieve the purpose of the embodiments of the present application.
上述根据本申请实施例的方法可在硬件、固件中实现,或者被实现为可存储在记录介质(诸如CDROM、RAM、软盘、硬盘或磁光盘)中的软件或计算机代码,或者被实现通过网络下载的原始存储在远程记录介质或非暂时机器可读介质中并将被存储在本地记录介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件(诸如ASIC或FPGA)的记录介质上的这样的软件处理。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件(例如,RAM、ROM、闪存等),当所述软件或计算机代码被计算机、处理器或硬件访问且执行时,实现在此描述的应用的压力测试方法。此外,当通用计算机访问用于实现在此示出的应用的压力测试方法的代码时,代码的执行将通用计算机转换为用于执行在此示出的应用的压力测试方法的专用计算机。The above-described methods according to the embodiments of the present application may be implemented in hardware, firmware, or as software or computer codes that may be stored in a recording medium (such as CDROM, RAM, floppy disk, hard disk, or magneto-optical disk), or implemented through a network Downloaded computer code originally stored in a remote recording medium or non-transitory machine-readable medium and will be stored in a local recording medium so that the methods described herein can be stored on a computer using a general purpose computer, special purpose processor or programmable or Such software processing on a recording medium of dedicated hardware such as ASIC or FPGA. It is to be understood that a computer, processor, microprocessor controller or programmable hardware includes storage components (eg, RAM, ROM, flash memory, etc.) that can store or receive software or computer code when the software or computer code is executed by a computer, When accessed and executed by a processor or hardware, a method of stress testing the application described herein is implemented. Furthermore, when a general purpose computer accesses code for implementing the stress testing method of the application shown herein, execution of the code converts the general purpose computer into a special purpose computer for executing the stress testing method of the application shown herein.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及方法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。Those of ordinary skill in the art can realize that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled persons may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.
以上实施方式仅用于说明本申请实施例,而并非对本申请实施例的限制,有关技术领域的普通技术人员,在不脱离本申请实施例的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本申请实施例的范畴,本申请实施例的专利保护范围应由权利要求限定。The above embodiments are only used to illustrate the embodiments of the present application, but are not intended to limit the embodiments of the present application. Those of ordinary skill in the relevant technical field can also make various Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the patent protection scope of the embodiments of the present application should be defined by the claims.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210073140.6A CN114490374A (en) | 2022-01-21 | 2022-01-21 | Applied stress testing methods, electronic equipment, storage media and program products |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210073140.6A CN114490374A (en) | 2022-01-21 | 2022-01-21 | Applied stress testing methods, electronic equipment, storage media and program products |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114490374A true CN114490374A (en) | 2022-05-13 |
Family
ID=81473596
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210073140.6A Pending CN114490374A (en) | 2022-01-21 | 2022-01-21 | Applied stress testing methods, electronic equipment, storage media and program products |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114490374A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115827498A (en) * | 2023-02-20 | 2023-03-21 | 创云融达信息技术(天津)股份有限公司 | Pressure test distribution method and system for software program |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180285236A1 (en) * | 2017-03-31 | 2018-10-04 | Cae Inc. | Troubleshooting a model defining a dynamic behavior of a simulated interactive object |
CN109726102A (en) * | 2018-05-14 | 2019-05-07 | 网联清算有限公司 | Flow pressure test method and device |
CN111078478A (en) * | 2019-12-17 | 2020-04-28 | 腾讯科技(深圳)有限公司 | Server stress testing method and device and computer readable storage medium |
CN111290896A (en) * | 2020-02-12 | 2020-06-16 | 广州酷狗计算机科技有限公司 | Server pressure testing method, device, equipment and medium |
CN111315296A (en) * | 2018-04-02 | 2020-06-19 | 华为技术有限公司 | Method and device for determining pressure value |
CN112765035A (en) * | 2021-01-27 | 2021-05-07 | 北京百家科技集团有限公司 | Distributed pressure test system, method, device, electronic equipment and storage medium |
CN113742219A (en) * | 2021-08-05 | 2021-12-03 | 中移(杭州)信息技术有限公司 | Pressure regulation and performance testing method, system and storage medium |
-
2022
- 2022-01-21 CN CN202210073140.6A patent/CN114490374A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180285236A1 (en) * | 2017-03-31 | 2018-10-04 | Cae Inc. | Troubleshooting a model defining a dynamic behavior of a simulated interactive object |
CN111315296A (en) * | 2018-04-02 | 2020-06-19 | 华为技术有限公司 | Method and device for determining pressure value |
CN109726102A (en) * | 2018-05-14 | 2019-05-07 | 网联清算有限公司 | Flow pressure test method and device |
CN111078478A (en) * | 2019-12-17 | 2020-04-28 | 腾讯科技(深圳)有限公司 | Server stress testing method and device and computer readable storage medium |
CN111290896A (en) * | 2020-02-12 | 2020-06-16 | 广州酷狗计算机科技有限公司 | Server pressure testing method, device, equipment and medium |
CN112765035A (en) * | 2021-01-27 | 2021-05-07 | 北京百家科技集团有限公司 | Distributed pressure test system, method, device, electronic equipment and storage medium |
CN113742219A (en) * | 2021-08-05 | 2021-12-03 | 中移(杭州)信息技术有限公司 | Pressure regulation and performance testing method, system and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115827498A (en) * | 2023-02-20 | 2023-03-21 | 创云融达信息技术(天津)股份有限公司 | Pressure test distribution method and system for software program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110175110B (en) | Pressure testing method, device, system, equipment and computer readable storage medium | |
CN109766182B (en) | System resource dynamic expansion and contraction method and device, computer equipment and storage medium | |
CN102880532B (en) | Cloud technology-based test system and method | |
CN107391317B (en) | Data recovery method, device, equipment and computer readable storage medium | |
CN109218133B (en) | Network speed testing system, method, device and computer readable storage medium | |
US8782215B2 (en) | Performance testing in a cloud environment | |
CN109684228B (en) | Performance test method, device, system and storage medium | |
CN108052384A (en) | A kind of task processing method, service platform and electronic equipment | |
CN106664259B (en) | Method and device for expanding virtual network function | |
CN106897299B (en) | Database access method and device | |
CN106161524A (en) | A kind of resource downloading method based on distributed resource node and device | |
CN113849312A (en) | Data processing task allocation method and device, electronic equipment and storage medium | |
CN105808341A (en) | Method, apparatus and system for scheduling resources | |
CN114244898B (en) | Workload preheating method and device based on service grid | |
CN110297743B (en) | Load testing method and device and storage medium | |
US9880883B2 (en) | Virtual resource control system determining new allocation of resources at a hub | |
CN115269118A (en) | A scheduling method, device and device for a virtual machine | |
CN109144846B (en) | Test method and device for testing server | |
CN114490374A (en) | Applied stress testing methods, electronic equipment, storage media and program products | |
US9501321B1 (en) | Weighted service requests throttling | |
CN110716809B (en) | Method and device for scheduling cloud resources | |
CN110012003B (en) | Cloud application screen capturing method and device | |
JP7214287B1 (en) | Resource allocation determination method, device, computing device and computer program | |
CN108418730B (en) | Network flow testing method, device, equipment and computer readable storage medium | |
CN113064620B (en) | A method and device for processing system data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |