CN109491891A - Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium - Google Patents

Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium Download PDF

Info

Publication number
CN109491891A
CN109491891A CN201811208301.8A CN201811208301A CN109491891A CN 109491891 A CN109491891 A CN 109491891A CN 201811208301 A CN201811208301 A CN 201811208301A CN 109491891 A CN109491891 A CN 109491891A
Authority
CN
China
Prior art keywords
pressure
survey
result
interface
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811208301.8A
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201811208301.8A priority Critical patent/CN109491891A/en
Publication of CN109491891A publication Critical patent/CN109491891A/en
Pending legal-status Critical Current

Links

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

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)
  • Measuring Fluid Pressure (AREA)

Abstract

Survey method, apparatus, computer equipment and storage medium the invention discloses a kind of full-automatic interface pressure, this method include call it is pre-configured restart script, restart server;Pre-configured pressure is called to survey script, the service performance and pressure to the server restarted are surveyed interface capability and be tested for the property, and obtain target pressure and survey result;Using performance evaluation rule corresponding with service performance and pressure survey interface capability, presses survey result to analyze target, obtain target analysis result;Interface is surveyed to the pressure that target analysis result is test crash and carries out out mispointing, obtains test crash module;It presses survey result, target analysis result and test crash module to fill into corresponding test report template target, obtains test report, time-consuming to solve the problems, such as manual analysis pressure survey result.

Description

Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium
Technical field
The present invention relates to functional test fields more particularly to a kind of full-automatic interface pressure to survey method, apparatus, computer equipment And storage medium.
Background technique
Currently, traditional pressure survey means mainly pass through with some profession pressure survey tools (such as JMeter or Roadrunner pressure survey) is carried out, surveys result to obtain pressure.For example, the interface for measuring system is wrong under the concurrency of setting magnitude Accidentally rate and the size of TPS etc..But survey tool is pressed only to carry out the execution of pressure survey and the output of result, also many places need a large amount of Human-computer interaction, for example, it is desired to open pressure survey tool carry out pressure survey, collect all relevant test results, pressure is surveyed result into Row analysis and output pressure observe and predict announcement etc..The pressure that current manual measures pressure survey tool is surveyed result and is analyzed, and analytic process is complicated And it is time-consuming.
Summary of the invention
The embodiment of the present invention provides a kind of full-automatic interface pressure and surveys method, apparatus, computer equipment and storage medium, with solution Certainly manual analysis pressure surveys result the problem of time-consuming.
A kind of full-automatic interface pressure survey method, comprising:
Call it is pre-configured restart script, restart server;
Pre-configured pressure is called to survey script, the service performance and pressure to the server restarted survey interface capability progressive It can test, obtain target pressure and survey result;
Using performance evaluation rule corresponding with the service performance and pressure survey interface capability, to the target pressure It surveys result to be analyzed, obtains target analysis result;
Interface is surveyed to the pressure that the target analysis result is test crash and carries out out mispointing, obtains test crash module;
Survey result, the target analysis result and the test crash module is pressed to fill to corresponding test the target In report template, test report is obtained.
A kind of full-automatic interface pressure survey device, comprising:
Restart module, for call it is pre-configured restart script, restart server;
Test module, for calling pre-configured pressure to survey script, service performance and pressure to the server restarted are surveyed Interface capability is tested for the property, and is obtained target pressure and is surveyed result;
Analysis module, for being advised using performance evaluation corresponding with the service performance and pressure survey interface capability Then, it presses survey result to analyze the target, obtains target analysis result;
Malfunction locating module, carries out out mispointing for surveying interface to the pressure that the target analysis result is test crash, Obtain test crash module;
Report generation module surveys result, the target analysis result and the test crash mould for pressing the target Block is filled into corresponding test report template, and test report is obtained.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize above-mentioned full-automatic interface pressure survey method when executing the computer program The step of.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter Calculation machine program realizes the step of above-mentioned full-automatic interface pressure survey method when being executed by processor.
Above-mentioned full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium, pre-configured by calling Restart script, restart server, so that server, which is under completely new starting state, carries out pressure survey, to guarantee subsequent performance test The target pressure obtained in journey surveys the objectivity of result.By calling pre-configured pressure to survey script, to the server restarted Service performance and pressure are surveyed interface capability and are tested for the property, and are surveyed to target pressure as a result, being not required to manually open pressure survey with quick obtaining Tool carries out pressure survey, realizes that automation pressure is surveyed, and press survey process simple and quick.Interface capability phase is surveyed using with service performance and pressure Corresponding performance evaluation rule presses survey result to analyze target, obtains target analysis as a result, by target analysis result Mispointing is carried out out for the pressure survey interface of test crash, obtains test crash module, to realize that the pressure to test crash surveys interface Mispointing is carried out out, test crash module is optimized so as to subsequent, enables the pressure to survey interface and is successfully tested.Finally, By pressing survey result, target analysis result and test crash module to fill into corresponding test report template target, quickly Test report is obtained, realizes that full-automatic interface pressure is surveyed, improves the acquisition efficiency of test report.The full-automatic interface pressure survey method, Device, computer equipment and storage medium are, it can be achieved that performance test process automation, interpretation of result process automation, error are fixed The position whole processes such as process automation and report generation process automation automation, is not necessarily to manpower intervention, simplifies pressure flow gauge, saves Pressure surveys the time.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is the application environment schematic diagram of full-automatic interface pressure survey method in one embodiment of the invention;
Fig. 2 is the flow chart of full-automatic interface pressure survey method in one embodiment of the invention;
Fig. 3 is the flow chart of full-automatic interface pressure survey method in one embodiment of the invention;
Fig. 4 is the flow chart of full-automatic interface pressure survey method in one embodiment of the invention;
Fig. 5 is the flow chart of full-automatic interface pressure survey method in one embodiment of the invention;
Fig. 6 is the functional block diagram that full-automatic interface pressure surveys device in one embodiment of the invention;
Fig. 7 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Below by the attached drawing in knot and the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Full-automatic interface provided in an embodiment of the present invention presses survey method, can be applicable in the application environment such as Fig. 1, this is complete certainly Mobile interface pressure survey method applies server-side and client in automatically-monitored tool, wherein client passes through network and service End is communicated.Full-automatic interface pressure survey method is applied in the server-side of automatically-monitored tool, to needing to carry out pressure survey Server restarted, and call pre-configured pressure survey script to the service performance of server and pressure survey interface capability into Row pressure is surveyed, and is automatically analyzed, and test report is generated, and is surveyed with the full-automatic pressure of realization, is not required to manually carry out pressure survey result Analysis improves pressure and surveys interpretation of result efficiency.Wherein, client can be, but not limited to various personal computers, laptop, intelligence It can mobile phone, tablet computer and portable wearable device.Server-side can use independent server-side either multiple server-side groups At server-side cluster realize.
In one embodiment, it as shown in Fig. 2, providing a kind of full-automatic interface pressure survey method, applies in Fig. 1 in this way Server-side for be illustrated, specifically comprise the following steps:
S10: call it is pre-configured restart script, restart server.
Wherein, restarting script can be shell script, and shell script is the pre-configured script of developer, exploitation Personnel are mainly the script write in advance using the function of shell.Developer, will be some by with normal representation method The grammer of shell and instruction write in script, to realize that pipeline order and data flow such as are redirected at the functions.In the present embodiment, The server for carrying out pressure survey is restarted by pre-configured shell script, is encoded on the shell script achievable The shell grammer of Server Restart function and instruction.
It specifically, include at least one functional module in server, which refers to can realize in the server The functional module of certain function.For example, the functional module of login function is realized, alternatively, realizing the function mould of on-line payment function Block.In the present embodiment, before carrying out pressure survey to server, pre-configured shell script is called, server is restarted, it should The process for restarting server can realize the purpose for restarting all functional modules in server.It is to be appreciated that by server Restarted, when so that the server of different editions carrying out pressure survey, server is in the functional module in server and completely newly opens Under dynamic state, to carry out pressure survey under completely new starting state, the accuracy that the pressure got surveys result is improved, pressure is avoided to survey It is influenced in journey by the functional module opened before restarting.It is to be appreciated that firstly, client is sent to the service of restarting of server-side The Restart Request of device carries the server identification for the server for needing to restart for unique identification in the Restart Request.Server-side It, can be pre-configured with clothes by calling according to the server identification in Restart Request after receiving the Restart Request The corresponding shell script of device mark of being engaged in, is realized by executing shell script to Server Restart.Wherein, server can be Linux server.
Further, configured shell script is stored in the server-side of automatically-monitored tool in advance, based on certainly Dynamicization monitoring tools carry out full-automatic pressure and survey.Client restarts server to the transmission of the server-side of automatically-monitored tool Restart Request, when the server-side of automatically-monitored tool detect client send Restart Request, call pre-configured Shell script, restarts server.Wherein, automatically-monitored tool specifically can be Jenkins tool, which is The Web project of one continuous integrating obtains each pre-configured script automatically, compiles and constructed, and is being arranged Time continuously carry out.
S20: calling pre-configured pressure to survey script, the service performance and pressure to the server restarted survey interface capability into Row performance test obtains target pressure and surveys result.
Wherein, it is the pre-configured script for being used to carry out pressure test of developer that pressure, which surveys script,.Specifically, it develops Personnel are mainly to survey what interface capability was configured according to the service performance and pressure of server, survey in script in pressure configure one in advance A little pressures survey function, so that being tested for the property when the pressure surveys script execution, it can be achieved that surveying interface capability to service performance and pressure. Target pressure survey result refers to that surveying script by pressure is tested for the property and is obtained to the service performance of server and pressure survey interface capability The result obtained.When service performance refers to that surveying interface to pressure carries out pressure survey, the performance of server, for example, the CPU of server, memory With Load Average etc..When pressure survey interface capability refers to that carrying out pressure to pressure survey interface surveys, the performance for surveying interface is pressed, for example, pressing Survey response time, TPS and the error rate etc. of interface.
Specifically, before carrying out pressure survey, interface is surveyed configured with pressure to server in advance, and configure and need in pressure survey tool The pressure for carrying out pressure survey surveys the address of interface.During carrying out pressure survey, server is called pre-configured using pressure survey tool Pressure surveys script, surveys interface to preconfigured pressure and carries out pressure test, to realize service performance and pressure to the server restarted It surveys interface capability to be tested for the property, obtains target pressure and survey result.Wherein, pressure survey tool can be JMeter tool, JMeter Tool can be used for testing the performance of static and dynamic resource.It is to be appreciated that being called pre- using JMeter tool First configured pressure surveys script, surveys interface based on preconfigured pressure, simulates heavy load to server to test not With the performance under pressure type, i.e., interface is surveyed to the service performance for the server restarted and pressure and be tested for the property, obtain target Pressure surveys result.For example, based on preconfigured pressure survey interface, under 100,000 grades of concurrency, using JMeter tool, to restarting Server service performance and pressure survey interface be tested for the property.
Further, it after the server-side of automatically-monitored tool detects Server Restart, generates pressure and surveys sign on, adopt With JMeter tool, pre-configured pressure is called to survey script, the service performance and pressure to the server restarted survey interface capability It is tested for the property, the target pressure for obtaining each service performance surveys result and the target pressure of pressure survey interface capability is surveyed as a result, being not required to Artificial pressure survey tool of opening carries out pressure survey, simplifies pressure flow gauge, improves pressure and survey efficiency.Wherein, the target pressure of service performance surveys knot Fruit can be under the concurrency of certain magnitude, and the targets such as CPU, memory and Load Average of server pressure surveys result.Pressure The target pressure for surveying interface capability, which surveys result, can be under the concurrency of certain magnitude, and pressure surveys response time, TPS and the mistake of interface Accidentally the targets such as rate pressure surveys result.Wherein, when server-side is tested for the property using JMeter tool, test result, the survey are obtained Test result is to be saved in the form of a file;Then, server-side can be by analytical tool to the corresponding file of the test result It is parsed, obtains target pressure and survey result.Wherein, concurrency is the number of transactions of server while processing.CPU is i.e. at some Between the occupied situation of CPU in section.Memory refers to whether detection service device occurs memory overflow or memory overflows.Load Average is that CPU uses the statistical information of the length of queue whithin a period of time.Response time is the processing for handling an affairs Time.TPS is the affairs number that is disposed in Fixed Time Interval.Error rate is that finger pressure dendrometry loses the total pressure survey time of number Zhan Several ratio.
Further, each service performance target pressure corresponding with pressure survey interface capability result is surveyed to save to relationship type number According in library, surveys result so as to the target pressure for improving the subsequent quick search in relevant database to service performance and press and survey interface The target pressure of performance is surveyed as a result, improving search efficiency, and help to improve the efficiency for pressing target and surveying result and being analyzed.
S30: surveying interface capability corresponding performance evaluation rule using with service performance and pressure, to target pressure survey result into Row analysis, obtains target analysis result.
Wherein, performance evaluation rule refers to that developer is pre-configured in pressure and surveys connecing in script with service performance and pressure survey The corresponding rule of mouth performance.The performance evaluation rule includes performance evaluation rule corresponding with service performance and connects with pressure survey The corresponding performance evaluation rule of mouthful performance performance evaluation rule corresponding with service performance and should survey interface capability phase with pressure Corresponding performance evaluation rule can be identical, can also be different.
Specifically, server-side calls pressure to survey script according to service performance, obtains performance evaluation corresponding with service performance Rule presses survey result to divide target corresponding with service performance using the performance evaluation rule corresponding with service performance Analysis obtains target analysis result corresponding with service performance.Correspondingly, server-side surveys interface capability according to pressure and calls pressure survey foot This, acquisition performance evaluation rule corresponding with pressure survey interface capability, using the performance point corresponding with pressure survey interface capability Analysis rule is surveyed result to target pressure corresponding with survey interface capability is pressed and is analyzed, obtains mesh corresponding with pressure survey interface capability Mark analysis result.Wherein, target analysis result can be to be successfully tested and test crash.
Further, after the server-side of automatically-monitored tool detects that target pressure surveys result, analysis instruction is generated, According to analysis instruction, interface capability is surveyed by service performance and pressure, pressure is called to survey script, surveys interface using with service performance and pressure The corresponding performance evaluation rule of performance presses survey result to analyze target, obtains target analysis as a result, its process automation It realizes, is conducive to improve analysis efficiency, and reduce analysis duration.
In the present embodiment, if it is that the targets such as CPU, memory and Load Average pressure is surveyed that the target pressure of service performance, which surveys result, It is advised as a result, being surveyed in script from pressure and obtaining performance evaluation corresponding with the targets such as CPU, memory and Load Average pressure survey result Then, performance evaluation rule can be the targets such as CPU, memory and Load Average are pressed survey result and preset desired value into Row comparison is successfully tested or the target analysis result of test crash according to comparing result acquisition.For example, the default desired value of CPU It is 80%, and it is 75% that the corresponding target pressure of CPU, which surveys result, during being surveyed due to pressure, the lower CPU the better, and target pressure surveys knot Fruit is lower than default desired value, then the corresponding target analysis result of service performance CPU is to be successfully tested.
Correspondingly, if it is that the targets such as response time, TPS and error rate pressure surveys knot that the target pressure that pressure surveys interface capability, which surveys result, Fruit is surveyed in script from pressure and obtains performance evaluation rule corresponding with the targets such as response time, TPS and error rate pressure survey result, Performance evaluation rule, which can be, presses survey result and history pressure survey result to compare the targets such as response time, TPS and error rate, Acquisition is successfully tested according to comparing result acquisition or the target analysis result of test crash.For example, response time corresponding history It is 2 seconds that pressure, which surveys result, and it is 3 seconds that response time corresponding target pressure, which surveys result, and during being surveyed due to pressure, the response time is smaller more It is good, press survey result to press survey result to compare with history target, target pressure surveys result greater than history pressure survey as a result, then survey is pressed to connect Mouth performance response time corresponding target analysis result is test crash.Conversely, if response time corresponding target pressure surveys result It is 1.5 seconds, then pressing and surveying interface capability response time corresponding target analysis result is to be successfully tested.
Further, by each service performance target analysis result associated storage corresponding with pressure survey interface capability to pass It is to carry out the operation such as inquiring so as to subsequent, help to improve the subsequent efficiency analyzed in type database.
S40: interface is surveyed to the pressure that target analysis result is test crash and carries out out mispointing, obtains test crash module.
Wherein, test crash module refers to the module for causing pressure to survey interface testing failure.Specifically, server-side is according to acquisition The each pressure arrived surveys the target analysis of interface capability as a result, determining that the pressure that target analysis result is test crash surveys interface, needs Illustrate, when to pressing survey interface to carry out pressure survey, needing multiple test modules or subsystem to carry out cooperation completion one and requesting Task surveys interface to the pressure that target analysis result is test crash and carries out out mispointing, i.e., to test module or subsystem into Row goes out mispointing.It is to be appreciated that server-side is called by the test mark for surveying interface configuration in advance for pressure surveys interface to the pressure When carrying out pressure survey, the information of used test module or used subsystem, and pass through pre-set positioning work Have the module to malfunction in the pressure survey interface to the test crash to position, obtains test crash module.Wherein, positioning tool can Using ELK and Metricbeat, that is, ELK and Metricbeat can be used to connect to the pressure survey that target analysis result is test crash Mouth carries out out mispointing, obtains test crash module.
Further, after the server-side of automatically-monitored tool detects target analysis result, based on test crash Target analysis result generates mispointing instruction, according to error positioning instruction, surveys to the pressure that target analysis result is test crash Interface carries out out mispointing, obtains test crash module, and process can realize that automation is surveyed interface to the pressure of test crash and carried out Positioning analysis, so that it is determined that test crash module improves analysis efficiency, and reduce analysis duration to realize automated analysis.
Further, pressure is surveyed into interface capability and test crash module relation is stored into relevant database, so as to It is subsequent to carry out the operation such as inquiring, be conducive to the acquisition efficiency for improving test report.
S50: survey result, target analysis result and test crash module is pressed to fill to corresponding test report template target In, obtain test report.
Wherein, test report refers to the report for pressing according to target and surveying result, target analysis result and test crash module and generating It accuses.
Specifically, target can be pressed and survey result, target analysis result and test mistake by being pre-configured with test report template It loses module to be filled into test report template, test report can be automatically generated, process is not necessarily to manual intervention, is conducive to improve The acquisition efficiency of test report.It wherein, further include some gauge outfits that can customize generation in test report, for example, project name, Version number, testing time and test environment etc..
Further, it after the server-side of automatically-monitored tool detects test crash module, generates test report and refers to It enables, is instructed based on test report, press survey result, target analysis result and test crash module to fill to test report mould target In plate, test report is obtained, and can send according to preset audit interface to test report, so that the test report obtains It takes process automation to realize, is not necessarily to manual intervention, be conducive to improve test report acquisition efficiency, and reduce acquisition duration.
In step S10-S50, by call it is pre-configured restart script, server is restarted, so that server is in Pressure survey is carried out under completely new starting state, to guarantee that the target pressure obtained during subsequent performance test surveys the objectivity of result.It is logical It crosses and pre-configured pressure is called to survey script, the service performance and pressure to the server restarted survey interface capability and carry out performance survey Examination is surveyed to target pressure as a result, being not required to manually unlatching pressure survey tool carries out pressure survey, realization automation pressure survey, and presses with quick obtaining Survey process is simple and quick.Survey result is pressed to analyze target using performance evaluation rule corresponding with service performance, to obtain Target analysis is taken as a result, making whether the service performance for quickly judging server reaches preset requirement;And it uses and is surveyed with pressure The corresponding performance evaluation rule of interface capability obtains target analysis as a result, so that client should according to the judgement of target analysis result Pressure survey interface capability, which compares to press with the history of other several versions, surveys whether result optimizes, and is not required to artificially collect related pressure survey result It is analyzed, realizes that automated analysis improves analysis efficiency, save the time.Server-side is by being that test is lost to target analysis result The pressure lost surveys interface and carries out out mispointing, obtains test crash module, to realize that the pressure survey interface to test crash malfunctions Positioning enables the pressure to survey interface and is successfully tested so that subsequent clients optimize test crash module.Finally, by mesh Mark pressure is surveyed result, target analysis result and test crash module and is filled into corresponding test report template, quick obtaining test Report realizes that full-automatic interface pressure is surveyed, improves the acquisition efficiency of test report.Also, it is automatically connect provided by the present embodiment Mouth pressure survey method is, it can be achieved that performance test process automation, interpretation of result process automation, the automation of error position fixing process and report The whole processes automation such as generating process automation is accused, manpower intervention is not necessarily to, simplifies pressure flow gauge, pressure is saved and surveys the time.
In one embodiment, restart script include it is corresponding with server restart function, restart function include form ginseng Number;It includes that pressure corresponding with each pressure survey interface surveys function that pressure, which surveys script, and it includes formal parameter that pressure, which surveys function,.Specifically, exist Before server-side executes the full-automatic interface pressure survey method, needs to set in restarting script in advance and restart function, restarting function can For restarting to server.And it needs to survey in presser feet sheet in pressure in advance and sets the corresponding pressure survey function of each pressure survey interface, pressure Surveying function can be used to be tested for the property pressure survey interface.Therefore, it as shown in Fig. 2, before step S10, that is, is calling in advance Configured to restart script, before the step of restarting server, which further includes following steps:
S101: script configuring request is obtained, script configuring request includes script type.
Wherein, script configuring request is that the request of script configuration is carried out for triggering server-side.Script type refers to script Affiliated type, in the present embodiment, script type, which specifically includes, restarts (shell) script type and pressure surveys two kinds of script type. Specifically, developer configures the needs for restarting script and pressure survey script as needed, sends foot to server-side by client This configuring request includes script type in script configuring request, so that server-side determines that its needs is matched according to the script type Set which kind of script type is corresponding script.
S102: if script type is to restart script, actual parameter corresponding with server is obtained;Actual parameter is transmitted The corresponding formal parameter restarted in function of server is given, acquisition is configured to restart script.
Specifically, when the script type in script configuring request is to restart script, reality corresponding with server is obtained Parameter, i.e. server identification, wherein server identification refers to the mark configured in advance for server, by the practical ginseng of server Number (i.e. server identification) pass to the formal parameter for restarting function for restarting script, with get it is configured restart script, So as to subsequent according to server identification, call it is corresponding restarts script, execute this and restart and restart function in script to the service Device identifies corresponding server and is restarted.
S103: if script type is that pressure surveys script, actual parameter corresponding with each pressure survey interface is obtained;By practical ginseng Number passes to the formal parameter that pressure corresponding with pressure survey interface is surveyed in function, obtains configured pressure and surveys script.
Specifically, it when the script type in script configuring request is that pressure surveys script, obtains corresponding with each pressure survey interface Actual parameter, which can be pressure and surveys interface IP address, concurrency and length of testing speech etc..Then, server-side will be practical Parameter passes to the formal parameter that pressure corresponding with pressure survey interface surveys function, surveys script to get configured pressure, so as to Subsequent calls pressure surveys script, surveys function according to the pressure in pressure survey script and carries out to the service performance of server and pressure survey interface capability Performance test.
In step S101-S103, script configuring request is obtained, script configuring request includes script type, so as to according to foot This type carries out script configuration.If script type is to restart script, actual parameter corresponding with server is obtained;By practical ginseng Number passes to the formal parameter restarted in function corresponding with server, and acquisition is configured to restart script, and foot is restarted in realization This configuration restarts server and provides technical support to be subsequent.If script type is that pressure surveys script, obtains and survey interface with each pressure Corresponding actual parameter;Actual parameter is passed into the formal parameter that pressure corresponding with pressure survey interface is surveyed in function, is obtained Configured pressure surveys script, realizes that pressure surveys the configuration of script, be the subsequent service performance to server and pressure survey interface capability into Row performance test provides technical support.
In one embodiment, as shown in figure 3, in step S20, that is, pre-configured pressure is called to survey script, to what is restarted The service performance and pressure of server are surveyed interface capability and are tested for the property, and obtain target pressure and survey result, comprising:
S21: using the starting state of automatically-monitored tool detection service device, after the completion of Server Restart, pressure is generated Survey sign on.
Wherein, pressure survey sign on refers to the instruction that can be tested for the property.
Specifically, automatically-monitored tool is Jenkins tool, when Jenkins tool detects that Server Restart is completed Afterwards, it generates pressure and surveys sign on, sign on is surveyed according to the pressure so as to follow-up service end and is tested for the property.
S22: surveying sign on based on pressure, calls pre-configured pressure to survey script using pressure survey tool, to the clothes restarted The service performance and pressure of business device are surveyed interface capability and are tested for the property, and test result file is obtained.
Wherein, pressure survey tool may be, but not limited to, JMeter tool.Test result file refer to JMeter tool according to Pressure surveys script and is tested for the property file obtained to the service performance for the server restarted and pressure survey interface capability.Test knot Target pressure survey result is corresponded to comprising each service performance in fruit file and each pressure surveys the corresponding target pressure of interface capability and surveys result.
Further, server-side is based on pressure and surveys sign on, using JMeter tool, pre-configured pressure is called to survey foot This is surveyed interface capability to the service performance and pressure of the server restarted and is tested for the property, comprising: surveys to press in script according to pressure and survey The sequencing of interface obtains each pressure in pressure survey script and surveys the corresponding actual parameter of interface;It is preparatory that interface is surveyed according to each pressure The actual parameter of setting calls pressure to survey function and is tested for the property to pressure survey interface;It obtains each pressure and surveys the corresponding pressure survey of interface The test result file of interface capability, and the test result file of the service performance of server is obtained simultaneously.It is to be appreciated that root When carrying out pressure survey according to pressure survey interface of the pressure survey script to server, the corresponding test result file of pressure survey interface capability is got, At this point, the service performance of server also changes therewith, so as to obtain the test result file of service performance.Wherein, test knot Fruit file can be csv file.CSV (Comma-Separated Values, comma separated value), otherwise referred to as character separate Value, csv file are made of any number of record, and with the separation of certain newline between record, every record is made of field, field Between separator be other characters or character string, most commonly comma or tab.
S23: parsing test result file using analytical tool, obtains target pressure and surveys result.
Specifically, it is JAVA CSV analytical tool that analytical tool, which may be, but not limited to,.Server-side is solved by JAVA CSV Analysis tool parses test result file, i.e., parses to csv file, obtains the corresponding target pressure of each service performance It surveys result and each pressure surveys the corresponding target of interface capability and presses survey as a result, and target pressure is surveyed result, service performance, pressure survey interface Properties Correlation is stored into relevant database.
In step S21-S23, using the starting state of automatically-monitored tool detection service device, when Server Restart is completed Afterwards, it realizes that automatically generating pressure by automatically-monitored tool surveys sign on, sign on progressive is surveyed according to pressure so as to subsequent It can test, to realize that performance test process automation starts.Pre-configured pressure is called to survey script, counterweight using pressure survey tool The service performance and pressure of the server opened are surveyed interface capability and are tested for the property, and obtain test result file, realize performance test The acquisition efficiency of test result file can be improved so that performance test process is not necessarily to manual intervention in process automation.Using parsing Tool parses test result file, is pressed and is surveyed as a result, improving pressure surveys efficiency with quick obtaining to target.
In one embodiment, pressure surveys script and includes performance evaluation rule corresponding with service performance and survey interface with pressure It can corresponding performance evaluation rule.Wherein, performance evaluation rule is pre-configured rule, corresponding with service performance Performance evaluation rule and performance evaluation rule corresponding with pressure survey interface capability can be identical, can also be different.
In step S30, i.e., using performance evaluation rule corresponding with service performance and pressure survey interface capability to target pressure It surveys result to be analyzed, obtains target analysis as a result, specifically comprising the following steps:
(1) based on performance evaluation rule corresponding with service performance, target expectation corresponding with service performance is obtained Value, presses survey result and target desired value to compare target corresponding with service performance, obtains target based on comparing result Analyze result.
Wherein, comparing result can be target pressure corresponding with service performance and survey result higher than target desired value, may be used also To be that target pressure corresponding with service performance surveys result lower than target desired value.Target analysis result, which can be, to be successfully tested, It can also be test crash.Specifically, performance evaluation rule corresponding with service performance can be service performance is corresponding Target pressure surveys the rule that result and preset desired value compare and analyze.Moreover, service performance includes at least one.Server-side Pressure is being called to survey script according to service performance, it, can be according to performance after obtaining performance evaluation rule corresponding with service performance Analysis rule obtains corresponding with each service performance target desired value, by the corresponding target pressure of service performance survey result with The corresponding target desired value of the service performance compares, and obtains target analysis result based on comparing result.Specifically, if service The higher the better for device performance, if then target pressure surveys result higher than target desired value, the corresponding target analysis result of service performance is It is successfully tested;Correspondingly, if target pressure surveys result and is lower than target desired value, the corresponding target analysis result of service performance is to survey Examination failure, conversely, if the lower server performance the better, if target pressure, which surveys result, is higher than target desired value, service performance pair The target analysis result answered is test crash.In the present embodiment, pass through corresponding preset of the service performance by server Target desired value compares, and obtains target analysis as a result, so that client judges whether server reaches according to target analysis result To the requirement of setting.Further, by service performance with corresponding target analysis result associated storage into relevant database, It carries out the operation such as searching so as to subsequent.
Specifically, if service performance is CPU, memory and Load Average etc., according to CPU, memory and Load The calling such as Average pressure surveys script, gets corresponding performance evaluation index, if it includes mesh corresponding with CPU in script that pressure, which is surveyed, When marking desired value, the corresponding target pressure of CPU is surveyed into result and is compared and analyzed with target desired value, to obtain target analysis knot Fruit.For example, service performance is CPU, it is often desirable that occupied more fewer better of CPU within some period, if the target phase Prestige value is 80%, and it is 75% that target, which presses survey result, then target pressure surveys result lower than target desired value, and target analysis result is survey It tries successfully.
(2) it based on performance evaluation rule corresponding with survey interface capability is pressed, obtains corresponding with pressure survey interface capability History pressure is surveyed as a result, target pressure corresponding with survey interface capability is pressed is surveyed result presses survey result to compare with history, is based on Comparing result obtains target analysis result.
Wherein, comparing result can be target pressure corresponding with pressure survey interface capability and survey result higher than history pressure survey knot Fruit can also be that target pressure corresponding with pressure survey interface capability surveys result lower than history pressure survey result.Target analysis result can To be to be successfully tested, test crash can also be.Specifically, performance evaluation rule corresponding with pressure survey interface capability can be Pressure is surveyed into the corresponding target pressure survey result of interface capability and surveys the rule that result compares and analyzes with history pressure.The pressure surveys interface One can be at least.History pressure is surveyed result and is referred to under the version the same terms, connects to the pressure survey of the server of preceding several versions The pressure that mouth performance is tested for the property surveys result.
Specifically, server-side surveys interface capability calling pressure according to pressure and surveys script, obtains corresponding with pressure survey interface capability Performance evaluation rule, according to performance evaluation rule, search relationship type database obtains history corresponding with pressure survey interface capability It presses to survey and surveys result progress as a result, will press and survey the corresponding target pressure survey result of interface capability history pressure corresponding with pressure survey interface capability Comparison obtains target analysis result according to comparing result.In the present embodiment, pressure surveys interface capability, and the higher the better, then target pressure is surveyed As a result it is higher than history pressure to survey as a result, then pressing the corresponding target analysis result of survey interface capability is to be successfully tested;If target pressure surveys knot Fruit is lower than history expected result, then pressing and surveying the corresponding target analysis result of interface capability is test crash, conversely, pressure surveys interface Can be more lower better, then target pressure surveys result and is higher than history pressure and surveys surveys the corresponding target analysis result of interface capability and is as a result, then pressing Test crash.Wherein, history pressure, which surveys result, can be preceding several versions, surveys interface to pressure under the same conditions and is tested for the property Pressure survey result.It is stored with each version history pressure corresponding with pressure survey interface capability in relevant database and surveys result.Pass through The history pressure of the corresponding target pressure survey result of pressure survey interface capability and preceding several versions is surveyed result to compare and analyze, acquisition mesh Mark analysis is as a result, so that client judges that the pressure surveys whether interface capability compares and other several versions according to the target analysis result Whether optimize, can also survey interface according to pressure of the target analysis result to test crash and carry out performance optimization.
For example, if the pressure of the second edition being surveyed the corresponding target pressure of interface capability and surveys knot when the version is the second edition Fruit history pressure corresponding with the pressure of first version survey interface capability is surveyed result and is compared, and target analysis result is obtained.For example, pressure Survey interface capability is the response time, and the shorter the usual response time the better, if the pressure of the second edition surveys the interface capability response time Target pressure survey result be lower than in first version pressure survey interface capability history pressure survey as a result, then target analysis result be test at Function.If the version is third version, the pressure of third version is surveyed into the corresponding target analysis result of interface capability and the first edition The corresponding history pressure of survey interface capability should be pressed to survey result and the corresponding history pressure survey result of second edition pressure survey interface capability It is compared, obtains target analysis result.For example, if the target pressure of third version response time surveys result and is below first version When surveying result with the history pressure of the second edition, then target analysis result is to be successfully tested ".Alternatively, if the third version response time Target pressure survey result lower than first version history pressure survey as a result, be higher than the second edition history pressure survey result when, then target pressure survey As a result for compared with first version, which surveys interface performance test success, compared with the second edition, which surveys interface performance test Failure.
Further, pressure is surveyed into interface capability with corresponding target analysis result associated storage into relevant database, It carries out the operation such as searching so as to subsequent, is conducive to the acquisition efficiency for improving test report.
In one embodiment, each pressure surveys the corresponding test mark of interface.Wherein, interface configuration one is surveyed to each pressure in advance A unique test mark.
As shown in figure 4, interface is surveyed to the pressure that target analysis result is test crash and carries out out mispointing in step S40, Obtain test crash module, comprising:
S41: surveying interface based on the pressure that target analysis result is test crash, obtains test corresponding with pressure survey interface and marks Know.
Specifically, server-side obtains each pressure and surveys the target analysis of interface capability as a result, according to target analysis as a result, determining Target analysis result is that the pressure of test crash surveys interface, obtains test corresponding with pressure survey interface and identifies, for example, the test identifies Can be TraceId, TraceId should be guaranteed that it is globally unique, time when can be server ip+generation ID+from increasing sequence+ The composition such as current process number.
S42: being based on test mark, when being tested for the property using link tracing tool calling to pressure survey interface, each survey The interface chain information of die trial block, interface chain information include at least one test module.
Wherein, link tracing tool can be the tools such as SOFARPC and zipkin.Link tracing technology mainly collect, Calling event data in storage and analysis distribution formula system assists exploitation operation personnel's progress fault diagnosis, capacity to estimate, property It can bottleneck positioning and calling link combing.
Specifically, server-side by the test mark carry out link trace, can get in test interface with the test mark The interface chain information of sensible corresponding each test module or subsystems leads to when being tested for the property to pressure survey interface Interface chain information is crossed, gets each test module that performance test is accessed, and get the type of each test module With execute the information such as time.It is to be appreciated that one calling process is built into based on test mark using link tracing tool One call-tree (referred to as Tracer), each node in Tracer tree indicate link call in a test module or subsystem System.A request call chain is identified by a globally unique TraceId.Server-side can also be appreciated that by interface chain information The executive condition of each test module, than such as whether running succeeded, whether having carried out retrying and fail and whether surveyed to entire performance Examination impacts.
S43: using positioning tool, carries out out mispointing to the test module of test crash in interface chain information, obtains and survey Examination failure module.
Wherein, positioning tool can be, but be not limited to ELK and Metricbeat tool, pass through ELK and Metricbeat Tool analyzes the interface chain information obtained in step S42, and goes out to the test module or subsystem of test crash Mispointing, ELK are an open source real-time logs analysis platforms, are opened by ElasticSearch, Logstash and Kiabana tri- Source system composition.ElasticSearch is a distributed search engine, and Logstash is used for the unloading system of content, is led to The reading of many types data and the write-in of many types data can be accomplished by crossing flexible plug-in unit, and Kiabana is a data The client of displaying provides the visual search to data in ElasticSearch and shows function.Metricbeat is for uniting Count analysis interface chain information.
Specifically, by test mark get total interface chain information, by Metricbeat to interface chain information into Row statistical analysis, and the data that Metricbeat is counted are shown by Kiabanaa in ELK, determine test crash module.
In step S41-S43, interface is surveyed based on the pressure that target analysis result is test crash, is obtained opposite with pressure survey interface The test mark answered, gets corresponding interface chain information and provides technical support for subsequent identified according to test.It is marked based on test Know, when being tested for the property using link tracing tool calling to pressure survey interface, the interface chain information of each test module, interface Chain information includes at least one test module, realizes quick obtaining to interface chain information, so as to subsequent in interface chain information Each test module is for statistical analysis, quickly positions to test crash module error to realize.Specifically, using positioning work Tool carries out out mispointing, quick obtaining test crash module, compared to artificial to the test module of test crash in interface chain information Positioning analysis is carried out to test crash module, test crash module location efficiency can be improved.
In one embodiment, as shown in figure 5, in step S50, i.e., result, target analysis result and survey are surveyed based on target pressure Examination failure module, obtains test report, specifically comprises the following steps:
S51: it obtains test report and generates request, it includes template identification in request that test report, which generates,.
Wherein, template identification refers to the mark of pre-configured test report template, can be searched by the template identification To corresponding test report template.Specifically, when automatically-monitored tool detects that surveying interface to pressure carries out out mispointing completion Afterwards, it generates test report and generates request, include template identification in test report request, searched so as to subsequent according to template identification To test report template.
S52: database is searched according to template identification, obtains test report template corresponding with template identification, test report Template includes at least one analysis field and corresponding filling region.
Specifically, it is stored with pre-configured test report template in database, contains at least one in test template Analyze field and corresponding filling region.Wherein, the test report template of each version can be identical.Analysis field is reported in test Pre-configured field in slide former can get corresponding field contents by analyzing field.Filling region is for filling out Fill the region of field contents corresponding with analysis field.Server-side searches database, acquisition and template identification by template identification Corresponding test report template generates test report based on test report template so as to subsequent.
S53: obtaining corresponding target pressure according to analysis field and survey result, target analysis result and test crash module, And survey result, target analysis result and test crash module is pressed to be filled in filling region corresponding with analysis field target On, generate test report.
Specifically, survey result, target analysis result and test crash module relation is pressed to be stored in relationship type target in advance In database.Analysis field can be pressure and survey result, analysis result and test crash module, and analysis field can also include service Performance and pressure survey interface capability.Server-side presets each service performance and pressure surveys interface capability, and service performance and pressure are surveyed Interface capability obtains each service performance target pressure corresponding with pressure survey interface capability and surveys result, target as analysis field Analyze result and test crash module, and target pressed survey result, target analysis result and test crash module fill to point The corresponding filling region of field is analysed, test report is generated.
For example, service performance includes CPU, corresponding target pressure is searched by CPU and surveys result " 75% ", target analysis result Target is pressed and surveys result " 75% ", target analysis result " being successfully tested " and survey by " being successfully tested " and test crash module " XX1 " In examination failure module " XX1 " filling to filling region corresponding with analysis field, test report is generated.
In step S51-S53, obtains test report and generate request, test report generates template identification in request and searches data Library obtains test report template corresponding with template identification, and realization gets test report template automatically, to be subsequently generated test It is more convenient to report.Corresponding target pressure, which is obtained, according to analysis field surveys result, target analysis result and test crash module, And survey result, target analysis result and test crash module is pressed to be filled in filling region corresponding with analysis field target On, test report is quickly generated, generation method is simple and quick.
Further, since target analysis result includes test crash and is successfully tested, in test report, to target point Analysis result is that the service performance of test crash and pressure are surveyed interface capability and highlighted.Specifically, each service performance and pressure Surveying the corresponding target analysis result of interface capability can be to be successfully tested, and can also be test crash.According to each service performance and pressure The corresponding target analysis of interface capability is surveyed as a result, surveying interface capability to the service performance and pressure that target analysis result is test crash It is highlighted, for example, carrying out marking the processing such as red overstriking, so that subsequent clients are according to test report, quickly views test The service performance and pressure of failure survey interface capability.
Further, audit interface can be also preset in automatically-monitored tool, server-side is getting test report After reporting to, the test report can be sent to audit interface according to preset audit interface, so that audit interface is corresponding Auditor (or developer) can consult the test report, and decompression surveys situation.It is to be appreciated that careful by presetting Test report can be automatically transmitted to audit interface accordingly, so that auditor can quickly consult corresponding test by kernel interface Report sends without artificial, improves transmitting efficiency.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
In one embodiment, a kind of full-automatic interface pressure survey device is provided, which surveys device and above-mentioned reality Full-automatic interface pressure survey method in example is applied to correspond.As shown in fig. 6, it includes restarting module that the full-automatic interface pressure, which surveys device, 10, result obtains module 20, analysis module 30, error locating module 40 and report generation module 50.Each functional module is specifically It is bright as follows:
Restart module 10, for call it is pre-configured restart script, restart server.
As a result module 20 is obtained, the service performance for calling pre-configured pressure to survey script, to the server restarted Interface capability is surveyed with pressure to be tested for the property, and is obtained target pressure and is surveyed result.
Analysis module 30, for regular using performance evaluation corresponding with service performance and pressure survey interface capability, to mesh Mark pressure is surveyed result and is analyzed, and target analysis result is obtained.
Malfunction locating module 40, carries out out mispointing for surveying interface to the pressure that target analysis result is test crash, obtains Take test crash module.
Report generation module 50, for pressing survey result, target analysis result and test crash module to fill to survey target It tries in report template, obtains test report.
In one embodiment, restart script include it is corresponding with server restart function, restart function include form ginseng Number.It includes that pressure corresponding with each pressure survey interface surveys function that pressure, which surveys script, and it includes formal parameter that pressure, which surveys function,.
Before restarting module 10, full-automatic interface pressure surveys device and further includes script configuring request unit, restarts script and match It sets unit and pressure surveys script configuration unit.
Script configuring request unit, for obtaining script configuring request, script configuring request includes script type.
Restart script configuration unit, if being to restart script for script type, obtains practical ginseng corresponding with server Actual parameter is passed to the formal parameter restarted in function corresponding with server by number, and acquisition is configured to restart script.
Pressure surveys script configuration unit, if being used for script type is that pressure surveys script, obtains corresponding with each pressure survey interface Actual parameter is passed to the formal parameter that pressure corresponding with pressure survey interface is surveyed in function, obtained configured by actual parameter Pressure surveys script.
In one embodiment, as a result obtaining module 20 includes that instruction generation unit 21, file obtaining unit 22 and pressure survey knot Fruit acquiring unit 23.
Instruction generation unit 21, for the starting state using automatically-monitored tool detection service device, when service is thought highly of After the completion of opening, generates pressure and survey sign on.
File obtaining unit 22 calls pre-configured pressure to survey for surveying sign on based on pressure using pressure survey tool Script is surveyed interface capability to the service performance and pressure of the server restarted and is tested for the property, and test result file is obtained.
Pressure surveys result acquiring unit 23, for parsing using analytical tool to test result file, obtains target pressure Survey result.
In one embodiment, as a result obtaining module 20 includes that pressure surveys sign on acquiring unit, test result file obtains Unit and test result file resolution unit.
Pressure surveys sign on acquiring unit, for the starting state using automatically-monitored tool detection service device, works as clothes After the completion of business is thought highly of and opened, generates pressure and survey sign on.
Test result file acquiring unit is called pre-configured for surveying sign on based on pressure using pressure survey tool Pressure survey script interface capability surveyed to the service performance of the server restarted and pressure and be tested for the property, obtain test result text Part.
Test result file resolution unit obtains target for parsing using analytical tool to test result file Pressure surveys result.
In one embodiment, pressure surveys script and includes performance evaluation rule corresponding with service performance and survey interface with pressure It can corresponding performance evaluation rule.
Analysis module 30 includes the first analysis result acquiring unit and the second analysis result acquiring unit.
First analysis result acquiring unit, for based on performance evaluation rule corresponding with service performance, acquisition and clothes Target pressure corresponding with service performance is surveyed result and target desired value carries out pair by the corresponding target desired value of performance of being engaged in Than obtaining target analysis result based on comparing result.
Second analysis result acquiring unit, for obtaining based on performance evaluation rule corresponding with pressure survey interface capability History pressure corresponding with survey interface capability is pressed, which is surveyed as a result, target corresponding with pressure survey interface capability is pressed, surveys result and history Pressure is surveyed result and is compared, and obtains target analysis result based on comparing result.
In one embodiment, each pressure surveys the corresponding test mark of interface.
Error locating module 40 includes that test mark acquiring unit, interface chain information acquiring unit and test crash module obtain Take unit.
Mark acquiring unit is tested, for surveying interface based on the pressure that target analysis result is test crash, obtains and is surveyed with pressure The corresponding test mark of interface.
Interface chain information acquiring unit, for based on test mark, using link tracing tool call to pressure survey interface into When row performance test, the interface chain information of each test module, interface chain information includes at least one test module.
Test crash module acquiring unit, for using positioning tool, to the test mould of test crash in interface chain information Block carries out out mispointing, obtains test crash module.
In one embodiment, report generation module 50 includes request unit, report template acquiring unit and test report Accuse acquiring unit.
Request unit generates request for obtaining test report, and it includes template identification in request that test report, which generates,.
Report template acquiring unit obtains test corresponding with template identification for searching database according to template identification Report template, test report template include at least one analysis field and corresponding filling region.
Test report acquiring unit surveys result, target analysis knot for obtaining corresponding target pressure according to analysis field Fruit and test crash module, and press survey result, target analysis result and test crash module to be filled in and analysis field target In corresponding filling region, test report is generated.
The specific restriction for surveying device is pressed to may refer to press survey method above for full-automatic interface about full-automatic interface Restriction, details are not described herein.Above-mentioned full-automatic interface pressure surveys the modules in device can be fully or partially through software, hard Part and its group and to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, It can also be stored in a software form in the memory in computer equipment, execute the above modules in order to which processor calls Corresponding operation.
In one embodiment, a kind of computer equipment is provided, which can be server-side, internal junction Composition can be as shown in Figure 7.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is for storing test report template etc..The network interface of the computer equipment is used for logical with external terminal Cross network connection communication.To realize a kind of full-automatic interface pressure survey method when the computer program is executed by processor.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory simultaneously The computer program that can be run on a processor, processor realize full-automatic interface in above-described embodiment when executing computer program The step of pressing survey method, for example, step S10 shown in Fig. 2 to step S50.Alternatively, processor is realized when executing computer program Full-automatic interface pressure surveys the function of each module/unit in device in above-described embodiment, for example, module 10 shown in Fig. 6 is to module 50 function.To avoid repeating, details are not described herein again.
In one embodiment, a kind of computer readable storage medium is provided, computer program, computer are stored thereon with Realize that full-automatic interface presses survey method in above method embodiment when program is executed by processor, for example, step shown in Fig. 2 S10 to step S50.Alternatively, the computer program realizes that full-automatic interface pressure surveys dress in above-described embodiment when being executed by processor The function of each module/unit in setting, for example, function of the module 10 shown in Fig. 6 to module 50.It is no longer superfluous herein to avoid repeating It states.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, computer program can be stored in a non-volatile computer and can be read In storage medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the application To any reference of memory, storage, database or other media used in provided each embodiment, may each comprise non- Volatibility and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), Electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include arbitrary access Memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (RambuS) directly RAM (RDRAM), straight Connect memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of device are divided into different functional unit or module, to complete above description All or part of function.
The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to the foregoing embodiments Invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each implementation Technical solution documented by example is modified or equivalent replacement of some of the technical features;And these modification or Replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all include Within protection scope of the present invention.

Claims (10)

1. a kind of full-automatic interface presses survey method characterized by comprising
Call it is pre-configured restart script, restart server;
Pre-configured pressure is called to survey script, the service performance and pressure to the server restarted survey interface capability and carry out performance survey Examination obtains target pressure and surveys result;
Using performance evaluation rule corresponding with the service performance and pressure survey interface capability, the target is pressed and surveys knot Fruit is analyzed, and target analysis result is obtained;
Interface is surveyed to the pressure that the target analysis result is test crash and carries out out mispointing, obtains test crash module;
Survey result, the target analysis result and the test crash module is pressed to fill to corresponding test report the target In template, test report is obtained.
2. interface as described in claim 1 full-automatic presses survey method, which is characterized in that described to restart script and include and the clothes Business device is corresponding to restart function, and described to restart function include formal parameter;It includes surveying with each pressure that the pressure, which surveys script, The corresponding pressure of interface surveys function, and it includes formal parameter that the pressure, which surveys function,;
It is described call it is pre-configured the step of restarting script before, the full-automatic interface presses survey method further include:
Script configuring request is obtained, the script configuring request includes script type;
If the script type is to restart script, actual parameter corresponding with server is obtained;The actual parameter is transmitted The corresponding formal parameter restarted in function of the server is given, acquisition is configured to restart script;
If the script type is that pressure surveys script, actual parameter corresponding with each pressure survey interface is obtained;By the reality Border parameter passes to the formal parameter that pressure corresponding with the pressure survey interface is surveyed in function, obtains configured pressure and surveys script.
3. full-automatic interface as described in claim 1 presses survey method, which is characterized in that described that pre-configured pressure is called to survey Script, service performance and pressure to the server restarted are surveyed interface capability and are tested for the property, and obtain target pressure and survey as a result, packet It includes:
The starting state that the server is detected using automatically-monitored tool generates pressure after the completion of the Server Restart Survey sign on;
Sign on is surveyed based on the pressure, calls pre-configured pressure to survey script using pressure survey tool, to the server restarted Service performance and pressure survey interface capability be tested for the property, obtain test result file;
The test result file is parsed using analytical tool, target pressure is obtained and surveys result.
4. full-automatic interface as described in claim 1 presses survey method, which is characterized in that the pressure surveys script and includes and the clothes The corresponding performance evaluation rule of performance of being engaged in and performance evaluation rule corresponding with pressure survey interface capability;
Using performance evaluation rule corresponding with the service performance and pressure survey interface capability, the target is pressed and surveys knot Fruit is analyzed, and target analysis result is obtained, comprising:
Based on performance evaluation rule corresponding with the service performance, target expectation corresponding with the service performance is obtained Target corresponding with the service performance is pressed survey result and the target desired value to compare, is based on comparing result by value Obtain target analysis result;
Based on performance evaluation rule corresponding with pressure survey interface capability, obtain corresponding with pressure survey interface capability History pressure is surveyed as a result, will survey that interface capability corresponding target pressure surveys result and history pressure survey result carries out pair with the pressure Than obtaining target analysis result based on comparing result.
5. full-automatic interface as described in claim 1 presses survey method, which is characterized in that each pressure is surveyed interface corresponding one and surveyed Test-object is known;
It is described that mispointing is carried out out to the pressure survey interface that the target analysis result is test crash, test crash module is obtained, Include:
Interface is surveyed based on the pressure that the target analysis result is test crash, test corresponding with pressure survey interface is obtained and marks Know;
It is identified based on the test, when being tested for the property using link tracing tool calling to pressure survey interface, each survey The interface chain information of die trial block, the interface chain information include at least one test module;
Using positioning tool, mispointing is carried out out to the test module of test crash in the interface chain information, test is obtained and loses Lose module.
6. full-automatic interface as described in claim 1 presses survey method, which is characterized in that described to survey knot based on target pressure Fruit, the target analysis result and the test crash module obtain test report, comprising:
It obtains test report and generates request, it includes template identification in request that the test report, which generates,;
Database is searched according to the template identification, obtains test report template corresponding with the template identification, the test Report template includes at least one analysis field and corresponding filling region;
The corresponding target pressure, which is obtained, according to the analysis field surveys result, the target analysis result and test mistake Module is lost, and presses survey result, the target analysis result and the test crash module to be filled in and described point the target It analyses in the corresponding filling region of field, generates test report.
7. a kind of full-automatic interface pressure surveys device characterized by comprising
Restart module, for call it is pre-configured restart script, restart server;
As a result module is obtained, for calling pre-configured pressure to survey script, service performance and pressure to the server restarted are surveyed Interface capability is tested for the property, and is obtained target pressure and is surveyed result;
Analysis module is right for regular using performance evaluation corresponding with the service performance and pressure survey interface capability The target pressure is surveyed result and is analyzed, and target analysis result is obtained;
Malfunction locating module, carries out out mispointing for surveying interface to the pressure that the target analysis result is test crash, obtains Test crash module;
Report generation module, for pressing survey result, the target analysis result and the test crash module to fill out the target It is charged in corresponding test report template, obtains test report.
8. full-automatic interface pressure as claimed in claim 7 surveys device, which is characterized in that the test module, comprising:
Instruction generation unit, for detecting the starting state of the server using automatically-monitored tool, when the server After the completion of restarting, generates pressure and survey sign on;
File obtaining unit calls pre-configured pressure to survey foot for surveying sign on based on the pressure using pressure survey tool This is surveyed interface capability to the service performance and pressure of the server restarted and is tested for the property, and test result file is obtained;
Pressure surveys result acquiring unit, for being parsed using analytical tool to the test result file, obtains target pressure and surveys As a result.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 6 full-automatic interface pressure survey method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In realization full-automatic interface as described in any one of claim 1 to 6 presses survey method when the computer program is executed by processor The step of.
CN201811208301.8A 2018-10-17 2018-10-17 Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium Pending CN109491891A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811208301.8A CN109491891A (en) 2018-10-17 2018-10-17 Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811208301.8A CN109491891A (en) 2018-10-17 2018-10-17 Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109491891A true CN109491891A (en) 2019-03-19

Family

ID=65691360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811208301.8A Pending CN109491891A (en) 2018-10-17 2018-10-17 Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109491891A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083540A (en) * 2019-04-29 2019-08-02 北京口袋时尚科技有限公司 Interface test method and device
CN110532168A (en) * 2019-07-05 2019-12-03 中国平安财产保险股份有限公司 Full LI(link interface) pressure surveys method, apparatus, computer equipment and storage medium
CN110704312A (en) * 2019-09-25 2020-01-17 浙江大搜车软件技术有限公司 Pressure testing method and device, computer equipment and storage medium
CN110798445A (en) * 2019-09-12 2020-02-14 中国平安财产保险股份有限公司 Public gateway interface testing method and device, computer equipment and storage medium
CN110807043A (en) * 2019-10-28 2020-02-18 中冶赛迪重庆信息技术有限公司 Diagnostic report generation method, system, device and medium
CN111190827A (en) * 2019-12-30 2020-05-22 航天信息股份有限公司 Interface automation test method and device, storage medium and electronic equipment
CN111338956A (en) * 2020-02-27 2020-06-26 广州市百果园信息技术有限公司 Automatic pressure measurement method, device, equipment and storage medium
CN111382075A (en) * 2020-03-10 2020-07-07 北京同邦卓益科技有限公司 Data processing method and device for automatic test
CN111858304A (en) * 2020-06-10 2020-10-30 南京领行科技股份有限公司 Interface performance test method and device
CN112491622A (en) * 2020-11-30 2021-03-12 苏宁金融科技(南京)有限公司 Method and system for positioning fault root cause of business system
CN112835792A (en) * 2021-01-27 2021-05-25 湖南快乐阳光互动娱乐传媒有限公司 Pressure testing system and method
CN113220586A (en) * 2021-05-31 2021-08-06 五八到家有限公司 Automatic interface pressure test execution method, device and system
CN113392000A (en) * 2021-06-10 2021-09-14 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN113778847A (en) * 2020-12-03 2021-12-10 北京沃东天骏信息技术有限公司 Test report generation method and device
CN114968829A (en) * 2022-08-02 2022-08-30 平安银行股份有限公司 Full link pressure test method, electronic device and storage medium

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083540A (en) * 2019-04-29 2019-08-02 北京口袋时尚科技有限公司 Interface test method and device
CN110083540B (en) * 2019-04-29 2023-04-28 北京口袋时尚科技有限公司 Interface testing method and device
CN110532168A (en) * 2019-07-05 2019-12-03 中国平安财产保险股份有限公司 Full LI(link interface) pressure surveys method, apparatus, computer equipment and storage medium
CN110532168B (en) * 2019-07-05 2024-03-29 中国平安财产保险股份有限公司 Full-link interface pressure measurement method and device, computer equipment and storage medium
CN110798445B (en) * 2019-09-12 2022-06-10 中国平安财产保险股份有限公司 Public gateway interface testing method and device, computer equipment and storage medium
CN110798445A (en) * 2019-09-12 2020-02-14 中国平安财产保险股份有限公司 Public gateway interface testing method and device, computer equipment and storage medium
CN110704312A (en) * 2019-09-25 2020-01-17 浙江大搜车软件技术有限公司 Pressure testing method and device, computer equipment and storage medium
CN110704312B (en) * 2019-09-25 2023-09-12 浙江大搜车软件技术有限公司 Method, device, computer equipment and storage medium for pressure test
CN110807043A (en) * 2019-10-28 2020-02-18 中冶赛迪重庆信息技术有限公司 Diagnostic report generation method, system, device and medium
CN111190827A (en) * 2019-12-30 2020-05-22 航天信息股份有限公司 Interface automation test method and device, storage medium and electronic equipment
CN111338956A (en) * 2020-02-27 2020-06-26 广州市百果园信息技术有限公司 Automatic pressure measurement method, device, equipment and storage medium
CN111382075B (en) * 2020-03-10 2023-09-26 北京同邦卓益科技有限公司 Automatic test data processing method and device
CN111382075A (en) * 2020-03-10 2020-07-07 北京同邦卓益科技有限公司 Data processing method and device for automatic test
CN111858304A (en) * 2020-06-10 2020-10-30 南京领行科技股份有限公司 Interface performance test method and device
CN111858304B (en) * 2020-06-10 2022-06-07 南京领行科技股份有限公司 Interface performance test method and device
CN112491622A (en) * 2020-11-30 2021-03-12 苏宁金融科技(南京)有限公司 Method and system for positioning fault root cause of business system
CN113778847A (en) * 2020-12-03 2021-12-10 北京沃东天骏信息技术有限公司 Test report generation method and device
CN112835792B (en) * 2021-01-27 2023-03-03 湖南快乐阳光互动娱乐传媒有限公司 Pressure testing system and method
CN112835792A (en) * 2021-01-27 2021-05-25 湖南快乐阳光互动娱乐传媒有限公司 Pressure testing system and method
CN113220586A (en) * 2021-05-31 2021-08-06 五八到家有限公司 Automatic interface pressure test execution method, device and system
CN113392000A (en) * 2021-06-10 2021-09-14 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN113392000B (en) * 2021-06-10 2024-01-30 卫宁健康科技集团股份有限公司 Test case execution result analysis method, device, equipment and storage medium
CN114968829A (en) * 2022-08-02 2022-08-30 平安银行股份有限公司 Full link pressure test method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN109491891A (en) Full-automatic interface pressure surveys method, apparatus, computer equipment and storage medium
CN109302522B (en) Test method, test device, computer system, and computer medium
CN110399293B (en) System test method, device, computer equipment and storage medium
US8701092B1 (en) System and method for testing applications
CN107688530B (en) Software testing method and device
US7890814B2 (en) Software error report analysis
CN108509344B (en) Daily cutting batch test method, equipment and readable storage medium
CN109766263A (en) Automatic test analysis and processing method, device, computer equipment and storage medium
WO2021218178A1 (en) Automatic report generation method, device, computer apparatus, and storage medium
CN109683982B (en) MES system control method, MES system control device, computer equipment, and storage medium
CN109766261B (en) Coverage test method, coverage test device, computer equipment and storage medium
CN111897727A (en) Software testing method and device, computer equipment and storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
US9213543B2 (en) Software internationalization estimation model
CN111797026A (en) Test case generation method and device, computer equipment and storage medium
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN113900962B (en) Code difference detection method and device
CN111667231A (en) Automatic tax declaring method, device, system, computer equipment and storage medium
CN110597710A (en) Test coverage rate statistical method and device, computer equipment and storage medium
CN115248782B (en) Automatic testing method and device and computer equipment
CN116383025A (en) Performance test method, device, equipment and medium based on Jmeter
CN110515829A (en) Application testing method, device, equipment and computer readable storage medium
CN115599683A (en) Automatic testing method, device, equipment and storage medium
CN116932360A (en) Page testing method and device, computer 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