技术领域Technical field
本公开涉及计算机技术领域,具体涉及云计算、测试技术领域,尤其涉及性能测试工具的生成方法和装置。The present disclosure relates to the field of computer technology, specifically to the fields of cloud computing and testing technology, and in particular to methods and devices for generating performance testing tools.
背景技术Background technique
性能测试是通过性能测试工具模拟多种正常、峰值以及异常负载条件来对系统的各项性能指标进行测试。负载测试和压力测试都属于性能测试,两者也可以结合进行。Performance testing uses performance testing tools to simulate a variety of normal, peak, and abnormal load conditions to test various performance indicators of the system. Both load testing and stress testing are performance tests, and they can also be combined.
在相关技术中,压力测试可以采用以下方式进行:通过确定一个系统的瓶颈或者不能接受的性能点,来获得系统能提供的最大服务级别的测试。具体地,可以通过性能测试工具实现性能测试。In related technologies, stress testing can be performed in the following manner: by determining bottlenecks or unacceptable performance points of a system to obtain the maximum service level test that the system can provide. Specifically, performance testing can be implemented through performance testing tools.
发明内容Contents of the invention
提供了一种性能测试工具的生成方法、装置、电子设备以及存储介质。Provided are a generation method, a device, an electronic device and a storage medium for a performance testing tool.
根据第一方面,提供了一种性能测试工具的生成方法,包括:获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类,测试类包括基类;将测试类的编程语言转化为其它编程语言,得到转化后测试类;获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类;生成包括派生类和转化后测试类的性能测试工具。According to the first aspect, a method for generating a performance testing tool is provided, including: obtaining a performance testing tool framework written in a target programming language, wherein the performance testing tool framework includes a test class that supports performance testing, and the test class includes a base class; Convert the programming language of the test class into other programming languages to obtain the converted test class; obtain the derived class that inherits the converted base class in the converted test class and is written in other programming languages; generate a derived class and a converted test class performance testing tool.
根据第二方面,提供了一种性能测试工具的生成装置,包括:获取单元,被配置成获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类,测试类包括基类;转化单元,被配置成将测试类的编程语言转化为其它编程语言,得到转化后测试类;派生单元,被配置成获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类;生成单元,被配置成生成包括派生类和转化后测试类的性能测试工具。According to the second aspect, a device for generating a performance testing tool is provided, including: an acquisition unit configured to obtain a performance testing tool framework written in a target programming language, wherein the performance testing tool framework includes a test class that supports performance testing, The test class includes a base class; the conversion unit is configured to convert the programming language of the test class into other programming languages to obtain the converted test class; the derivation unit is configured to obtain the converted base class in the inherited converted test class, and Derived classes written in other programming languages; the generation unit is configured to generate a performance testing tool including derived classes and converted test classes.
根据第三方面,提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行性能测试工具的生成方法中任一实施例的方法。According to a third aspect, an electronic device is provided, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are processed by at least one The processor executes, so that at least one processor can execute the method of any embodiment of the generation method of the performance testing tool.
根据第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,计算机指令用于使计算机执行根据性能测试工具的生成方法中任一实施例的方法。According to a fourth aspect, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute a method according to any embodiment of the method for generating a performance testing tool.
根据第五方面,提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现根据性能测试工具的生成方法中任一实施例的方法。According to a fifth aspect, a computer program product is provided, including a computer program that, when executed by a processor, implements a method according to any embodiment of the method for generating a performance testing tool.
根据本公开的方案,可以对测试框架,转化编程语言,不仅可以得到其它编程语言的性能测试工具,还可以打破编程语言的束缚,让性能测试工具中包括灵活性很强的派生类,增强了性能测试工具的多态性,从而可以支持性能测试工具的定制。According to the solution of the present disclosure, the testing framework can be converted into a programming language. Not only can the performance testing tools of other programming languages be obtained, but the constraints of the programming language can also be broken, so that the performance testing tools include highly flexible derived classes, which enhances the The polymorphism of performance testing tools can support the customization of performance testing tools.
附图说明Description of the drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本公开的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present disclosure will become more apparent upon reading the detailed description of the non-limiting embodiments with reference to the following drawings:
图1是本公开一些实施例可以应用于其中的示例性系统架构图;Figure 1 is an exemplary system architecture diagram in which some embodiments of the present disclosure may be applied;
图2是根据本公开的性能测试工具的生成方法的一个实施例的流程图;Figure 2 is a flow chart of one embodiment of a method for generating a performance testing tool according to the present disclosure;
图3是根据本公开的性能测试工具的生成方法的一个应用场景的示意图;Figure 3 is a schematic diagram of an application scenario of a method for generating a performance testing tool according to the present disclosure;
图4是根据本公开的性能测试工具的生成方法的又一个实施例的流程图;Figure 4 is a flow chart of yet another embodiment of a method for generating a performance testing tool according to the present disclosure;
图5是根据本公开的性能测试工具的生成装置的一个实施例的结构示意图;Figure 5 is a schematic structural diagram of an embodiment of a device for generating a performance testing tool according to the present disclosure;
图6是用来实现本公开实施例的性能测试工具的生成方法的电子设备的框图。FIG. 6 is a block diagram of an electronic device used to implement a method for generating a performance testing tool according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding and should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,采取了必要保密措施,且不违背公序良俗。In the technical solution of this disclosure, the acquisition, storage and application of the user's personal information are in compliance with relevant laws and regulations, necessary confidentiality measures have been taken, and do not violate public order and good customs.
需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本公开。It should be noted that, as long as there is no conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other. The present disclosure will be described in detail below in conjunction with embodiments with reference to the accompanying drawings.
图1示出了可以应用本公开的性能测试工具的生成方法或性能测试工具的生成装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 in which embodiments of the method for generating a performance test tool or the device for generating a performance test tool of the present disclosure can be applied.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Figure 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is a medium used to provide communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如视频类应用、直播应用、即时通信工具、邮箱客户端、社交平台软件等。Users can use terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, and 103, such as video applications, live broadcast applications, instant messaging tools, email clients, social platform software, etc.
这里的终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 here may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they may be various electronic devices with display screens, including but not limited to smartphones, tablet computers, e-book readers, laptop computers, desktop computers, and so on. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules used to provide distributed services), or as a single software or software module. There are no specific limitations here.
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103提供支持的后台服务器。后台服务器可以对接收到的性能测试工具生成请求等数据进行分析等处理,并将处理结果(例如生成的性能测试工具)反馈给终端设备。The server 105 may be a server that provides various services, such as a backend server that provides support for the terminal devices 101, 102, and 103. The background server can analyze and process data such as the received performance testing tool generation request, and feed back the processing results (such as the generated performance testing tool) to the terminal device.
需要说明的是,本公开实施例所提供的性能测试工具的生成方法可以由服务器105或者终端设备101、102、103执行,相应地,性能测试工具的生成装置可以设置于服务器105或者终端设备101、102、103中。It should be noted that the method for generating performance testing tools provided by the embodiments of the present disclosure can be executed by the server 105 or the terminal devices 101, 102, and 103. Correspondingly, the device for generating the performance testing tools can be provided on the server 105 or the terminal device 101. , 102, 103.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks and servers in Figure 1 is only illustrative. Depending on implementation needs, there can be any number of end devices, networks, and servers.
继续参考图2,示出了根据本公开的性能测试工具的生成方法的一个实施例的流程200。该性能测试工具的生成方法,包括以下步骤:Continuing to refer to FIG. 2 , a process 200 of one embodiment of a method for generating a performance testing tool according to the present disclosure is shown. The generation method of this performance testing tool includes the following steps:
步骤201,获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类,测试类包括基类。Step 201: Obtain a performance testing tool framework written in the target programming language, where the performance testing tool framework includes a test class that supports performance testing, and the test class includes a base class.
在本实施例中,性能测试工具的生成方法运行于其上的执行主体(例如图1所示的服务器或终端设备)可以获取采用目标编程语言编写的性能测试工具框架。性能测试工具框架包括类,该类也即支持、实现性能测试的测试类。因而,性能测试工具框架可以支持对于被测电子设备的性能测试。In this embodiment, the execution subject (such as the server or terminal device shown in Figure 1) on which the generation method of the performance testing tool runs can obtain the performance testing tool framework written in the target programming language. The performance testing tool framework includes classes, which are test classes that support and implement performance testing. Therefore, the performance testing tool framework can support performance testing of the electronic device under test.
上述的目标编程语言可以是各种编程语言,比如C++语言,或者C语言。The above-mentioned target programming language can be various programming languages, such as C++ language or C language.
具体地,基类指测试类中进行性能测试的核心类,是性能测试核心逻辑,也即核心程序,比如可以指示性能测试步骤。Specifically, the base class refers to the core class for performance testing in the test class. It is the core logic of performance testing, that is, the core program. For example, it can indicate performance testing steps.
步骤202,将测试类的编程语言转化为其它编程语言,得到转化后测试类。Step 202: Convert the programming language of the test class into other programming languages to obtain the converted test class.
在本实施例中,上述执行主体可以将测试类的编程语言转化为上述的其它编程语言,转化的结果为转化后测试类。这里的转化后测试类包括转化后基类。上述执行主体可以在接收到其它编程语言对应的测试需求的情况下执行该操作。In this embodiment, the above-mentioned execution subject can convert the programming language of the test class into the above-mentioned other programming languages, and the result of the conversion is the converted test class. The converted test class here includes the converted base class. The above execution subject can perform this operation after receiving test requirements corresponding to other programming languages.
在实践中,上述执行主体可以采用各种方式进行上述转化,以通过包装和编译一种编程语言,实现在该种编程语言与另一种编程语言之间通讯。比如,转化可以采用指定的用于转化的开发工具,比如swig。此外,还可以采用预先训练的模型进行转化,比如该模型可以是训练后的、用于转化的深度神经网络。In practice, the above-mentioned execution subject can perform the above-mentioned conversion in various ways to realize communication between this programming language and another programming language by packaging and compiling one programming language. For example, conversion can use designated development tools for conversion, such as swig. In addition, a pre-trained model can also be used for transformation. For example, the model can be a trained deep neural network used for transformation.
步骤203,获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类。Step 203: Obtain a derived class that inherits the transformed base class in the transformed test class and is written in other programming languages.
在本实施例中,上述执行主体可以获取转化后基类的派生类。具体地,该派生类继承了上述转化后基类,且采用了上述其它编程语言编写。这样,就得到了自定义类,比如,该自定义类可以是终端(比如业务终端)生成的。In this embodiment, the above execution subject can obtain the derived class of the converted base class. Specifically, the derived class inherits the above-mentioned converted base class and is written in the above-mentioned other programming languages. In this way, a custom class is obtained. For example, the custom class can be generated by a terminal (such as a business terminal).
步骤204,生成包括派生类和转化后测试类的性能测试工具。Step 204: Generate a performance testing tool including a derived class and a converted test class.
在本实施例中,上述执行主体可以生成性能测试工具,该性能测试工具包括上述派生类。并且,上述性能测试工具还包括转化后测试类。In this embodiment, the above execution subject can generate a performance testing tool, and the performance testing tool includes the above derived class. Moreover, the above performance testing tools also include post-conversion testing categories.
本公开的上述实施例提供的方法,可以对测试框架,转化编程语言,不仅可以得到其它编程语言的性能测试工具,还可以打破编程语言的束缚,让性能测试工具中包括灵活性很强的派生类,增强了性能测试工具的多态性,从而可以支持性能测试工具的定制。The methods provided by the above embodiments of the present disclosure can transform the testing framework into programming languages. Not only can performance testing tools for other programming languages be obtained, but the constraints of programming languages can also be broken, allowing performance testing tools to include highly flexible derivation. Class, which enhances the polymorphism of performance testing tools, thereby supporting the customization of performance testing tools.
继续参见图3,图3是根据本实施例的性能测试工具的生成方法的应用场景的一个示意图。在图3的应用场景中,执行主体301获取采用目标编程语言编写的性能测试工具框架302,其中,性能测试工具框架302包括支持性能测试的测试类,测试类包括基类。执行主体301将测试类的编程语言转化为其它编程语言,得到转化后测试类303。执行主体301获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类304。执行主体301生成包括派生类和转化后测试类的性能测试工具305。Continuing to refer to FIG. 3 , FIG. 3 is a schematic diagram of an application scenario of the method for generating a performance testing tool according to this embodiment. In the application scenario of Figure 3, the execution subject 301 obtains the performance testing tool framework 302 written in the target programming language. The performance testing tool framework 302 includes a test class that supports performance testing, and the test class includes a base class. The execution subject 301 converts the programming language of the test class into other programming languages to obtain the converted test class 303. The execution subject 301 obtains a derived class 304 that inherits the transformed base class in the transformed test class and is written in other programming languages. The execution subject 301 generates a performance testing tool 305 including a derived class and a converted test class.
进一步参考图4,其示出了性能测试工具的生成方法的又一个实施例的流程400。该流程400,包括以下步骤:Referring further to FIG. 4 , a process 400 of yet another embodiment of a method for generating a performance testing tool is shown. The process 400 includes the following steps:
步骤401,获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类。Step 401: Obtain a performance testing tool framework written in the target programming language, where the performance testing tool framework includes a test class that supports performance testing.
步骤402,采用第一转化方式,将基类的编程语言转化为其它编程语言,得到转化后基类,其中,转化后基类用于编写派生类。Step 402: Use the first conversion method to convert the programming language of the base class into other programming languages to obtain a converted base class, where the converted base class is used to write derived classes.
在本实施例中,上述测试类还可以包括控制类。上述执行主体可以采用第一转化方式,将上述基类的编程语言转化为上述其它编程语言,从而得到转化后基类。具体地,转化后基类用于编写上述派生类。In this embodiment, the above test class may also include a control class. The above-mentioned execution subject may use the first conversion method to convert the programming language of the above-mentioned base class into the above-mentioned other programming languages, thereby obtaining the converted base class. Specifically, the converted base class is used to write the above derived class.
控制类指测试类中控制性能测试的类,比如控制以下至少一项参数:性能测试的参数(比如统计延时线程占这一类线程总数的概率)、启动、停止、收集性能测试结果数据等。The control class refers to the class in the test class that controls the performance test, such as controlling at least one of the following parameters: parameters of the performance test (such as counting the probability of delayed threads accounting for the total number of threads of this type), starting, stopping, collecting performance test result data, etc. .
在实践中,可以存在两个控制类,分别是总控制类和精确控制类。总控制类用于限定各种参数,精确控制类可以包括各种执行程序,这些执行程序用于实现与上述各种参数相关的测试。In practice, there can be two control classes, namely the total control class and the precise control class. The general control class is used to define various parameters, and the precise control class can include various execution programs, which are used to implement tests related to the various parameters mentioned above.
步骤403,采用第二转化方式,将控制类的编程语言转化为其它编程语言,得到转化后控制类。Step 403: Use the second conversion method to convert the programming language of the control class into other programming languages to obtain the converted control class.
在本实施例中,对于基类和控制类的转化方式,可以是不同的。对于基类的转化方式,让转化后的基类能够被继承,从而得到上述其它编程语言编写的派生类。而对于控制类的转化方式则不能实现上述被继承的效果。In this embodiment, the conversion methods for the base class and the control class may be different. Regarding the conversion method of the base class, the converted base class can be inherited, thereby obtaining the derived classes written in other programming languages as mentioned above. For the conversion method of the control class, the above-mentioned inherited effect cannot be achieved.
举例来说,如果采用swig转化,则第一转化方式是具有支持跨语言多态(director)的特性的swig转化。而第二转化方式则是不具有该特性的swig转化。这里的多态指示涉及到原始类(比如转化后基类)和派生类。For example, if swig transformation is used, the first transformation method is swig transformation with the feature of supporting cross-language polymorphism (director). The second conversion method is swig conversion that does not have this feature. The polymorphic instructions here involve the original class (such as the converted base class) and the derived class.
步骤404,获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类。Step 404: Obtain a derived class that inherits the transformed base class in the transformed test class and is written in other programming languages.
步骤405,生成包括派生类和转化后测试类的性能测试工具。Step 405: Generate a performance testing tool including a derived class and a converted test class.
本实施例中的步骤401、步骤404和步骤405,与步骤201、步骤203和步骤204是相同或相似的,在此不再赘述。Step 401, step 404, and step 405 in this embodiment are the same or similar to step 201, step 203, and step 204, and will not be described again here.
本实施例可以通过第一转化方式,让转化后基类能够被继承,从而得到派生类。In this embodiment, the converted base class can be inherited through the first conversion method, thereby obtaining a derived class.
在本实施例的一些可选的实现方式中,方法还包括:响应于接收到对测试线程生成的令牌获取请求,确定测试线程的测试参数是否符合预设参数条件,其中,测试线程是在性能测试工具的转化后控制类创建的测试线程;若确定符合,则在性能测试工具框架,对测试线程分发令牌,其中,令牌指示启动测试线程。In some optional implementations of this embodiment, the method further includes: in response to receiving a token acquisition request generated for the test thread, determining whether the test parameters of the test thread meet the preset parameter conditions, wherein the test thread is in The test thread created by the converted control class of the performance testing tool; if it is determined to be consistent, a token is distributed to the test thread in the performance testing tool framework, where the token indicates starting the test thread.
在这些可选的实现方式中,上述执行主体可以在接收到性能测试工具对测试线程生成的令牌(token)获取请求的情况下,确定测试线程的测试参数是否符合预设参数条件。In these optional implementations, the above execution subject can determine whether the test parameters of the test thread meet the preset parameter conditions upon receiving a token acquisition request generated by the performance testing tool for the test thread.
测试参数指能够用于对测试线程进行限定的参数。比如,测试参数可以包括测试次数。在实践中,转化后控制类可以用于创建测试线程。Test parameters refer to parameters that can be used to limit the test thread. For example, test parameters can include the number of tests. In practice, the converted control class can be used to create test threads.
这些实现方式可以通过分发令牌,来对测试线程的启动进行控制,增加方案的可控性。These implementations can control the startup of test threads by distributing tokens, increasing the controllability of the solution.
在这些实现方式的一些可选的应用场景中,测试参数包括测试线程的以下的至少一项:系统吞吐量、测试次数和测试时间;对测试线程分发令牌,包括:按照指定时间单位,对测试线程分发令牌,其中,每个指定时间单位所分发的令牌数量不大于预设数量,指定时间单位与系统吞吐量成反比。In some optional application scenarios of these implementations, the test parameters include at least one of the following for the test thread: system throughput, number of tests, and test time; distributing tokens to the test thread includes: according to the specified time unit, The test thread distributes tokens, where the number of tokens distributed per specified time unit is no greater than the preset number, and the specified time unit is inversely proportional to the system throughput.
在这些可选的应用场景中,上述执行主体可以在上述的至少一项均符合预设参数条件的情况下,对该测试线程分发令牌。在实践中,可以对每个指定时间单位限定分发令牌的数量,比如,1个。In these optional application scenarios, the above-mentioned execution subject can distribute tokens to the test thread when at least one of the above-mentioned parameters meets the preset parameter conditions. In practice, the number of distributed tokens can be limited to, for example, 1 for each specified time unit.
指定时间单位可以是各种各样的,比如1秒钟。在实践中,指定时间单位可以是根据系统吞吐量确定的。比如,系统吞吐量可以采用TPS表示,一个指定时间单位可以是1/TPS秒。如果TPS是5,那么一个指定时间单位为0.2秒。The specified time unit can be various, such as 1 second. In practice, the specified time unit may be determined based on system throughput. For example, system throughput can be expressed in TPS, and a specified time unit can be 1/TPS second. If TPS is 5, then a specified time unit is 0.2 seconds.
这里的测试参数可以针对同一个类型(比如DemoWorker类型)的测试线程,也可以针对一轮测试的所有测试线程。The test parameters here can be for test threads of the same type (such as DemoWorker type), or for all test threads in a round of testing.
这些应用场景可以对于测试参数进行准确限定,并且,可以通过系统吞吐量,确定恰当的指定时间单位。在系统吞吐量大的时候,则可以更频繁地分发令牌。These application scenarios can accurately define the test parameters, and the system throughput can be used to determine the appropriate designated time unit. When the system throughput is high, tokens can be distributed more frequently.
在本实施例的任一实施例的一些可选的实现方式中,在得到集成的转化后测试类之后,性能测试工具的运行步骤包括:响应于接收到工具运行指令,在性能测试工具的测试线程,调用派生类。In some optional implementations of any embodiment of this embodiment, after obtaining the integrated converted test class, the running steps of the performance testing tool include: in response to receiving the tool running instruction, during the test of the performance testing tool Thread, call derived class.
在这些可选的实现方式中,上述执行主体或者其它电子设备可以在接收到工具运行指令的情况下,在性能测试工具的测试线程,调用上述的派生类,从而可以执行该派生类。In these optional implementations, the above-mentioned execution subject or other electronic device can call the above-mentioned derived class in the test thread of the performance testing tool after receiving the tool running instruction, so that the derived class can be executed.
这些实现方式中的性能测试工具可以在测试线程中调用派生类,以实现派生类的执行。The performance testing tools in these implementations can call the derived class in the test thread to implement the execution of the derived class.
在这些实现方式的一些可选的应用场景中,测试类还包括控制类;上述在性能测试工具的测试线程,调用派生类,可以包括:响应于接收到工具运行指令,在性能测试工具的测试线程,通过调用转化后测试类中的转化后控制类,获取性能测试条件信息;若性能测试条件信息指示当前满足性能测试条件,则在性能测试工具的测试线程,调用派生类。In some optional application scenarios of these implementation methods, the test class also includes a control class; the above-mentioned test thread in the performance testing tool, calling the derived class, may include: in response to receiving the tool running instruction, in the test of the performance testing tool The thread obtains the performance test condition information by calling the converted control class in the converted test class; if the performance test condition information indicates that the performance test conditions are currently met, the derived class is called in the test thread of the performance testing tool.
在这些可选的应用场景中,上述执行主体可以在从本设备或者其它电子设备接收到工具运行指令的情况下,在性能测试工具的测试线程,调用转化后控制类。通过调用转化后控制类(比如转化后控制类中的指定函数)可以获取性能测试条件信息。如果性能测试条件信息指示当前满足执行性能测试的条件,则可以在性能测试工具的测试线程,调用派生类。In these optional application scenarios, the above-mentioned execution subject can call the converted control class in the test thread of the performance testing tool after receiving the tool running instructions from this device or other electronic devices. Performance test condition information can be obtained by calling the converted control class (such as the specified function in the converted control class). If the performance test condition information indicates that the conditions for executing the performance test are currently met, the derived class can be called in the test thread of the performance test tool.
在调用派生类之前,上述执行主体可以通过调用转化后控制类中的指定函数(比如get_token()函数),获取性能测试条件信息。所获取的性能测试条件信息,可以指示当前满足性能测试条件,或者当前不满足性能测试条件。在当前不满足性能测试条件的情况下,则上述执行主体退出性能测试。Before calling the derived class, the above execution subject can obtain the performance test condition information by calling the specified function (such as the get_token() function) in the converted control class. The obtained performance test condition information may indicate that the performance test condition is currently met, or that the performance test condition is currently not met. If the performance test conditions are not currently met, the above execution subject exits the performance test.
这些应用场景可以在调用派生类之前,先确定当前是否满足性能测试条件,并在满足的情况下,再执行调用派生类,从而可以确保在恰当的时机进行测试。These application scenarios can determine whether the performance test conditions are currently met before calling the derived class, and then call the derived class if they are met, thus ensuring that the test is performed at the appropriate time.
在本实施例的任一实施例的一些可选的实现方式中,中控设备与包括性能测试工具的至少两个性能测试工具构成分布式测试系统,在分布式测试系统中,中控设备为主设备,性能测试工具所在的电子设备为从设备;性能测试工具的运行步骤,包括:接收中控设备下发的测试启动指令、配置更新指令和测试停止指令;向中控设备发送注册请求、测试结果参数和性能测试结果。In some optional implementations of any embodiment of this embodiment, the central control device and at least two performance test tools including performance test tools constitute a distributed test system. In the distributed test system, the central control device is The master device, the electronic device where the performance test tool is located is the slave device; the running steps of the performance test tool include: receiving the test start command, configuration update command and test stop command issued by the central control device; sending a registration request to the central control device, Test result parameters and performance test results.
在这些可选的实现方式中,设备可以是实体设备也可以是虚拟设备。性能测试工具所在的电子设备可以是容器。该电子设备可以接收中控设备下发的各种指令。性能测试工具与中控设备(也即中控节点)之间存在双向的通信连接。比如,可以采用WebSocket连接。In these alternative implementations, the device can be a physical device or a virtual device. The electronic device in which the performance testing tool resides can be the container. This electronic device can receive various instructions issued by the central control device. There is a two-way communication connection between the performance testing tool and the central control device (that is, the central control node). For example, you can use WebSocket connection.
在实践中,中控设备可以接收中控设备下发的指令,也可以向中控设备上传各种信息。这里的测试结果参数可以是在启动测试时上传的,比如可以包括要统计的性能测试结果参数,例如统计测试线程中99%的操作延迟、以及测试线程中99.9%的操作延迟。In practice, the central control device can receive instructions issued by the central control device and can also upload various information to the central control device. The test result parameters here can be uploaded when starting the test, and can include, for example, performance test result parameters to be counted, such as statistics on 99% of the operation delays in the test thread and 99.9% of the operation delays in the test thread.
具体地,中控设备可以与时序数据库存在通信连接。Specifically, the central control device may have a communication connection with the time series database.
这些实现方式可以对性能测试工具建立分布式系统,从而让中控设备同时控制所有性能测试工具,收集各个性能测试工具的数据,以便于进行性能的分布式测试,也即支持多个工具联动进行分布式性能测试(比如压力测试),并对性能测试结果进行整合。These implementation methods can establish a distributed system for performance testing tools, allowing the central control device to control all performance testing tools at the same time and collect data from each performance testing tool to facilitate distributed performance testing, that is, to support the linkage of multiple tools. Distributed performance testing (such as stress testing) and integrating performance test results.
在本实施例的任一实施例的一些可选的实现方式中,方法还包括:在性能测试工具框架中,添加支持异步上传的指定回调函数;以及性能测试工具的运行步骤,包括:向目标终端发送包括指定回调函数的异步数据请求,其中,目标终端响应于接收到异步数据请求,对被测电子设备回调指定回调函数,以使被测电子设备异步上传性能测试结果;接收被测电子设备异步上传的性能测试结果。In some optional implementations of any embodiment of this embodiment, the method also includes: adding a designated callback function that supports asynchronous upload in the performance testing tool framework; and the running steps of the performance testing tool include: The terminal sends an asynchronous data request including a specified callback function, wherein in response to receiving the asynchronous data request, the target terminal calls back the specified callback function to the electronic device under test, so that the electronic device under test uploads the performance test results asynchronously; receives the electronic device under test Performance test results of asynchronous upload.
在这些可选的实现方式中,上述执行主体或者其它电子设备可以在性能测试工具框架中,添加指定回调函数,以实现被测电子设备的异步上传过程。具体地,添加该指定回调函数,相当于在回调函数中添加该指定回调函数(record_result函数)。针对哪个设备(也即目标终端比如业务终端)进行该指定回调函数的回调,则可以让该设备实现异步上传。In these optional implementation methods, the above-mentioned execution subject or other electronic devices can add a specified callback function in the performance testing tool framework to implement the asynchronous upload process of the electronic device under test. Specifically, adding the specified callback function is equivalent to adding the specified callback function (record_result function) in the callback function. Depending on which device (that is, the target terminal such as a business terminal) the specified callback function is called, the device can be uploaded asynchronously.
这些实现方式可以通过回调函数,实现性能测试结果的异步上传。These implementation methods can implement asynchronous uploading of performance test results through callback functions.
进一步参考图5,作为对上述各图所示方法的实现,本公开提供了一种性能测试工具的生成装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,除下面所记载的特征外,该装置实施例还可以包括与图2所示的方法实施例相同或相应的特征或效果。该装置具体可以应用于各种电子设备中。With further reference to Figure 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for generating a performance testing tool. This device embodiment corresponds to the method embodiment shown in Figure 2, except that In addition to the features described below, the device embodiment may also include the same or corresponding features or effects as the method embodiment shown in FIG. 2 . The device can be applied in various electronic devices.
如图5所示,本实施例的性能测试工具的生成装置500包括:获取单元501、转化单元502、派生单元503和生成单元504。其中,获取单元501,被配置成获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类,测试类包括基类;转化单元502,被配置成将测试类的编程语言转化为其它编程语言,得到转化后测试类;派生单元503,被配置成获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类;生成单元504,被配置成生成包括派生类和转化后测试类的性能测试工具。As shown in FIG. 5 , the performance testing tool generation device 500 of this embodiment includes: an acquisition unit 501 , a conversion unit 502 , a derivation unit 503 and a generation unit 504 . Among them, the acquisition unit 501 is configured to obtain a performance testing tool framework written in the target programming language, where the performance testing tool framework includes test classes that support performance testing, and the test classes include base classes; the conversion unit 502 is configured to convert the test The programming language of the class is converted into other programming languages to obtain the converted test class; the derivation unit 503 is configured to obtain a derived class that inherits the converted base class in the converted test class and is written in other programming languages; the generation unit 504, Configured to generate performance testing tools that include derived classes and transformed test classes.
在本实施例中,性能测试工具的生成装置500的获取单元501、转化单元502、派生单元503和生成单元504的具体处理及其所带来的技术效果可分别参考图2对应实施例中步骤201、步骤202、步骤203和步骤204的相关说明,在此不再赘述。In this embodiment, the specific processing of the acquisition unit 501, the conversion unit 502, the derivation unit 503 and the generation unit 504 of the performance testing tool generation device 500 and the technical effects thereof can be referred to the steps in the corresponding embodiment of Figure 2 respectively. The relevant descriptions of step 201, step 202, step 203 and step 204 will not be repeated here.
在本实施例的一些可选的实现方式中,测试类还包括控制类;转化单元,进一步被配置成按照如下方式执行将测试类的编程语言转化为其它编程语言,得到转化后测试类:采用第一转化方式,将基类的编程语言转化为其它编程语言,得到转化后基类,其中,转化后基类用于编写派生类;采用第二转化方式,将控制类的编程语言转化为其它编程语言,得到转化后控制类。In some optional implementations of this embodiment, the test class also includes a control class; the conversion unit is further configured to convert the programming language of the test class into other programming languages in the following manner, and obtain the converted test class: using The first conversion method is to convert the programming language of the base class into other programming languages to obtain the converted base class, in which the converted base class is used to write derived classes; the second conversion method is used to convert the programming language of the control class into other programming languages. Programming language, get the converted control class.
在本实施例的一些可选的实现方式中,装置还包括:确定单元,被配置成响应于接收到对测试线程生成的令牌获取请求,确定测试线程的测试参数是否符合预设参数条件,其中,测试线程是在性能测试工具的转化后控制类创建的测试线程;分发单元,被配置成若确定符合,则在性能测试工具框架,对测试线程分发令牌,其中,令牌指示启动测试线程。In some optional implementations of this embodiment, the device further includes: a determination unit configured to determine whether the test parameters of the test thread meet the preset parameter conditions in response to receiving a token acquisition request generated for the test thread, Among them, the test thread is a test thread created by the control class after the conversion of the performance testing tool; the distribution unit is configured to distribute tokens to the test thread in the performance testing tool framework if it is determined to be consistent, where the token indicates to start the test thread.
在本实施例的一些可选的实现方式中,测试参数包括测试线程的以下的至少一项:系统吞吐量、测试次数和测试时间;分发单元,进一步被配置成按照如下方式执行对测试线程分发令牌:按照指定时间单位,对测试线程分发令牌,其中,每个指定时间单位所分发的令牌数量不大于预设数量,指定时间单位与系统吞吐量成反比。In some optional implementations of this embodiment, the test parameters include at least one of the following of the test thread: system throughput, number of tests, and test time; the distribution unit is further configured to perform distribution of the test thread in the following manner Tokens: Distribute tokens to the test thread according to the specified time unit. The number of tokens distributed for each specified time unit is not greater than the preset number. The specified time unit is inversely proportional to the system throughput.
在本实施例的一些可选的实现方式中,性能测试工具的运行步骤包括:响应于接收到工具运行指令,在性能测试工具的测试线程,调用派生类。In some optional implementations of this embodiment, the steps of running the performance testing tool include: in response to receiving the tool running instruction, calling a derived class in the test thread of the performance testing tool.
在本实施例的一些可选的实现方式中,测试类还包括控制类;在性能测试工具的测试线程,调用派生类,包括:响应于接收到工具运行指令,在性能测试工具的测试线程,通过调用转化后测试类中的转化后控制类,获取性能测试条件信息;若性能测试条件信息指示当前满足性能测试条件,则在性能测试工具的测试线程,调用派生类。In some optional implementations of this embodiment, the test class also includes a control class; in the test thread of the performance testing tool, calling the derived class includes: in response to receiving the tool running instruction, in the test thread of the performance testing tool, Obtain the performance test condition information by calling the converted control class in the converted test class; if the performance test condition information indicates that the performance test conditions are currently met, call the derived class in the test thread of the performance testing tool.
在本实施例的一些可选的实现方式中,中控设备与包括性能测试工具的至少两个性能测试工具构成分布式测试系统,在分布式测试系统中,中控设备为主设备,性能测试工具所在的电子设备为从设备;性能测试工具的运行步骤,包括:接收中控设备下发的测试启动指令、配置更新指令和测试停止指令;向中控设备发送注册请求、测试结果参数和性能测试结果。In some optional implementations of this embodiment, the central control device and at least two performance test tools including performance test tools constitute a distributed test system. In the distributed test system, the central control device is the main device, and the performance test The electronic device where the tool is located is a slave device; the running steps of the performance test tool include: receiving test start instructions, configuration update instructions and test stop instructions issued by the central control device; sending registration requests, test result parameters and performance to the central control device Test Results.
在本实施例的一些可选的实现方式中,装置还包括:添加单元,被配置成在性能测试工具框架中,添加支持异步上传的指定回调函数;以及性能测试工具的运行步骤,包括:向目标终端发送包括指定回调函数的异步数据请求,其中,目标终端响应于接收到异步数据请求,对被测电子设备回调指定回调函数,以使被测电子设备异步上传性能测试结果;接收被测电子设备异步上传的性能测试结果。In some optional implementations of this embodiment, the device further includes: an adding unit configured to add a specified callback function that supports asynchronous upload in the performance testing tool framework; and the running steps of the performance testing tool include: The target terminal sends an asynchronous data request including a specified callback function. In response to receiving the asynchronous data request, the target terminal calls back the specified callback function to the electronic device under test so that the electronic device under test uploads the performance test results asynchronously; receives the electronic device under test Performance test results of device asynchronous upload.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
如图6所示,是根据本公开实施例的性能测试工具的生成方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。As shown in FIG. 6 , it is a block diagram of an electronic device according to a method for generating a performance testing tool according to an embodiment of the present disclosure. Electronic devices are intended to refer to various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are examples only and are not intended to limit implementations of the disclosure described and/or claimed herein.
如图6所示,该电子设备包括:一个或多个处理器601、存储器602,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器601为例。As shown in Figure 6, the electronic device includes: one or more processors 601, memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be mounted on a common motherboard or otherwise mounted as desired. The processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired. Likewise, multiple electronic devices can be connected, each device providing part of the necessary operation (eg, as a server array, a set of blade servers, or a multi-processor system). In Figure 6, a processor 601 is taken as an example.
存储器602即为本公开所提供的非瞬时计算机可读存储介质。其中,存储器存储有可由至少一个处理器执行的指令,以使至少一个处理器执行本公开所提供的性能测试工具的生成方法。本公开的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本公开所提供的性能测试工具的生成方法。The memory 602 is the non-transitory computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor, so that at least one processor executes the method for generating a performance testing tool provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to cause the computer to execute the method for generating a performance testing tool provided by the present disclosure.
存储器602作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本公开实施例中的性能测试工具的生成方法对应的程序指令/模块(例如,附图5所示的获取单元501、转化单元502、派生单元503和生成单元504)。处理器601通过运行存储在存储器602中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的性能测试工具的生成方法。As a non-transient computer-readable storage medium, the memory 602 can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions/modules corresponding to the method for generating performance testing tools in the embodiments of the present disclosure ( For example, the acquisition unit 501, the conversion unit 502, the derivation unit 503 and the generation unit 504 shown in Figure 5). The processor 601 executes various functional applications and data processing of the server by running non-transient software programs, instructions and modules stored in the memory 602, that is, implementing the method for generating the performance testing tool in the above method embodiment.
存储器602可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据性能测试工具的生成电子设备的使用所创建的数据等。此外,存储器602可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器602可选包括相对于处理器601远程设置的存储器,这些远程存储器可以通过网络连接至性能测试工具的生成电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 602 may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created according to the use of the electronic device generated by the performance testing tool. wait. In addition, memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 602 optionally includes memory located remotely relative to processor 601, and these remote memories may be connected via a network to the generation electronics of the performance testing tool. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
性能测试工具的生成方法的电子设备还可以包括:输入装置603和输出装置604。处理器601、存储器602、输入装置603和输出装置604可以通过总线或者其他方式连接,图6中以通过总线连接为例。The electronic device of the method for generating a performance test tool may also include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 can be connected through a bus or other means. In Figure 6, connection through a bus is taken as an example.
输入装置603可接收输入的数字或字符信息,以及产生与性能测试工具的生成电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置604可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 603 can receive input numeric or character information, and generate key signal input related to user settings and function control of the electronic device generated by the performance testing tool, such as a touch screen, keypad, mouse, trackpad, touch pad, pointing stick , one or more input devices such as mouse buttons, trackballs, and joysticks. Output devices 604 may include display devices, auxiliary lighting devices (eg, LEDs), tactile feedback devices (eg, vibration motors), and the like. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein may be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include implementation in one or more computer programs executable and/or interpreted on a programmable system including at least one programmable processor, the programmable processor The processor, which may be a special purpose or general purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device. An output device.
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computing programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine language Calculation program. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or means for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLD)), including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or a trackball) through which a user can provide input to the computer. Other kinds of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and may be provided in any form, including Acoustic input, voice input or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., A user's computer having a graphical user interface or web browser through which the user can interact with implementations of the systems and technologies described herein), or including such backend components, middleware components, or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communications network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务("Virtual Private Server",或简称"VPS")中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。Computer systems may include clients and servers. Clients and servers are generally remote from each other and typically interact over a communications network. The relationship of client and server is created by computer programs running on corresponding computers and having a client-server relationship with each other. The server can be a cloud server, also known as cloud computing server or cloud host. It is a host product in the cloud computing service system to solve the problem of traditional physical host and VPS service ("Virtual Private Server", or "VPS" for short) Among them, there are defects such as difficult management and weak business scalability. The server can also be a distributed system server or a server combined with a blockchain.
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of code that contains one or more logic functions that implement the specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown one after another may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of specialized hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、转化单元、派生单元和生成单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取采用目标编程语言编写的性能测试工具框架的单元”。The units involved in the embodiments of the present disclosure can be implemented in software or hardware. The described unit may also be provided in a processor. For example, it may be described as follows: a processor includes an acquisition unit, a conversion unit, a derivation unit and a generation unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the acquisition unit can also be described as "the unit that acquires the performance testing tool framework written in the target programming language."
作为另一方面,本公开还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:获取采用目标编程语言编写的性能测试工具框架,其中,性能测试工具框架包括支持性能测试的测试类,测试类包括基类;将测试类的编程语言转化为其它编程语言,得到转化后测试类;获取继承转化后测试类中的转化后基类、且采用其它编程语言编写的派生类;生成包括派生类和转化后测试类的性能测试工具。As another aspect, the present disclosure also provides a computer-readable medium. The computer-readable medium may be included in the device described in the above embodiments; it may also exist separately without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the device, the device: obtains a performance testing tool framework written in the target programming language, wherein the performance testing tool framework includes support Test class for performance testing, the test class includes a base class; convert the programming language of the test class into other programming languages to obtain the converted test class; obtain the converted base class that inherits the converted test class and is written in other programming languages Derived classes; generate performance testing tools including derived classes and converted test classes.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a description of the preferred embodiments of the present disclosure and the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to technical solutions formed by a specific combination of the above technical features, but should also cover any solution consisting of the above technical features or without departing from the above inventive concept. Other technical solutions formed by any combination of equivalent features. For example, a technical solution is formed by replacing the above features with technical features with similar functions disclosed in this disclosure (but not limited to).
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110655398.2ACN113377638B (en) | 2021-06-11 | 2021-06-11 | Method and device for generating performance test tool |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110655398.2ACN113377638B (en) | 2021-06-11 | 2021-06-11 | Method and device for generating performance test tool |
| Publication Number | Publication Date |
|---|---|
| CN113377638A CN113377638A (en) | 2021-09-10 |
| CN113377638Btrue CN113377638B (en) | 2023-10-27 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110655398.2AActiveCN113377638B (en) | 2021-06-11 | 2021-06-11 | Method and device for generating performance test tool |
| Country | Link |
|---|---|
| CN (1) | CN113377638B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118364756A (en)* | 2023-01-18 | 2024-07-19 | 芯华章科技股份有限公司 | Verification system, verification method, electronic device, and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5493680A (en)* | 1992-07-06 | 1996-02-20 | National Business Machines Corporation | Method for creating an object subclass with selective inheritance |
| CN1573688A (en)* | 2003-06-10 | 2005-02-02 | 微软公司 | Systems and methods for employing tagged types in a dynamic runtime environment |
| CN107678941A (en)* | 2017-08-31 | 2018-02-09 | 深圳市小牛在线互联网信息咨询有限公司 | Method and device, storage medium and the computer equipment of Application testing |
| CN110134378A (en)* | 2018-02-08 | 2019-08-16 | 腾讯科技(深圳)有限公司 | Application program creation method and device, computer equipment and storage medium |
| CN110275706A (en)* | 2019-07-01 | 2019-09-24 | 拉扎斯网络科技(上海)有限公司 | Program issuing and loading method, device, computer system and readable storage medium |
| CN111240681A (en)* | 2019-12-30 | 2020-06-05 | 瑞庭网络技术(上海)有限公司 | Method and device for converting different programming languages |
| CN112181822A (en)* | 2020-09-24 | 2021-01-05 | 北京达佳互联信息技术有限公司 | Test method and test method for starting time consumption of application program |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| RU2017110071A (en)* | 2017-03-24 | 2018-09-24 | Оракл Интернэйшнл Корпорейшн | TRANSFORMING SOURCE PROGRAMMING LANGUAGE CODE |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5493680A (en)* | 1992-07-06 | 1996-02-20 | National Business Machines Corporation | Method for creating an object subclass with selective inheritance |
| CN1573688A (en)* | 2003-06-10 | 2005-02-02 | 微软公司 | Systems and methods for employing tagged types in a dynamic runtime environment |
| CN107678941A (en)* | 2017-08-31 | 2018-02-09 | 深圳市小牛在线互联网信息咨询有限公司 | Method and device, storage medium and the computer equipment of Application testing |
| CN110134378A (en)* | 2018-02-08 | 2019-08-16 | 腾讯科技(深圳)有限公司 | Application program creation method and device, computer equipment and storage medium |
| CN110275706A (en)* | 2019-07-01 | 2019-09-24 | 拉扎斯网络科技(上海)有限公司 | Program issuing and loading method, device, computer system and readable storage medium |
| CN111240681A (en)* | 2019-12-30 | 2020-06-05 | 瑞庭网络技术(上海)有限公司 | Method and device for converting different programming languages |
| CN112181822A (en)* | 2020-09-24 | 2021-01-05 | 北京达佳互联信息技术有限公司 | Test method and test method for starting time consumption of application program |
| Publication number | Publication date |
|---|---|
| CN113377638A (en) | 2021-09-10 |
| Publication | Publication Date | Title |
|---|---|---|
| CN111831420B (en) | Method for task scheduling, related device and computer program product | |
| JP7194162B2 (en) | Data processing method, device, electronic device and storage medium | |
| CN110008045B (en) | Method, device and equipment for aggregating microservices and storage medium | |
| CN110765024B (en) | Simulation test method, simulation test device, electronic equipment and computer readable storage medium | |
| CN113434384B (en) | Pressure testing method and device | |
| WO2022170760A1 (en) | Method and apparatus for cloud platform management, electronic device, and storage medium | |
| CN117574868A (en) | Chart generation method, device, equipment and storage medium | |
| CN114071190B (en) | Cloud application video stream processing method, related device and computer program product | |
| CN114911598A (en) | Task scheduling method, device, equipment and storage medium | |
| CN114328132A (en) | State monitoring method, apparatus, device and medium for external data source | |
| CN116774996A (en) | Integrated development system, code processing method, electronic device, and storage medium | |
| CN114327918B (en) | Method and device for adjusting resource amount, electronic equipment and storage medium | |
| CN113377638B (en) | Method and device for generating performance test tool | |
| CN113672671B (en) | Method and device for realizing data processing | |
| CN113905040A (en) | File transfer method, apparatus, system, device and storage medium | |
| CN114912522B (en) | Information classification method and device | |
| WO2023169193A1 (en) | Method and device for generating smart contract | |
| CN113542802B (en) | Video transition method and device | |
| CN115757120A (en) | Pressure testing method and device, electronic equipment and readable storage medium | |
| WO2023088462A1 (en) | Method and apparatus for processing data, device, and storage medium | |
| CN115904981A (en) | Automated unit test method, automated unit test device, electronic apparatus, and storage medium | |
| CN115576977A (en) | Data paging query method, device, electronic equipment and storage medium | |
| CN114095758A (en) | Cloud image interception method, related device and computer program product | |
| CN114070889A (en) | Configuration method, traffic forwarding method, device, storage medium and program product | |
| CN113076256A (en) | Pressure testing method and device |
| 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |