CN114691529B - gPC interface performance test method and device - Google Patents

gPC interface performance test method and device Download PDF

Info

Publication number
CN114691529B
CN114691529B CN202210603098.4A CN202210603098A CN114691529B CN 114691529 B CN114691529 B CN 114691529B CN 202210603098 A CN202210603098 A CN 202210603098A CN 114691529 B CN114691529 B CN 114691529B
Authority
CN
China
Prior art keywords
interface
gpc
performance test
scene
script
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.)
Active
Application number
CN202210603098.4A
Other languages
Chinese (zh)
Other versions
CN114691529A (en
Inventor
邓斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202210603098.4A priority Critical patent/CN114691529B/en
Publication of CN114691529A publication Critical patent/CN114691529A/en
Application granted granted Critical
Publication of CN114691529B publication Critical patent/CN114691529B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

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)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a device for testing performance of a gPC interface, wherein the method comprises the following steps: creating at least one scene template for performance test of a gPC interface; configuring script information of at least one script for the gPC interface performance test in a scene template; combining the scripts for the performance test of the gPC interface according to the running step sequence of the scripts to generate a scene for the performance test of the gPC interface; running at least one scene of the gPC interface performance test according to the configured scene running mode information, and executing a gPC interface performance test script in the scene of the gPC interface performance test to perform the gPC interface performance test; and obtaining the result of the performance test of the gPC interface. According to the invention, through filling parameters of the script of the gPC interface performance test in the test platform and supporting different script combinations into rich test scenes, the user behavior is simulated to the maximum extent, and the user experience is improved.

Description

gPC interface performance test method and device
Technical Field
The invention relates to the field of interface performance testing, in particular to a method and a device for testing performance of a gPC interface.
Background
The gPC is a high-performance and universal open source RPC (Remote Procedure Call) framework, is mainly developed for mobile application and is designed based on HTTP/2 protocol standard; the gRPC is designed based on the HTTP/2 Protocol standard, so that it can implement features such as bidirectional flow Control, header compression, multiple multiplexing requests on a single TCP (Transmission Control Protocol) connection, etc., which make it perform better on a mobile device, save more power and space.
When a user wants to know the flow condition which can be borne by a certain service scene realized by the gRPC, the performance test needs to be carried out on the related gRPC interface; in the prior art, two schemes for testing the performance of the gPC interface are mainly provided; one is that the gPC interface is first converted into HTTP interface by some specific technological method, and then the gPC interface is indirectly tested by universal HTTP interface performance test tool; however, if the gRPC interface is converted into the HTTP interface, the performance test is performed indirectly, and the conversion technology is complex and complicated; another requires specialized performance testing tools; however, it is necessary to write a complicated script file, and execute the script file in a command manner, which is not easy to operate, and it is not easy to combine a plurality of interfaces into one service scenario for performance testing.
Disclosure of Invention
The invention provides a method and a device for testing performance of a gPC interface, which are used for solving the problems that the operation is not easy and the requirements of rich service scenes cannot be met in the prior art.
In order to solve the above problems, the present invention is realized by:
in a first aspect, an embodiment of the present invention provides a method for testing performance of a gRPC interface, including:
creating at least one scene template for performance test of a gPC interface;
configuring script information of at least one script for the gPC interface performance test in the scene template; the script information comprises a step sequence of script operation;
combining the scripts for the performance test of the gPC interface according to the sequence of the steps of running the scripts to generate a scene for the performance test of the gPC interface;
configuring scene operation mode information for at least one selected scene of the gPC interface performance test;
running the scene of the performance test of the at least one gPC interface according to the configured scene running mode information, and executing a script of the performance test of the gPC interface in the scene of the performance test of the gPC interface to perform the performance test of the gPC interface;
and obtaining the performance test result of the gPC interface.
Optionally, the method further includes: and generating a gPC interface performance test report according to the result of the gPC interface performance test, and analyzing the gPC interface performance test report.
Optionally, the script information further includes at least one of the following: script name, request mode, interface request parameters, request address, interface service, interface method, and assertion.
Optionally, the interface request parameter includes a custom function, and test data required by the interface performance test is generated through the custom function.
Optionally, the scene operation mode information includes at least one of: pressure measurement requirements, scene modes, services, running modes and target thread counts.
Optionally, the scene mode includes: a cyclic scenario and a progressive scenario; when a loop scenario is selected, the run time can also be set; when the progressive scene is selected, at least one of the following may also be set: preparation time, number of steps and stable running time.
In a second aspect, an embodiment of the present invention provides an apparatus for testing performance of a gRPC interface, including:
the system comprises a creating module, a judging module and a judging module, wherein the creating module is used for creating at least one scene template for performance test of a gPC interface;
a first configuration module, configured to configure script information of a script of at least one gRPC interface performance test in the scene template; the script information comprises a step sequence of script operation;
the generation module is used for combining the scripts for the performance test of the gPC interface according to the sequence of the steps of the script operation to generate a scene of the performance test of the gPC interface;
the second configuration module is used for configuring scene operation mode information for the selected scene of the performance test of the at least one gPC interface;
the execution module is used for operating the scene of the performance test of the at least one gPC interface according to the configured scene operation mode information, and executing a script of the performance test of the gPC interface in the scene of the performance test of the gPC interface to carry out the performance test of the gPC interface;
and the result generation module is used for obtaining the result of the performance test of the gPC interface.
Optionally, the method further includes:
and the analysis module is used for generating a gPC interface performance test report according to the result of the gPC interface performance test and analyzing the gPC interface performance test report.
Optionally, the script information further includes at least one of the following: script name, request mode, interface request parameters, request address, interface service, interface method, and assertion.
Optionally, the interface request parameter includes a custom function, and test data required by the interface performance test is generated through the custom function.
Optionally, the scene operation mode information includes at least one of: pressure measurement requirements, scene modes, services, running modes and target thread counts.
Optionally, the scene mode includes: a cyclic scenario and a progressive scenario; when a loop scenario is selected, the run time can also be set; when the progressive scene is selected, at least one of the following may also be set: preparation time, number of steps and stable running time.
In a third aspect, an embodiment of the present invention provides a server, including: a processor, a memory, and a program stored on the memory and running on the processor, which when executed by the processor, implement the steps of the method of performance testing a gRPC interface as recited in any one of the first aspects.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of gRPC interface performance testing according to any one of the first aspects.
In the invention, by filling parameters of the script for the performance test of the gPC interface in the test platform, testers can conveniently and efficiently write the needed script for the performance test of the gPC interface and share the script on the test platform; combining scripts for testing the performance of different gRPC interfaces to form various gRPC interface performance test scenes; according to the method, the behavior of the user in the real scene is analyzed, and the performance test scene of the gPC interface is operated by setting different scene modes, so that the behavior of the user is simulated to the maximum extent, and the user experience is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart of a method for testing performance of a gRPC interface according to an embodiment of the present invention;
fig. 2 is an interface schematic diagram of a method for testing performance of a gRPC interface according to an embodiment of the present invention;
fig. 3 is an interface schematic diagram of another method for testing the performance of a gRPC interface according to an embodiment of the present invention;
fig. 4 is a schematic general flow chart of a method for testing performance of a gRPC interface according to an embodiment of the present invention;
fig. 5 is a schematic view of a scene flow of a method for testing performance of a gRPC interface according to an embodiment of the present invention;
fig. 6 is an architecture diagram of an apparatus for testing performance of a gRPC interface according to an embodiment of the present invention;
fig. 7 is a diagram of a server architecture according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention, are within the scope of the invention.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. The use of "first," "second," and similar terms in the present application do not denote any order, quantity, or importance, but rather the terms are used to distinguish one element from another. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships are changed accordingly.
Referring to fig. 1, an embodiment of the present invention provides a method for testing performance of a gRPC interface, including:
step 11: creating at least one scene template for performance test of a gPC interface;
step 12: configuring script information of at least one script for the gPC interface performance test in the scene template; the script information comprises a step sequence of script operation;
step 13: combining the scripts for the performance test of the gPC interface according to the sequence of the steps of running the scripts to generate a scene for the performance test of the gPC interface;
step 14: configuring scene operation mode information for at least one selected scene of the gPC interface performance test;
step 15: running the scene of the performance test of the at least one gPC interface according to the configured scene running mode information, and executing a script of the performance test of the gPC interface in the scene of the performance test of the gPC interface to perform the performance test of the gPC interface;
step 16: and obtaining the performance test result of the gPC interface.
In step 11, a scene template for gRPC interface performance testing is created on a performance scene testing page of a testing platform, i.e., a server, by adding, and is used for subsequently adding a script for gRPC interface performance testing to the scene template; as shown in fig. 2, a scene name associated with the performance test requirement of the gRPC interface is filled in a customized manner at a "scene name" of a window to which a scene template is added, so as to identify which aspect of the performance test of the service the gRPC interface performance test scene template is used for, for example: "task library live mode scenario"; at the 'item' position of the window, an item to which the actual service corresponding to the performance test of the gPC interface belongs is selected, for example: "settle accounts"; and creating a scene template for performance test of at least one gPC interface on the test platform.
Referring to fig. 3, in step 12-13, the created scene template is selected, and a corresponding script for gRPC interface performance test is added by clicking a "new script" button of the corresponding "operation" column of the page; configuring script information of at least one script for the performance test of the gPC interface in the scene template according to the gPC interface related to an actual service scene; the script information comprises a step sequence of script operation; the script information further includes at least one of: script name, request mode, interface request parameter, request address, interface service, interface method and assertion; the interface request parameters comprise a custom function, test data required by the interface performance test are generated through the custom function, data required by a real scene request are simulated, and parameter differences of the same interface related to different scene requests are reflected; for example: in the script of gPC interface performance test, different live broadcast task names can be set through a customized @ random function, such as: "job _ batch _ name": "X platform live broadcast @ random"; and adding scripts for performance test of other gPC interfaces into the scene template for performance test of the gPC interfaces for multiple times, and combining the scripts for performance test of the gPC interfaces according to the sequence of the running steps of the scripts to generate a scene for performance test of the gPC interfaces, wherein the scene is a gPC interface performance test scene required by actual service.
In steps 14-15, in combination with the actual service, selecting at least one scenario of performance test of the combined gRPC interface, setting a scenario operation mode, operating the at least one scenario of performance test of the gRPC interface according to configured scenario operation mode information, and executing a scenario of performance test of the gRPC interface in the scenario of performance test of the gRPC interface to perform performance test of the gRPC interface; the method comprises the steps that scene operation mode information is configured for at least one selected scene of the gPC interface performance test by clicking a multi-scene concurrent button of a page; according to the analysis of the user behavior in the real scene, filling the configuration information of the scene operation mode information of the gPC interface performance test; the scene operation mode information includes at least one of: pressure measurement requirements, scene modes, services, running modes and target thread numbers; the scene mode includes: a cyclic scenario and a progressive scenario; when a loop scenario is selected, the run time can also be set; when the progressive scene is selected, at least one of the following may also be set: preparation time, step number and stable running time; the pressure test requirement, namely the requirement name of the performance test of the gPC interface at this time, can be filled in by a user; the scene mode includes: a circulating scene and a progressive scene can be selected according to requirements; the service selects 'server 1' and 'server 2' for the execution engine, flexibly supports a plurality of persons to use a performance test platform at the same time, for example, one person uses the 'server 1' performance test engine to execute a performance test script, and the other person can also use the 'server 2' performance test engine to execute the performance test script; the operation mode comprises the following steps: a circulation mode and an operation time mode, wherein a proper operation mode can be selected according to requirements; the target thread number is the number of users which can be simulated by setting the field, and if the target thread number is set to be 100, the user can be simulated by 100 and simultaneously carries out related gPC interface use; when a loop scenario is selected, run time may also be set; the running time is set as the script running time of the interface in the performance test scene; when the progressive scene is selected, at least one of the following may also be set: preparation time, step number and stable running time; the preparation time indicates the performance test magnitude of the set target thread number within the time; the step number represents that the pressure of the performance test is gradually increased in several steps to reach the performance test magnitude of the set target thread number, so that more and more scenes with more and more people and more service pressure are simulated; the stable running time represents how long the operation continues after reaching the set performance test magnitude of the target thread number.
In step 16, a gRPC interface performance test script added in a gRPC interface performance test scenario is executed by running the gRPC interface performance test scenario, so as to obtain a result of the gRPC interface performance test; and generating a gPC interface performance test report according to the result of the gPC interface performance test, and analyzing the gPC interface performance test report.
In the embodiment of the invention, a method for testing the performance of a gPC interface which is platform-based, shareable and easy to operate and supports rich service scenes is provided; after the request method for initiating the gPC is packaged, the request method is called by a back-end performance pressure test engine, and the performance test of a gPC interface is realized by thread concurrence; in the aspect of usability, other tool software and the environment depending on the tool software are not required to be installed, and all parameters required by the performance test script can be directly and visually configured in a test platform, namely a server through a page, so that testers can conveniently and efficiently write the required performance test script and share the performance test script on the test platform; in the aspect of service requirements, rich service scenes can be met, and different gRPC interfaces can be combined to form various performance test scenes; in the aspect of authenticity, request parameters of a gPC interface can be parameterized, parameterized test data is generated through a customized specific function, data of a real scene request is simulated, and differences of parameters of different scene requests of the same interface are reflected; the performance test scene of the gPC interface can be operated by setting different operation scene modes according to the analysis of the user behavior in the real scene, such as a progressive scene, the user request number is simulated to be increased step by step, and the difference of the user magnitude is reflected in different time stages so as to be close to the use scene of the real user to the maximum extent.
Referring to fig. 4, in the embodiment of the present invention, a scenario template for gRPC interface performance test is first created, that is, a scenario template for gRPC interface performance test is created by adding on a performance scenario test page of a test platform, that is, a server, for adding a script for gRPC interface performance test to the scenario template in the following; as shown in fig. 2, a scene name associated with the performance test requirement of the gRPC interface is filled in a customized manner at a "scene name" of a window to which a scene template is added, so as to identify which aspect of the performance test of the service the gRPC interface performance test scene template is used for, for example: "task library live mode scenario"; at the 'item' position of the window, an item to which the actual service corresponding to the performance test of the gPC interface belongs is selected, for example: "settle accounts"; the method comprises the following steps that a scene template for performance test of at least one gPC interface can be created on a test platform;
then, adding a script for the performance test of the gPC interface into the scene template for the performance test of the gPC interface, namely selecting the created scene template, and adding the corresponding script for the performance test of the gPC interface by clicking a new script button of a corresponding operation column of the page; configuring script information of at least one script for the performance test of the gPC interface in the scene template according to the gPC interface related to an actual service scene;
then, a self-defined function is set in a script for a gPC interface performance test to support request data parameterization, namely the script information comprises a script running step sequence; the script information further includes at least one of: script name, request mode, interface request parameter, request address, interface service, interface method and assertion; the interface request parameters comprise a custom function, test data required by the interface performance test are generated through the custom function, data required by a real scene request are simulated, and parameter differences of the same interface related to different scene requests are reflected; for example: in the script of gPC interface performance test, different live broadcast task names can be set through a customized @ random function, such as: "job _ batch _ name": "X platform live broadcast @ random";
combining the scripts of the gPC interface performance test according to the step sequence by combining the actual service to form a gPC interface performance test scene, namely combining the scripts of the gPC interface performance test according to the step sequence of the script operation to generate the gPC interface performance test scene, wherein the scene is the gPC interface performance test scene required by the actual service;
then, in combination with the actual service, one or more scenarios of performance test of the gPC interface created by the above steps can be selected for combination, that is, in combination with the actual service, at least one scenario of performance test of the combined gPC interface is selected, and a scenario operation mode is set;
then, in combination with actual services, running a selected gRPC interface performance test scenario, and selecting a "time mode" or a "progressive mode" to run, that is, running the at least one gRPC interface performance test scenario according to configured scenario running mode information, and executing a gRPC interface performance test scenario in the gRPC interface performance test scenario to perform a gRPC interface performance test;
finally, after the operation is finished, a gPC interface performance test report is generated for reference of subsequent performance analysis, namely a gPC interface performance test script added in a gPC interface performance test scene is executed through the scene of the gPC interface performance test operation, and a result of the gPC interface performance test is obtained; and generating a gPC interface performance test report according to the result of the gPC interface performance test, and analyzing the gPC interface performance test report.
Referring to fig. 5, in the embodiment of the present invention, when a scene to be tested by a user pays to an anchor for an X live broadcast platform, a direct broadcast task (gRPC interface) is issued to the X live broadcast platform according to a gRPC interface combination, a task assigned to the X live broadcast platform (gRPC interface), a task taken by an a anchor (gRPC interface), a task completed by an a anchor and a submission credential (gRPC interface), a task accepted by the X live broadcast platform (gRPC interface), and a task paid by the X live broadcast platform (gRPC interface), and finally, an acceptance is completed and a labor reward is paid to the a anchor; and combining the corresponding gRPC interfaces to form a real user scene according to the actual service flow, compiling a script for testing the performance of the corresponding gRPC interfaces, combining the script, adding the script into a pre-established performance test scene template of a task library live broadcast mode, and operating to complete the gRPC interface performance test of the X live broadcast platform like anchor broadcast payment.
In the embodiment of the invention, when the scene to be tested by the user is a mixed scene of multi-enterprise and multi-user from task assignment to payment completion; scene combination through the time mode is to create six corresponding gRPC performance test scene templates, for example: a. 100 enterprises are operated to carry out the release task for 10 minutes; b. 150 enterprises are performing task assignment operation for 20 minutes; c. 500 users are carrying out the operation of picking up the task, which lasts for 30 minutes; d. 750 users are performing the operation of completing the task, which lasts for 25 minutes; e. 100 enterprises are operated to perform the acceptance task for 15 minutes; f. 200 enterprises are operating for payment tasks, which lasts for 20 minutes; respectively adding a corresponding gPC interface performance test script into one gPC performance test scene template, then combining the six corresponding gPC performance test scenes, and then operating;
in the embodiment of the invention, when the scene to be tested by the user is a lottery activity platform, for example: there are 5 merchants: the commercial tenant A, the commercial tenant B, the commercial tenant C, the commercial tenant D and the commercial tenant E jointly carry out festival lottery activities to bring up bonus for users, as the number of participating users is gradually increased, the requests for settlement and money making are gradually increased, the pressure on background services is gradually increased, and the calling of a background service gPC interface is also gradually increased, in this scene, how to see the performance condition of the service related to settlement, support the performance test platform, the lottery activity lasts for 2 hours, and at the moment, how to see the performance condition of the background service gPC request of the lottery activity platform; the following gRPC-related performance test scenarios were configured: i. in the merchant A, 100 online lottery draw at the same time point is expected, and in 5 minutes, in 5 stages, 100 online lottery draw at the same time point is gradually achieved, ii, in the merchant B, 120 online lottery draw at the same time point is expected, in 5 minutes, in 5 stages, 120 online lottery draw at the same time point is gradually achieved; in the commercial tenant C, the online 140 people draw lottery at the same time point at the same time, and within 5 minutes, the lottery is drawn by 140 people at the same time point in 5 stages; in the merchant D, expecting that 160 persons draw lottery at the same time point on line, and gradually reaching 160 persons draw lottery at the same time point in 5 stages within 5 minutes; v, in a merchant E, expecting 180 people to draw lottery at the same time point on line, and gradually reaching 180 people to draw lottery at the same time point in 5 stages within 5 minutes; according to the scene combination of the progressive mode, five corresponding gPC performance test scene templates are created, a related gPC interface performance test script is added into each gPC performance test scene template to form a required gPC performance test scene, and then the five gPC performance test scenes formed by combining the gPC performance test scenes according to the interface scripts are selected to operate in a progressive scene.
In the embodiment of the invention, a request method of gRPC is initiated at the back end package; calling the packaged gPRC request method by a back-end performance pressure measurement engine; configuring a gPC performance test scene template on a test platform page, namely a server; on a test platform page, necessary information such as script names, request modes, interface request parameters, request addresses, interface services, interface methods, assertions and the like required by scripts of gPC interface performance are configured to a gPC performance test scene template, functions of the user-defined request parameters are supported, and gPC interface performance scripts are combined according to actual services to form a gPC performance test scene fitting the actual services; selecting one or more gRPC performance test scenes on a test platform page to combine, and operating by combining actual services; configuring information required by the operation of a gPC performance test scene, such as 'pressure test requirement', 'scene mode', 'service', 'operation mode', 'target thread number', 'operation time', 'preparation time', 'step number' and 'stable operation time', on a test platform page; and a performance pressure test engine at the rear end operates a gPC performance test scene according to the information configured on the test platform page, simulates the number of users calling the gPC request at the same time by using concurrent threads, and performs gPC interface performance test on the specified service.
In the invention, by filling parameters of the script for the performance test of the gPC interface in the test platform, testers can conveniently and efficiently write the needed script for the performance test of the gPC interface and share the script on the test platform; combining scripts for testing the performance of different gRPC interfaces to form various gRPC interface performance test scenes; the behavior of the user in a real scene is analyzed, and the performance test scene of the gPC interface is operated by setting different scene modes, so that the behavior of the user is simulated to the maximum extent, and the user experience is improved.
Referring to fig. 6, an embodiment of the present invention provides an apparatus for testing performance of a gRPC interface, including:
a creating module 61, configured to create at least one scene template for gRPC interface performance testing;
a first configuration module 62, configured to configure script information of a script of at least one gRPC interface performance test in the scene template; the script information comprises a step sequence of script operation;
a generating module 63, configured to combine the scripts of the gRPC interface performance test according to the sequence of steps in which the scripts run, and generate a scenario of the gRPC interface performance test;
a second configuration module 64, configured to configure scene operation mode information for a selected scene of at least one gRPC interface performance test;
an execution module 65, configured to run the scenario of the performance test of the at least one gRPC interface according to the configured scenario running mode information, and execute a scenario of the performance test of the gRPC interface in the scenario of the performance test of the gRPC interface to perform a performance test of the gRPC interface;
and the result generation module 66 is used for obtaining a result of the performance test of the gPC interface.
In the embodiment of the present invention, optionally, the method further includes:
and the analysis module is used for generating a gPC interface performance test report according to the result of the gPC interface performance test and analyzing the gPC interface performance test report.
In this embodiment of the present invention, optionally, the script information further includes at least one of the following: script name, request mode, interface request parameters, request address, interface service, interface method, and assertion.
In the embodiment of the present invention, optionally, the interface request parameter includes a custom function, and test data required by the interface performance test is generated by the custom function.
In this embodiment of the present invention, optionally, the scene operation mode information includes at least one of the following: pressure measurement requirements, scene modes, services, running modes and target thread counts.
In this embodiment of the present invention, optionally, the scene mode includes: a cyclic scenario and a progressive scenario; when a loop scenario is selected, the run time can also be set; when the progressive scene is selected, at least one of the following may also be set: preparation time, number of steps and stable running time.
The device for testing the performance of the gPC interface provided by the embodiment of the invention can realize each process realized by the method for testing the performance of the gPC interface in the method embodiment of fig. 1, and is not repeated here for avoiding repetition.
Referring to fig. 7, an embodiment of the present invention further provides a server 70, which includes a processor 71, a memory 72, and a computer program stored in the memory 72 and running on the processor 71, where the computer program, when executed by the processor 71, implements the processes of the method embodiment for testing the performance of the gRPC interface, and can achieve the same technical effects, and details are not repeated here to avoid repetition.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program realizes each process of the method embodiment for testing the performance of the gPC interface, can achieve the same technical effect, and is not repeated here to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a terminal) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for testing performance of a gPC interface is characterized by comprising the following steps:
creating at least one scene template for performance test of a gPC interface;
configuring script information of at least one script for the gPC interface performance test in the scene template; the script information comprises a script running step sequence;
combining the scripts for the performance test of the gPC interface according to the sequence of the steps of running the scripts to generate a scene for the performance test of the gPC interface;
configuring scene operation mode information for at least one selected scene of the gPC interface performance test;
running the scene of the performance test of the at least one gPC interface according to the configured scene running mode information, and executing a script of the performance test of the gPC interface in the scene of the performance test of the gPC interface to perform the performance test of the gPC interface;
and obtaining a result of the performance test of the gRPC interface.
2. The method for performance testing of a gRPC interface of claim 1, further comprising:
and generating a gPC interface performance test report according to the result of the gPC interface performance test, and analyzing the gPC interface performance test report.
3. The method for performance testing of a gPC interface of claim 1, wherein the gPC interface is further configured to perform the performance testing,
the script information further includes at least one of: script name, request mode, interface request parameters, request address, interface service, interface method, and assertion.
4. The method for performance testing of a gPC interface of claim 3, wherein the gPC interface is further configured to perform the performance testing,
the interface request parameter comprises a custom function, and test data required by the interface performance test is generated through the custom function.
5. The method for performance testing of a gPC interface of claim 1, wherein the gPC interface is further configured to perform the performance testing,
the scene operation mode information includes at least one of: pressure measurement requirements, scene modes, services, running modes and target thread counts.
6. The method for performance testing of a gPC interface of claim 5, wherein the gPC interface is further configured to perform the performance testing,
the scene mode includes: a cyclic scenario and a progressive scenario; when a loop scenario is selected, the run time can also be set; when the progressive scene is selected, at least one of the following may also be set: preparation time, number of steps and stable running time.
7. An apparatus for performance testing of a gRPC interface, comprising:
the system comprises a creating module, a judging module and a judging module, wherein the creating module is used for creating at least one scene template for performance test of a gPC interface;
a first configuration module, configured to configure script information of a script of at least one gRPC interface performance test in the scene template; the script information comprises a step sequence of script operation;
the generation module is used for combining the scripts for the performance test of the gPC interface according to the sequence of the steps of the script operation to generate a scene of the performance test of the gPC interface;
the second configuration module is used for configuring scene operation mode information for the selected scene of the performance test of the at least one gPC interface;
the execution module is used for operating the scene of the performance test of the at least one gPC interface according to the configured scene operation mode information, and executing a script of the performance test of the gPC interface in the scene of the performance test of the gPC interface to carry out the performance test of the gPC interface;
and the result generation module is used for obtaining the result of the performance test of the gPC interface.
8. The apparatus for performance testing of a gRPC interface of claim 7, further comprising:
and the analysis module is used for generating a gPC interface performance test report according to the result of the gPC interface performance test and analyzing the gPC interface performance test report.
9. A server, comprising: a processor, a memory, and a program stored on and running on the memory that, when executed by the processor, performs the steps of the method of gRPC interface performance testing of any one of claims 1-5.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method of performance testing a gPC interface of any one of claims 1 to 5.
CN202210603098.4A 2022-05-31 2022-05-31 gPC interface performance test method and device Active CN114691529B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210603098.4A CN114691529B (en) 2022-05-31 2022-05-31 gPC interface performance test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210603098.4A CN114691529B (en) 2022-05-31 2022-05-31 gPC interface performance test method and device

Publications (2)

Publication Number Publication Date
CN114691529A CN114691529A (en) 2022-07-01
CN114691529B true CN114691529B (en) 2022-08-02

Family

ID=82130997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210603098.4A Active CN114691529B (en) 2022-05-31 2022-05-31 gPC interface performance test method and device

Country Status (1)

Country Link
CN (1) CN114691529B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114177A (en) * 2022-08-31 2022-09-27 云账户技术(天津)有限公司 Method and device for generating gPC scene template

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656791A (en) * 2018-11-01 2019-04-19 北京奇安信科技有限公司 A kind of gRPC performance test methods and device based on Jmeter
CN110489325A (en) * 2019-07-09 2019-11-22 微民保险代理有限公司 Vehicle insurance data test method, apparatus, test platform and vehicle insurance test macro
CN111752820A (en) * 2019-03-29 2020-10-09 上海哔哩哔哩科技有限公司 Pressure testing method of gPC interface, computer equipment and storage medium
CN111897738A (en) * 2020-08-21 2020-11-06 中国工商银行股份有限公司 Automatic testing method and device based on atomic service
CN113032287A (en) * 2021-05-25 2021-06-25 常州微亿智造科技有限公司 Multi-component performance testing method and system supporting distribution
CN114064450A (en) * 2020-08-10 2022-02-18 腾讯科技(深圳)有限公司 Application program testing method and device, electronic equipment and storage medium
CN114138674A (en) * 2021-12-20 2022-03-04 南京星云数字技术有限公司 Automatic testing method and device and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11425147B2 (en) * 2019-03-01 2022-08-23 Oracle International Corporation In-service data plane encryption verification

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656791A (en) * 2018-11-01 2019-04-19 北京奇安信科技有限公司 A kind of gRPC performance test methods and device based on Jmeter
CN111752820A (en) * 2019-03-29 2020-10-09 上海哔哩哔哩科技有限公司 Pressure testing method of gPC interface, computer equipment and storage medium
CN110489325A (en) * 2019-07-09 2019-11-22 微民保险代理有限公司 Vehicle insurance data test method, apparatus, test platform and vehicle insurance test macro
CN114064450A (en) * 2020-08-10 2022-02-18 腾讯科技(深圳)有限公司 Application program testing method and device, electronic equipment and storage medium
CN111897738A (en) * 2020-08-21 2020-11-06 中国工商银行股份有限公司 Automatic testing method and device based on atomic service
CN113032287A (en) * 2021-05-25 2021-06-25 常州微亿智造科技有限公司 Multi-component performance testing method and system supporting distribution
CN114138674A (en) * 2021-12-20 2022-03-04 南京星云数字技术有限公司 Automatic testing method and device and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
针对Vala语言的gRPC相关工具设计及实现;杨琪智;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20220115;全文 *

Also Published As

Publication number Publication date
CN114691529A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
US6772107B1 (en) System and method for simulating activity on a computer network
EP0784276A1 (en) Load test system and method
CN107102947B (en) ATM transaction flow testing device and method
CN111475417A (en) Automatic testing method, device, equipment and storage medium
CN114691529B (en) gPC interface performance test method and device
CN112988572A (en) Multi-environment multi-channel multi-version simulation test method and device
CN110297637A (en) The applicable resource file thermogravimetric of full platform client software carries tool and method of development
CN115757014A (en) Power consumption testing method and device
US20210097787A1 (en) Information presentation method and apparatus
US11954013B2 (en) Method of testing applet performance, electronic device, and computer-readable medium
US20050203717A1 (en) Automated testing system, method and program product using testing map
CN113448988A (en) Method and device for training algorithm model, electronic equipment and storage medium
CN117520190A (en) Cloud desktop client and test execution method thereof
CN113760397A (en) Interface call processing method, device, equipment and storage medium
CN110825370B (en) Mobile terminal application development method, device and system
CN112199273A (en) Virtual machine pressure/performance testing method and system
CN106528413A (en) Method and device for testing application program
CN115328997A (en) Data synchronization method, system, device and storage medium
CN114116353A (en) Equipment testing method, device, equipment and storage medium
CN113868031A (en) Method, device and system for testing performance consistency of hard disk
CN109117176B (en) Version automatic deployment method and system based on host
CN108536607B (en) UI test method, device and readable storage medium
JP2000132425A (en) Software testing method
CN113760253A (en) Front-end rendering method, apparatus, device, medium, and program product
CN111488283B (en) Task generation method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant