The content of the invention
Based on this, it is necessary to for above-mentioned technical problem, there is provided it is a kind of can be to multiple interfaces in a business scenario
Performance test methods, device, computer equipment and the storage medium of the application program of performance test are carried out simultaneously.
A kind of performance test methods of application program, including:
The performance test request of the business scenario sent by host node receiving terminal, carried in the performance test request
Configuration information corresponding to business scenario;
Host node test case and utilization configuration information generation according to corresponding to obtaining the configuration information is corresponding
Test code;
By host node by it is described test code and test case be distributed to it is multiple from node;It is described from node tune to cause
Multiple interface execution performances of the business scenario are tested according to test code and test case with multiple threads;
Multiple test datas returned from node are received by host node, utilize the Test data generation test report.
In one of the embodiments, methods described also includes:
When error rate of the individual interface in performance test reaches first threshold, individual interface is exited from the thread of node
Corresponding performance test;Using from test data corresponding to nodes records;Or
Host node corresponds to thread step number and step frequency according to individual interface, records and individual interface execution performance is surveyed
The number of threads of examination;It is multiple to be exited from the thread of node when number of threads corresponding to the individual interface reaches Second Threshold
The performance test of the individual interface, using from test data corresponding to nodes records.
In one of the embodiments, the business scenario includes mixed service scene and single business scenario;Methods described
Also include:
When business scenario is mixed service scene, the mixed service scene is split as by the host node multiple
Single business scenario;
Test case corresponding to multiple single business scenarios and test code are obtained by host node;
By host node by test case corresponding to multiple single business scenarios and test code distribution to multiple from node, with
So that described test multiple single business scenario execution performances from node.
In one of the embodiments, it is described by host node by test case and test corresponding to multiple single business scenarios
Code distribution is to multiple from node, to cause described the step of being tested from node multiple single business scenario execution performances to include:
Obtained by host node each from the vacant number of threads of node;
Host node by the test case of multiple single business scenarios and tests code distribution extremely according to the vacant number of threads
Accordingly from node, each to test multiple single business scenario execution performances from node.
In one of the embodiments, the host node according to the vacant number of threads by the survey of multiple single business scenarios
Example on probation and test code distribution to accordingly from node the step of, including:
Obtain each weight coefficient corresponding to the vacant number of threads from node;
If being more than the quantity for splitting obtained multiple single business scenarios from number of nodes, the host node is according to single business field
Interface quantity corresponding to scape and the weight coefficient are that the selection of single business scenario is one or more from node;
By test case corresponding to single business scenario and test code distribution to accordingly from node.
In one of the embodiments, methods described also includes:
It is newly-increased that newly-increased node identification is sent from node to the host node;
The host node sends initialization command according to described increase newly from node identification to described increase newly from node;
It is described newly-increased from the node execution initialization command, it is described newly-increased from the main section of node reception after the completion of initialization
The test case and test code of point distribution, perform performance test corresponding with business scenario.
A kind of performance testing device of application program, including:
Host node, the performance test request of the business scenario sent for receiving terminal, taken in the performance test request
With configuration information corresponding to business scenario;According to test case corresponding to configuration information acquisition and utilize the configuration
Test code corresponding to information generation;The test code and test case are distributed to multiple from node;
From node, for running multiple threads, utilized by thread and test code and test case to the business scenario
Multiple interface execution performances test;
The host node is additionally operable to receive multiple test datas returned from node, is tested using the Test data generation
Report.
In one of the embodiments, the business scenario includes mixed service scene and single business scenario;When business field
When scape is mixed service scene, the host node is additionally operable to the mixed service scene being split as multiple single business scenarios;Obtain
Take test case corresponding to multiple single business scenarios and test code;By test case and test corresponding to multiple single business scenarios
Code distribution is to multiple from node;It is described to be additionally operable to call multiple threads to survey multiple single business scenario execution performances from node
Examination.
A kind of computer equipment, including memory and processor, computer program, the finger are stored in the memory
When order is by the computing device so that the step of the computing device any of the above-described method.
A kind of computer-readable recording medium, is stored thereon with computer program, and the computer program is held by processor
The step of any one method as described above is realized during row.
Performance test methods, device, computer equipment and the storage medium of above-mentioned application program, when needing to application program
Business scenario carry out performance test when, configuration information corresponding to business scenario can be sent to server cluster by terminal
In host node.Host node obtains corresponding test case and the corresponding test code of generation according to configuration information.Host node
Test case and test code are distributed to parallel multiple from node.Each from node call multiple threads using test code and
Test case is tested multiple interface execution performances of business scenario.As a result of server cluster mode to application program
Service end performance test is carried out, so that the performance test of multiple interfaces in business scenario can be by difference from section
Multiple threads of point are tested simultaneously.After the performance test of business scenario terminates, from corresponding to each thread of nodes records
Test data, and test data is back to host node.Host node to multiple test datas returned from node by uniting
Meter, and then generate corresponding test report.Due to multiple threads of the test data from multiple nodes, thus, it is possible to more comprehensive
With the actual state of accurate reflection business scenario performance test, so as to effectively improve the accuracy of test.
Embodiment
In order that the object, technical solution and advantage of the application are more clearly understood, it is right below in conjunction with drawings and Examples
The application is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the application, not
For limiting the application.
The performance test methods for the application program that the application provides can apply in application scenarios as shown in Figure 1.Eventually
End 102 is communicatively coupled by network and server cluster 104.Server cluster 104 include a host node and it is multiple from
Node.Host node can be communicated with terminal 102.Tester accesses host node by terminal 102, and host node is to terminal
102 return to the corresponding business scenario administration page of application program capacity test.In the page, tester can be to difference
The testing requirement of business scenario is configured.When configuration information corresponding to host node gets business scenario, according to confidence
Cease test case corresponding to obtaining and test code using corresponding to configuration information generation.Host node can be by business scenario pair
The test case and test code distribution answered call multiple threads using test case and test generation to multiple from node from node
Code carries out performance test to multiple interfaces of business scenario.When thread exits test, from nodes records test data, and will survey
Examination data are back to host node.Host node counts to multiple test datas returned from node, generates corresponding performance and surveys
Examination report.
In one embodiment, as shown in Figure 2, there is provided a kind of performance test methods of application program, in this way should
For being illustrated exemplified by server cluster, this method comprises the following steps:
Step 202, the performance test request of the business scenario sent by host node receiving terminal, in performance test request
Carry configuration information corresponding to business scenario.
Step 204, host node test case and utilization configuration information generation according to corresponding to obtaining configuration information is corresponding
Test code.
Server cluster includes multiple nodes, wherein, node includes a host node and multiple from node.Host node and
The testing tool that performance test is carried out to application program has been respectively mounted from node.Host node can be controlled to multiple from node
System.Host node can be communicated with terminal.Specifically, tester is returned by terminal access host node, host node to terminal
Return the corresponding business scenario administration page of application program capacity test.In the page, tester can be selected by terminal
Select different business scenarios and the testing requirement to different business scene configures.
Business scenario includes:Single business scenario, mixed service scene and stability business scenario etc..Single business scenario needs
One or more interfaces are wanted to support., can be with configuration service scene title, Mei Gejie in administration page corresponding to single business scenario
Test case and test exit criteria etc. corresponding to the interface name and interface of mouth.Mixed service scene can include multiple lists
Business scenario.In the administration page of mixed service scene, the testing requirement of each single business scenario can be configured.In stability
The configuration of testing requirement can be carried out in business scenario according to mixed service scene.
By taking single business scenario as an example, in business scenario administration page, tester can utilize terminal incoming traffic field
Scape title and corresponding interface name.It is corresponding that tester can also utilize terminal to be selected in the page according to interface name
Test case.For example, interface name is queries asset interface, the entitled inquiry effort scale of test case.Tester may be used also
To configure interface testing exit criteria in the page by terminal, for example, the response time is 100 milliseconds, error rate 0.1%
Deng.
Terminal sends configuration information corresponding to business scenario to host node.Configuration information include business scenario title,
Interface name, test case title corresponding with interface name and test exit criteria corresponding with interface name etc..
When configuration information corresponding to host node receives single business scenario, the test case title in configuration information
Test case corresponding to selection, the interface name in configuration information obtain the assembled rule that code is tested corresponding to individual interface
Then, the assembly rule of code is tested corresponding to the business scenario name acquiring list business scenario and in configuration information.It is main
Node obtains corresponding program module using the assembly rule of test code corresponding to individual interface in code library is tested, according to
The rule carries out assembled, test code corresponding to generation individual interface to program module.Host node is corresponding using single business scenario
The assembly rule of test code carry out assembled to testing code corresponding to multiple interfaces, generate and tested corresponding to single business scenario
Code.Further, single business scenario can also only have an interface, then test code can be considered single corresponding to individual interface
Test code corresponding to business scenario.
It is assembled in the manner described above to generate multiple lists when configuration information corresponding to host node receives mixed service scene
Test code corresponding to business scenario.Host node obtains the assembled rule of code corresponding to mixed service scene, is advised using the assembly
Code will be then tested corresponding to multiple single business scenarios and carries out assembled, test code corresponding to generation mixed service scene.
, can be according to the side of mixed service scene when configuration information corresponding to host node receives stability business scenario
Test code corresponding to formula generation.
Step 206, by host node will test code and test case be distributed to it is multiple from node;To adjust from node
Multiple interface execution performances of business scenario are tested according to test code and test case with multiple threads.
Step 208, multiple test datas returned from node are received by host node, is tested and reported using Test data generation
Accuse.
Can be distributed type assemblies in server cluster.When configuration information corresponding to host node gets business scenario,
Corresponding test assignment can be generated.Test assignment includes carrying out performance test to multiple interfaces in business scenario.Each
The performance test of interface needs multiple threads to perform.Corresponding multiple interfaces are referred to as to be measured connect in test assignment
Mouthful.
Test assignment can be distributed to multiple from the corresponding performance test of node progress by host node.Specifically, from node
Multiple threads are called, host node can be distributed to code etc. is tested corresponding to test assignment and test case, business scenario
It is multiple from node, each call multiple threads from node.With this so that each utilizing test case from each thread in node
With business scenario corresponding to test code and perform test assignment, carry out the performance test of business scenario.
When the business scenario in test assignment is single business scenario, host node can be by test corresponding to single business scenario
Use-case and test code distribution are to multiple from node.Each call multiple threads accordingly from node, each thread utilizes test
Use-case and test code are tested multiple interface execution performances of single business scenario.Wherein, thread is to more in single business scenario
Individual interface can carry out serial operation according to service logic when performing test to multiple interfaces.When the interface in test reaches configuration
Test exit criteria when, thread exits the performance test of the interface, and the performance that next interface is performed according to service logic is surveyed
Examination.For example, single business scenario includes 3 interfaces, interface 1, interface 2 and interface 3, patrolled according to the business in the business scenario
Volume, thread docking port 1 first performs test, secondly docking port 2 performs survey and docking port 3 performs test again.By serial
The mode of operation performs test to multiple interfaces in single business scenario, and the accuracy of test data is able to ensure that with this.Each
Thread records corresponding test data, by being back to host node from node by test data.Host node receives multiple from node
The test data of return, is counted to test data, and property of the application program under the business scenario is generated using statistical result
Can test report.
Further, if single business scenario only includes an interface, each thread is according to test case and test generation
Code carries out performance test to the interface, when reaching the test exit criteria of configuration, exits test.Multiple thread records are corresponding
Test data, by being back to host node from node by test data.Host node receives multiple test datas returned from node,
Test data is counted, generating performance test of the application program under the business scenario using statistical result reports.
When the business scenario in test assignment is mixed service scene, host node will be tested corresponding to mixed service scene
Use-case and test code distribution are to multiple from node.Each multiple threads are called from node.Host node can be by mixed service field
Scape is split as multiple single business scenarios, and multiple single business scenarios are distributed into multiple multiple threads from node.Wherein, host node
One single business scenario can be distributed to one from node, can be according to the test of single business scenario from multiple threads of node
Mode performs corresponding performance test, so as to pass through multiple coordinating to complete the performance test of mixed service scene from node.
Host node each single business scenario can also be distributed to it is all from node, each can be to multiple single business fields from node
Scape execution performance is tested.So that the performance test of mixed service scene is each can carry out from node.Performing mixing
It is multiple to carry out concurrent testing to each single business scenario from node during the performance test of business scenario, to each single business
Multiple interfaces of scene are serially tested according to service logic.
When the business scenario in test assignment is stability business scenario, configuration information corresponding to stability business scenario
In in addition to number of threads is less than the number of threads needed for mixed service scene performance test, other configurations information can with it is mixed
It is identical to close configuration information corresponding to business scenario., can be by when the business scenario in test assignment is stability business scenario
The performance test of stability business scenario is performed according to the performance test mode of mixed service scene.
Step 208, multiple test datas returned from node are received by host node, is tested and reported using Test data generation
Accuse.
At the end of test assignment, thread exits corresponding performance test, and number is tested from corresponding to the nodes records threads
According to.Test data corresponding to multiple threads can be sent from node to host node.Test data includes thread concurrency, handled up
Amount, error rate and server performance.Wherein, thread concurrency refers to the quantity of the thread performed in the same time.Handling capacity
Refer to the response times of an interface in one second.Error rate refers to the error rate of desired interface return value in one second.For example, line
Journey concurrency is 100, and desired interface return value is 0, wherein it is 1 to have 3 interface return values, then error rate is 3%.Server
Performance refers to that the performance indications from node, including CPU usage and internal memory use byte number etc..
Host node receives multiple test datas returned from node, and test data is counted, obtains business scenario
The statistical result that can be tested.Host node utilizes the corresponding test report of statistical result generation business scenario test.
Further, after the performance test of all business scenarios is completed, host node can count to obtain all surveys
Try data.Host node can utilize the test report of all Test data generation application program service end performance tests.
, can be by terminal by industry when needing to carry out performance test to the business scenario of application program in the present embodiment
Configuration information corresponding to business scene sends the host node into server cluster.Host node obtains corresponding survey according to configuration information
Example on probation and the corresponding test code of generation.Test case and test code are distributed to multiple from node by host node parallel.
Each multiple threads are called to be tested using code and test case is tested multiple interface execution performances of business scenario from node.
Service end performance test is carried out to application program as a result of the mode of server cluster, so that in business scenario
The performance tests of multiple interfaces can be tested simultaneously from multiple threads of node by difference.When the performance of business scenario
After test terminates, from test data corresponding to each thread of nodes records, and test data is back to host node.Host node leads to
Cross and multiple test datas returned from node are counted, and then generate corresponding test report.Because test data comes from
Multiple threads of multiple nodes, thus, it is possible to the actual state of more comprehensive and accurate reflection business scenario performance test, from
And the accuracy of test can be effectively improved.
In one embodiment, this method also includes:When error rate of the individual interface in performance test reaches the first threshold
During value, performance test corresponding to individual interface is exited from the thread of node;Using from test data corresponding to nodes records;Or
Host node corresponds to thread step number and step frequency according to individual interface, records the thread to the test of individual interface execution performance
Quantity;When number of threads reaches Second Threshold corresponding to individual interface, multiple property that individual interface is exited from the thread of node
Can test, using from test data corresponding to nodes records.
In the present embodiment, terminal can exit bar to exit the test of performance test in configuration service scene to each interface
Part.Exit criteria can include one or more.When the thread from node is in the interface execution performance test to business scenario,
If reaching test exit criteria, thread exits the performance test to the interface.
When can be tested from the thread of node the individual interface execution performance of business scenario, the mistake of the interface can be recorded
Rate by mistake, when error rate reaches the first threshold in configuration information, expression reaches test exit criteria, and thread is exited to the interface
Performance test.
When being tested from node calling thread the individual interface execution performance of business scenario, host node can also record execution
The number of threads of the individual interface performance test.Specifically, configuration information includes initial line number of passes corresponding with individual interface
Amount, step number and step frequency.Host node can be tested according to corresponding to step number and step frequency by business scenario appoints
Business is distributed to multiple threads from node.Reach the Second Threshold in configuration information when the quantity for performing individual interface test
When, that is, when reaching the number of threads upper limit, expression reaches test exit criteria.Host node exits the individual interface to from node transmission
The instruction of test, multiple threads are caused to exit the performance test to the individual interface from node according to the instruction.
When configuration information includes multiple test exit criterias, multiple test exit criterias can be effective.Single
In the performance test of interface, the test condition reached first is the exit criteria of the interface performance test.That is, reach first
Which tests exit criteria to, then which test exit criteria performed., can be to individual interface by configuration testing exit criteria
Test control effectively, and is advantageous to improve the accuracy of business scenario performance test.
In one embodiment, this method also includes:, will be mixed by host node when business scenario is mixed service scene
Close business scenario and be split as multiple single business scenarios;Test case and survey corresponding to multiple single business scenarios are obtained by host node
Try code;By host node by test case corresponding to multiple single business scenarios and test code distribution to multiple from node, with
So that multiple single business scenario execution performances are tested from node.
In the present embodiment, a mixed service scene can include multiple single business scenarios.Host node can will mix industry
Business scene is split as multiple single business scenarios, and multiple single business scenarios are distributed into multiple multiple threads from node.
Because the vacant number of threads in server cluster each from node is different.In order to ensure host node will can mix
Business scenario split after multiple single business scenarios be smoothly assigned to it is multiple performance test is carried out from node, host node can be read
Take each vacant number of threads from node, the performance of multiple single business scenarios is distributed according to from the vacant number of threads of node
Test.
In one of the embodiments, code by test case corresponding to multiple single business scenarios and is tested by host node
Be distributed to it is multiple from node, to include the step of causing and multiple single business scenario execution performances are tested from node:Pass through main section
Point is obtained each from the vacant number of threads of node;Host node uses the test of multiple single business scenarios according to vacant number of threads
Example and test code distribution are to accordingly from node, each to test multiple single business scenario execution performances from node.
Vacant number of threads can be preconfigured corresponding weight coefficient.Different vacant number of threads can be configured
Different weight coefficients.For example, vacant number of threads is 70~80, the weight coefficient being configured is 1;Vacant number of threads is 60
~70, the weight coefficient being configured is 0.9.Host node is tested according to corresponding to the weight coefficient of vacant thread by single business scenario
Use-case and test code distribution are to multiple from node.Weight coefficient is higher, represents more from the vacant number of threads of node.Weighting
Coefficient is high from node, and the thread for receiving test case corresponding to single business scenario and test code is relatively more.Pass through weighting
Coefficient is allocated to the different performance tests that mixed service scene is carried out from node so that each from the work between node
Load is as suitable as possible, effectively realizes multiple load balancing between node.
In one of the embodiments, host node according to vacant number of threads by the test case of multiple single business scenarios and
Test code distribution to accordingly from node the step of, including:Obtain weighting corresponding to each vacant number of threads from node
Coefficient;If being more than the quantity for splitting obtained multiple single business scenarios from number of nodes, host node is corresponding according to single business scenario
Interface quantity and weight coefficient be that the selection of single business scenario is one or more from node;Used being tested corresponding to single business scenario
Example and test code distribution are to accordingly from node.
A single business scenario after host node can split mixed service scene is distributed to one from node, from node
Multiple threads are called to perform corresponding performance test according to the test mode of single business scenario.Split if being more than from the quantity of node
The quantity of obtained multiple single business scenarios, host node can also according to corresponding to single business scenario interface quantity and from node pair
The weight coefficient answered is one or more from node for different single business scenario selections, by corresponding to single business scenario after selection
Test case and test code distribution are performed corresponding to single business scenario to accordingly from node from node using multiple vacant threads
Performance test.It is multiple to carry out concurrent testing to each single business scenario from node, each the multiple of single business scenario are connect
Mouth is serially tested according to service logic.So as to be surveyed by multiple from the cooperation of node to complete the performance of mixed service scene
Examination.
In one of the embodiments, host node according to from weight coefficient corresponding to node by the survey of multiple single business scenarios
Example on probation and test code distribution each call vacant thread to multiple single business scenario feasibilitys to all from node from node
Can test.So that the performance test of mixed service scene is each can carry out from node.Performing mixed service scene
Performance test when, it is multiple to carry out concurrent testing to each single business scenario from node, to the more of each single business scenario
Individual interface is serially tested according to service logic.
By the way that mixed service scene is split as into multiple single business scenarios, concurrent testing is carried out to multiple single business scenarios,
Effectively increase testing efficiency.Multiple interfaces of each single business scenario are serially tested according to service logic, it is ensured that
The accuracy of performance test.
Further, when business scenario is stability business scenario, testing in exit criteria the thread upper limit configured can
To be the preset ratio of the mixed service scene thread upper limit, such as 50%.The performance test of stability business scenario can be according to
The mode of mixed service scene is carried out, and when reaching test exit criteria, thread exits corresponding test.
In one embodiment, this method also includes:It is newly-increased that newly-increased node identification is sent from node to host node;Host node
According to newly-increased initialization command is sent from node identification to newly-increased from node;It is newly-increased to perform initialization command, initialization from node
After the completion of, increase the test case and test code that host node distribution is received from node newly, perform performance corresponding with business scenario
Test.
In the present embodiment, host node in server cluster and it can be communicated from node by message queue.Work as clothes
Business device cluster in from node can not meet current performance test the needs of when, can to server cluster carry out dilatation.Specifically
, tester can be to newly-increased from node installation testing tool.It is newly-increased to be sent newly to host node by message queue from node
Increase node identification.Host node receives newly-increased node identification, and newly-increased node identification is recorded, by message queue to newly-increased
Node sends initialization command.Newly-increased node receives initialization command, and initialization operation is carried out according to the order.Newly-increased node is complete
Into after initialization operation, you can call thread to receive the test assignment that host node is distributed as from node using testing tool,
Performance test corresponding with application scenarios is performed with this.
In one embodiment, as shown in Figure 3, there is provided a kind of performance testing device of application program, including:Host node
302 and from node 304, wherein:
Host node 302, the performance test request of the business scenario sent for receiving terminal, is carried in performance test request
Configuration information corresponding to business scenario;Test case and utilization configuration information generation pair according to corresponding to obtaining configuration information
The test code answered;Test code and test case are distributed to multiple from node 304.
From node 304, for running multiple threads, utilized by thread and test code and test case to business scenario
Multiple interface execution performance tests.
Host node 302 is additionally operable to receive multiple test datas returned from node 304, is tested and reported using Test data generation
Accuse.
In one of the embodiments, when the error rate when individual interface in performance test reaches first threshold, from section
The thread of point 304 exits performance test corresponding to interface, is additionally operable to record corresponding test data from node 304.
In one of the embodiments, host node 302 corresponds to thread step number and step frequency according to individual interface, note
Record the number of threads to the test of individual interface execution performance;It is more when number of threads reaches Second Threshold corresponding to individual interface
The individual thread from node 304 exits the performance test of individual interface, and corresponding test data is recorded from node 304.
In one embodiment, business scenario includes mixed service scene and single business scenario;When business scenario is mixing
During business scenario, host node 302 is additionally operable to mixed service scene being split as multiple single business scenarios;Obtain multiple single business fields
Test case corresponding to scape and test code;By test case corresponding to multiple single business scenarios and test code distribution to multiple
From node 304;It is additionally operable to call multiple threads to test multiple single business scenario execution performances from node 304..
In one embodiment, host node 302 is additionally operable to obtain each from the vacant number of threads of node 304;According to sky
Remaining number of threads is by the test case of multiple single business scenarios and test code distribution to accordingly from node 304;From node 304
It is additionally operable to the performance test for calling multiple vacant threads to perform single business scenario.
In one embodiment, host node 302 is additionally operable to obtain weighting corresponding to each vacant number of threads from node
Coefficient;If it is more than the quantity for splitting obtained multiple single business scenarios from number of nodes, according to interface corresponding to single business scenario
Quantity and weight coefficient are that the selection of single business scenario is one or more from node;By test case and survey corresponding to single business scenario
Code distribution is tried to accordingly from node 304.
In one embodiment, host node 302 be additionally operable to according to from weight coefficient corresponding to node 304 by multiple single business
The test case and test code distribution of scene are to all from node 304.
In one embodiment, host node 302 is additionally operable to receive newly-increased increasing newly from node identification from the transmission of node 304,
To newly-increased initialization command is sent from node 304;It is newly-increased to perform initialization command from node 304, after the completion of initialization, increase newly from
Node 304 receives test case and the test code that host node 302 is distributed, and performs performance test corresponding with business scenario.
In one embodiment, there is provided a kind of server cluster, including host node and multiple from node.Host node and from
Node can be separate server.As shown in figure 4, host node includes processor, memory and the net connected by system bus
Network interface.Wherein, the processor of the host node is used to provide calculating and control ability.The memory of the host node includes non-volatile
Property storage medium, built-in storage.The non-volatile memory medium of the server is stored with operating system and and computer program.Should
The built-in storage of host node provides environment for the operating system in non-volatile memory medium and the operation of computer program.The master
The network interface of node be used for outside terminal and it is multiple communicated between node by network connection, such as, receive eventually
The configuration information of the business scenario sent is held, and to multiple test cases from needed for node distribution service scene performance test
With test code., can be real when the computer program of the host node is executed by processor by terminal and the cooperation from node
A kind of existing performance test methods of application program.It will be understood by those skilled in the art that the structure shown in Fig. 4, only with
The block diagram of the related part-structure of application scheme, the limit for the server being applied thereon to application scheme is not formed
Fixed, specific server can include, than more or less parts shown in figure, either combining some parts or with not
Same part arrangement.
A kind of computer equipment, including memory and processor, computer program is stored in memory, and instruction is processed
When device performs so that computing device following steps:
The performance test request of the business scenario sent by host node receiving terminal, industry is carried in performance test request
Configuration information corresponding to scene of being engaged in;
Generation is tested corresponding to host node test case and utilization configuration information generation according to corresponding to obtaining configuration information
Code;
Code will be tested by host node and test case is distributed to multiple threads run from node;It is each to cause
Multiple interface execution performances of business scenario are tested using code and test case is tested from the thread of node;
Multiple test datas returned from node are received by host node, utilize Test data generation test report.
In one embodiment, following steps are also performed during computing device computer program:
When error rate of the individual interface in performance test reaches first threshold, it is corresponding to exit interface from the thread of node
Performance test;Using from test data corresponding to nodes records;Or
Host node corresponds to thread step number and step frequency according to individual interface, records and individual interface execution performance is surveyed
The number of threads of examination;When number of threads reaches Second Threshold corresponding to interface, multiple property that interface is exited from the thread of node
Can test, using from property test data corresponding to nodes records.
In one embodiment, following steps are also performed during computing device computer program:
When business scenario is mixed service scene, mixed service scene is split as by multiple single business fields by host node
Scape;
Test case corresponding to multiple single business scenarios and test code are obtained by host node;
By host node by test case corresponding to multiple single business scenarios and test code distribution to multiple from node
Thread execution performance is tested.
In one embodiment, following steps are also performed during computing device computer program:
Obtained by host node each from the vacant number of threads of node;
Host node is according to vacant number of threads by the test case of multiple single business scenarios and test code distribution to corresponding
From node, to cause performance test corresponding to each single business scenario to be performed by multiple from node.
In one embodiment, following steps are also performed during computing device computer program:
Obtain each weight coefficient corresponding to the vacant number of threads from node;
If being more than the quantity for splitting obtained multiple single business scenarios from number of nodes, host node is according to single business scenario pair
The interface quantity and weight coefficient answered are that the selection of single business scenario is one or more from node;
By test case corresponding to single business scenario and test code distribution to accordingly from node.
In one embodiment, following steps are also performed during computing device computer program:
It is newly-increased that newly-increased node identification is sent from node to host node;
Host node sends initialization command from node identification to newly-increased according to newly-increased from node;
It is newly-increased to perform initialization command from node, after the completion of initialization, increase the test that host node distribution is received from node newly
Use-case and test code, perform performance test corresponding with business scenario.
In one embodiment, there is provided a kind of computer-readable recording medium, be stored thereon with computer program, calculate
Machine program realizes following steps when being executed by processor:
The performance test request of the business scenario sent by host node receiving terminal, industry is carried in performance test request
Configuration information corresponding to scene of being engaged in;
Generation is tested corresponding to host node test case and utilization configuration information generation according to corresponding to obtaining configuration information
Code;
Code will be tested by host node and test case is distributed to multiple threads run from node;It is each to cause
Multiple interface execution performances of business scenario are tested using code and test case is tested from the thread of node;
Multiple test datas returned from node are received by host node, utilize Test data generation test report.
In one embodiment, following steps are also performed when computer program is executed by processor:
When error rate of the individual interface in performance test reaches first threshold, it is corresponding to exit interface from the thread of node
Performance test;Using from test data corresponding to nodes records;Or
Host node corresponds to thread step number and step frequency according to individual interface, records and individual interface execution performance is surveyed
The number of threads of examination;When number of threads reaches Second Threshold corresponding to interface, multiple property that interface is exited from the thread of node
Can test, using from property test data corresponding to nodes records.
In one embodiment, business scenario includes mixed service scene and single business scenario;Computer program is processed
Device also performs following steps when performing:
When business scenario is mixed service scene, mixed service scene is split as by multiple single business fields by host node
Scape;
Test case corresponding to multiple single business scenarios and test code are obtained by host node;
By host node by test case corresponding to multiple single business scenarios and test code distribution to multiple from node
Thread execution performance is tested.
In one embodiment, following steps are also performed when computer program is executed by processor:
Obtained by host node each from the vacant number of threads of node;
Host node is according to vacant number of threads by the test case of multiple single business scenarios and test code distribution to corresponding
From node, to cause performance test corresponding to each single business scenario to be performed by multiple from node.
In one embodiment, following steps are also performed when computer program is executed by processor:
Obtain each weight coefficient corresponding to the vacant number of threads from node;
If being more than the quantity for splitting obtained multiple single business scenarios from number of nodes, host node is according to single business scenario pair
The interface quantity and weight coefficient answered are that the selection of single business scenario is one or more from node;
By test case corresponding to single business scenario and test code distribution to accordingly from node.
In one embodiment, following steps are also performed when computer program is executed by processor:
It is newly-increased that newly-increased node identification is sent from node to host node;
Host node sends initialization command from node identification to newly-increased according to newly-increased from node;
It is newly-increased to perform initialization command from node, after the completion of initialization, increase the test that host node distribution is received from node newly
Use-case and test code, perform performance test corresponding with business scenario.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be with
The hardware of correlation is instructed to complete by computer program, described computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein,
Described storage medium can be magnetic disc, CD, read-only memory (Read-Only Memory, ROM) etc..
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the application, and its description is more specific and detailed, but simultaneously
Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the art
Say, on the premise of the application design is not departed from, various modifications and improvements can be made, these belong to the protection of the application
Scope.Therefore, the protection domain of the application patent should be determined by the appended claims.