CN112000582A - Server-side automatic test early warning method, device, equipment and storage medium - Google Patents

Server-side automatic test early warning method, device, equipment and storage medium Download PDF

Info

Publication number
CN112000582A
CN112000582A CN202010902741.4A CN202010902741A CN112000582A CN 112000582 A CN112000582 A CN 112000582A CN 202010902741 A CN202010902741 A CN 202010902741A CN 112000582 A CN112000582 A CN 112000582A
Authority
CN
China
Prior art keywords
test
information
server
early warning
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010902741.4A
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.)
Shenzhen Qihu Intelligent Technology Co ltd
Original Assignee
Shenzhen Qihu Intelligent 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 Shenzhen Qihu Intelligent Technology Co ltd filed Critical Shenzhen Qihu Intelligent Technology Co ltd
Priority to CN202010902741.4A priority Critical patent/CN112000582A/en
Publication of CN112000582A publication Critical patent/CN112000582A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a server automatic test early warning method, a device, equipment and a storage medium, wherein the method comprises the following steps: when test information is received, determining a target server and target test parameters according to the test information; searching a test script corresponding to the target test parameter; performing performance monitoring on the target server based on the test script to obtain performance monitoring information; determining performance parameters of the target server according to the performance monitoring information; counting the return time of each interface in the test script, and counting the error frequency of the test script; and carrying out early warning according to the performance parameters, the return time and the error frequency. The test script is searched according to the target test parameters, performance monitoring is carried out according to the test script to obtain the performance parameters, the return time of each interface in the test script and the error frequency of the test script are counted, early warning is carried out according to the multiple information, the condition of incomplete test is avoided, and the effect of carrying out test early warning on the server side is improved.

Description

Server-side automatic test early warning method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a server automatic test early warning method, device, equipment and storage medium.
Background
At present, in the process of testing a server, the problem that an interface is unstable exists, and the problem can occur all the time. The problem of server instability also exists, and the server is unstable and needs to be warned before the server goes wrong. Moreover, there are problems of developer error or code quality to be detected, and the code quality and deployment of the developer need to be detected. And there is an interface return error problem for different time periods. Therefore, in the case of the above problems, the effect of performing test and early warning on the server is poor, and a satisfactory effect cannot be achieved.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for automatic test early warning of a server, and aims to solve the technical problem that the effect of test early warning on the server in the prior art is poor.
In order to achieve the above object, the present invention provides a server automated testing and early warning method, which comprises the following steps:
when test information is received, determining a target server and target test parameters according to the test information;
searching a test script corresponding to the target test parameter;
performing performance monitoring on the target server based on the test script to obtain performance monitoring information;
determining the performance parameters of the target server according to the performance monitoring information;
counting the return time of each interface in the test script, and counting the error frequency of the test script;
and carrying out early warning according to the performance parameters, the return time and the error frequency.
Optionally, before performing performance monitoring on the target server based on the test script to obtain performance monitoring information, the method further includes:
extracting script execution information from the test information;
correspondingly, the performance monitoring is performed on the target server based on the test script to obtain performance monitoring information, including:
and performing performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
Optionally, the performing performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information includes:
determining a script execution strategy according to the script execution information;
and performing performance monitoring on the target server based on the script execution strategy and the test script to obtain performance monitoring information.
Optionally, the performing performance monitoring on the target server based on the script execution policy and the test script to obtain performance monitoring information includes:
determining a test interface corresponding to the test script according to the script execution strategy, and determining a test frequency according to the script execution strategy;
monitoring the performance of the target server according to the test frequency and the test script;
and acquiring performance monitoring information corresponding to the target server through the test interface.
Optionally, the obtaining, by the test interface, performance monitoring information corresponding to the target server includes:
acquiring information to be processed through the test interface, and performing assertion verification on the information to be processed;
and when the assertion passes the verification, determining the performance monitoring information corresponding to the target server according to the information to be processed.
Optionally, the obtaining information to be processed through the test interface and performing assertion verification on the information to be processed includes:
obtaining information to be processed through the test interface, and searching an assertion rule corresponding to the target test parameter;
and performing assertion verification on the information to be processed according to the assertion rule.
Optionally, when the assertion check passes, determining, according to the to-be-processed information, performance monitoring information corresponding to the target server, including:
when the assertion verification passes, acquiring the current response time of the test interface, and searching assertion duration time corresponding to the test interface;
determining an expected response time from the assertion duration, comparing the current response time to the expected response time;
and when the current response time is consistent with the expected response time, determining performance monitoring information corresponding to the target server according to the information to be processed.
Optionally, the searching for the test script corresponding to the target test parameter includes:
matching the target test parameter with a test parameter to be selected in a preset mapping table, wherein the preset mapping table comprises: test parameters to be selected and test scripts to be selected;
and determining a test script corresponding to the target test parameter according to the matching result.
Optionally, the performing early warning according to the performance parameter, the return time, and the error frequency includes:
generating a performance parameter statistical curve graph according to the performance parameters, and generating a return time statistical curve graph according to the return time;
and carrying out early warning according to the performance parameter statistical graph, the return time statistical graph and the error frequency.
Optionally, the performing early warning according to the performance parameter statistical graph, the return time statistical graph, and the error frequency includes:
detecting the performance parameter statistical curve graph to obtain a performance parameter detection result;
detecting the return time statistical curve graph to obtain a return time detection result;
comparing the error frequency with a preset frequency to obtain a frequency comparison result;
and carrying out early warning according to the performance parameter detection result, the return time detection result and the frequency comparison result.
Optionally, the performing early warning according to the performance parameter detection result, the return time detection result, and the frequency comparison result includes:
judging whether the target server side is abnormal or not according to the performance parameter detection result, the return time detection result and the frequency comparison result;
when the target server side is abnormal, generating abnormal prompt information;
and carrying out early warning according to the abnormal prompt information.
Optionally, when there is an abnormality in the target server, generating an abnormality prompt message includes:
when the target server side is abnormal, determining the reason of the abnormality according to the performance parameter detection result, the return time detection result and the frequency comparison result;
and generating abnormal prompt information according to the abnormal reason.
Optionally, the performing early warning according to the abnormal prompt information includes:
searching a target mailbox address corresponding to the target mailbox;
and sending the abnormal prompt information to the target mailbox for early warning according to the target mailbox address.
In addition, in order to achieve the above object, the present invention further provides an automatic testing and early warning device for a server, where the automatic testing and early warning device for a server includes:
the test information module is used for determining a target server and target test parameters according to the test information when the test information is received;
the test script module is used for searching a test script corresponding to the target test parameter;
the performance monitoring module is used for monitoring the performance of the target server based on the test script so as to obtain performance monitoring information;
the performance parameter module is used for determining the performance parameters of the target server according to the performance monitoring information;
the data statistics module is used for counting the return time of each interface in the test script and counting the error frequency of the test script;
and the test early warning module is used for carrying out early warning according to the performance parameters, the return time and the error frequency.
Optionally, the test script module is further configured to extract script execution information from the test information;
the performance monitoring module is further configured to perform performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
Optionally, the performance monitoring module is further configured to determine a script execution policy according to the script execution information; and performing performance monitoring on the target server based on the script execution strategy and the test script to obtain performance monitoring information.
Optionally, the performance monitoring module is further configured to determine a test interface corresponding to the test script according to the script execution policy, and determine a test frequency according to the script execution policy; monitoring the performance of the target server according to the test frequency and the test script; and acquiring performance monitoring information corresponding to the target server through the test interface.
In addition, in order to achieve the above object, the present invention further provides a server automated testing and early warning device, where the server automated testing and early warning device includes: the system comprises a memory, a processor and a server-side automatic testing and early warning program which is stored on the memory and can run on the processor, wherein the server-side automatic testing and early warning program is configured with steps for realizing the server-side automatic testing and early warning method.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where the storage medium stores a server automated testing and warning program, and the server automated testing and warning program, when executed by a processor, implements the steps of the server automated testing and warning method described above.
The automatic test early warning method for the server side, provided by the invention, comprises the steps of determining a target server side and target test parameters according to test information when the test information is received; searching a test script corresponding to the target test parameter; performing performance monitoring on the target server based on the test script to obtain performance monitoring information; determining the performance parameters of the target server according to the performance monitoring information; counting the return time of each interface in the test script, and counting the error frequency of the test script; and carrying out early warning according to the performance parameters, the return time and the error frequency. The target server and the target test parameters are determined through the test information, the test script is further searched, performance monitoring is carried out according to the test script to obtain the performance parameters, the return time of each interface in the test script and the error frequency of the test script are counted, early warning is carried out according to the multiple information, the condition of incomplete test is avoided, and the effect of carrying out test early warning on the server is improved.
Drawings
Fig. 1 is a schematic structural diagram of a server-side automated testing and early warning device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a server-side automated testing and early warning method according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a server-side automated testing and early warning method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a server-side automated testing and early warning method according to the present invention;
FIG. 5 is a display diagram of an automated script monitoring interface according to an embodiment of the method for early warning of automated testing at a server;
fig. 6 is a functional module diagram of a server-side automated testing and early warning apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a server-side automated testing and early warning device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the server-side automated testing and early warning device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may comprise a Display screen (Display), an input unit such as keys, and the optional user interface 1003 may also comprise a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a non-volatile Memory (e.g., a magnetic disk Memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the device configuration shown in fig. 1 does not constitute a limitation of the server-side automated test and pre-warning device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a server-side automated test pre-warning program.
In the server-side automated testing and early warning device shown in fig. 1, the network interface 1004 is mainly used for connecting an external network and performing data communication with other network devices; the user interface 1003 is mainly used for connecting to a user equipment and performing data communication with the user equipment; the device calls a server automatic test early warning program stored in the memory 1005 through the processor 1001, and executes the server automatic test early warning method provided by the embodiment of the invention.
Based on the hardware structure, the embodiment of the automatic test early warning method for the server side is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a server automated testing and early warning method according to the present invention.
In a first embodiment, the server-side automated testing and early warning method includes the following steps:
and step S10, when the test information is received, determining the target server and the target test parameters according to the test information.
It should be noted that the execution main body in this embodiment may be a server-side automated testing and early warning device, and may also be other devices that can implement the same or similar functions. The automatic test early warning device can be a computer device.
It should be understood that the test information may be input by the user when the test is needed, or may be set in advance, and automatically triggered when a certain condition is reached. For example, the user may input test information in advance, set triggering after 5 minutes, and the server automated test early warning device may receive the test information after 5 minutes, and may also be in another manner, which is not limited in this embodiment.
It will be appreciated that upon receiving the test information, the target server and the target test parameters may be determined based on the test information. The target server is a server that needs to be tested, the target test parameter is a parameter that needs to be tested, and may also be other parameter data, for example, CPU occupancy data of the server, memory occupancy data of the server, network transmission rate data of the server, CPU temperature data of the server, hard disk occupancy data of the server, and the like.
And step S20, searching a test script corresponding to the target test parameter.
It should be understood that the test script in this embodiment includes a variety of scripts, such as a Shell script, a python script, and the like, and this embodiment does not limit this. Each test parameter has a corresponding test script, and after the target test parameter is determined, the test script corresponding to the target test parameter can be searched.
Further, in order to improve the searching efficiency and accuracy of searching the test script, the step S20 includes:
matching the target test parameter with a test parameter to be selected in a preset mapping table, wherein the preset mapping table comprises: test parameters to be selected and test scripts to be selected; and determining a test script corresponding to the target test parameter according to the matching result.
It should be understood that the test parameters to be selected and the test scripts to be selected may be preset, and there is a corresponding relationship between the test parameters to be selected and the test scripts to be selected, for example, the test parameters to be selected a correspond to the test scripts to be selected a, the test parameters to be selected B correspond to the test scripts to be selected B, the test parameters to be selected C correspond to the test scripts to be selected C, and a preset mapping table is established according to the corresponding relationship between the test parameters to be selected and the test scripts to be selected.
It can be understood that the target test parameters may be matched with the test parameters to be selected in the preset mapping table, and the test script corresponding to the target test parameters may be determined according to the matching result. For example, when the target test parameter is matched with the test parameter a to be selected, the test script to be selected corresponding to the test parameter a to be selected is taken as the test script corresponding to the target test parameter.
And step S30, performing performance monitoring on the target server based on the test script to obtain performance monitoring information.
It should be appreciated that after determining the target server and the test script, performance monitoring may be performed on the target server based on the test script to obtain performance monitoring information.
Step S40, determining the performance parameter of the target server according to the performance monitoring information.
It should be appreciated that after obtaining the performance monitoring information, performance parameters of the target server may be determined according to the performance monitoring information.
And step S50, counting the return time of each interface in the test script, and counting the error frequency of the test script.
It can be understood that, while detecting the performance parameter of the target server, the return time of each interface in the test script can be counted, and the error frequency of the test script can be counted.
And step S60, carrying out early warning according to the performance parameters, the return time and the error frequency.
It should be understood that after the performance parameters, the return time and the error frequency are determined, early warning can be performed according to the performance parameters, the return time and the error frequency, and under the condition that at least one of the parameters is abnormal, early warning can be performed, the reason of the abnormality can be prompted, and the effect of performing test early warning on the service end is improved.
It can be understood that the early warning mode can be directly showing the early warning prompt information and the test result, and can also be sending the early warning prompt information and the test result to related personnel through mails, so as to achieve the purpose of monitoring and early warning the server.
In the embodiment, when the test information is received, the target server and the target test parameters are determined according to the test information; searching a test script corresponding to the target test parameter; performing performance monitoring on the target server based on the test script to obtain performance monitoring information; determining performance parameters of the target server according to the performance monitoring information; counting the return time of each interface in the test script, and counting the error frequency of the test script; and carrying out early warning according to the performance parameters, the return time and the error frequency. The test script is searched according to the target test parameters, performance monitoring is carried out according to the test script to obtain the performance parameters, the return time of each interface in the test script and the error frequency of the test script are counted, early warning is carried out according to the multiple information, the condition of incomplete test is avoided, and the effect of carrying out test early warning on the server side is improved.
In an embodiment, as shown in fig. 3, a second embodiment of the server-side automated testing and warning method according to the present invention is provided based on the first embodiment, where before the step S30, the method further includes:
and step S01, extracting script execution information from the test information.
It should be understood that the test information may further include script execution information, and after obtaining the test information, the script execution information may be extracted from the test information.
Accordingly, the step S30 includes:
step S301, performing performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
It should be understood that after determining the test script and the script execution information, the target server may be performance monitored based on the script execution information and the test script to obtain performance monitoring information.
Further, in order to better monitor the target server and achieve a better monitoring effect, the step S301 includes:
determining a script execution strategy according to the script execution information; determining a test interface corresponding to the test script according to the script execution strategy, and determining a test frequency according to the script execution strategy; monitoring the performance of the target server according to the test frequency and the test script; and acquiring performance monitoring information corresponding to the target server through the test interface.
It should be understood that the script execution strategy can be determined according to the script execution information, the test interface corresponding to the test script can be determined according to the script execution strategy, and the test frequency can be determined according to the script execution strategy. Wherein, the test frequency can be: the present embodiment is not limited to this, and the test frequency may be multiple test frequencies, such as daily execution, hourly execution, random execution, timed execution, concurrent execution of multiple test sets, and the like.
It can be understood that the performance of the target server can be monitored according to the test frequency and the test script, and the performance monitoring information corresponding to the target server can be obtained through the test interface.
Further, in order to verify data in the monitoring process to improve the accuracy of performance monitoring information, the obtaining of the performance monitoring information corresponding to the target server through the test interface includes:
obtaining information to be processed through the test interface, and searching an assertion rule corresponding to the target test parameter; performing assertion verification on the information to be processed according to the assertion rule; when the assertion verification passes, acquiring the current response time of the test interface, and searching assertion duration time corresponding to the test interface; determining an expected response time from the assertion duration, comparing the current response time to the expected response time; and when the current response time is consistent with the expected response time, determining performance monitoring information corresponding to the target server according to the information to be processed.
It should be understood that the interface monitoring use case can be written by using a jmeter script, and the design of the use case can be various, for example, setting response assertion and judging whether to accord with an expected result; setting the benshell assertion, and writing codes to judge whether the two results are consistent or whether the two results are in accordance with an expected result; setting assertion duration, and judging whether the corresponding time of the interface meets the expected response time; other assertions are also possible, such as json assertions, and the like, and the present embodiment is not limited in this respect.
In this embodiment, the information to be processed may be obtained through the test interface, the assertion rule corresponding to the target test parameter is searched, and the assertion verification is performed on the information to be processed according to the assertion rule, so as to determine whether the target test parameter meets an expected result. When the assertion verification is passed, acquiring the current response time of the test interface, searching the assertion duration corresponding to the test interface, determining the expected response time according to the assertion duration, comparing the current response time with the expected response time to judge whether the response time of the interface accords with the expected response time, and when the current response time is consistent with the preset response time, namely the response time of the interface accords with the expected response time, determining the performance monitoring information corresponding to the target server according to the information to be processed. Specifically, the performance monitoring information related to the target test parameter may be extracted from the information to be processed.
In this embodiment, the performance monitoring information is obtained by extracting script execution information from the test information and performing performance monitoring on the target server based on the script execution information and the test script. Therefore, data in the monitoring process are verified, the accuracy of performance monitoring information is improved, and a better monitoring effect is achieved.
In an embodiment, as shown in fig. 4, a third embodiment of the method for automatic testing and warning at a server according to the present invention is proposed based on the first embodiment or the second embodiment, in this embodiment, based on the first embodiment, the step S60 includes:
step S601, generating a performance parameter statistical graph according to the performance parameters, and generating a return time statistical graph according to the return time.
It should be appreciated that a performance parameter statistics plot may be generated from the performance parameter and a return time statistics plot may be generated from the return time. For example, server performance parameters may be counted, such as: and generating a performance parameter statistical curve graph by using the CPU occupancy rate, the memory occupancy rate, the IO condition, the network rate and the like. The return time of each interface in the script can be counted, and a return time statistical graph is generated.
And step S602, early warning is carried out according to the performance parameter statistical graph, the return time statistical graph and the error frequency.
It should be appreciated that the frequency of script errors may be counted. For example, the number of occurrences in the last day, the number of occurrences in the last two days, the number of occurrences in the last month, the historical total number of occurrences, etc. may be specifically shown in fig. 5, where fig. 5 is a display diagram of an automated script monitoring interface.
After a performance parameter statistical graph and a return time statistical graph are generated and the field frequency is determined, early warning can be performed according to the performance parameter statistical graph, the return time statistical graph and the error frequency.
Further, in order to improve the accuracy of the early warning, the step S602 includes:
detecting the performance parameter statistical curve graph to obtain a performance parameter detection result; detecting the return time statistical curve graph to obtain a return time detection result; comparing the error frequency with a preset frequency to obtain a frequency comparison result; and carrying out early warning according to the performance parameter detection result, the return time detection result and the frequency comparison result.
It should be understood that the performance parameter statistical graph may be detected to obtain a performance parameter detection result, the return time statistical graph may be detected to obtain a return time detection result, and the error frequency may be compared with a preset frequency to obtain a frequency comparison result, where the preset frequency may be set according to an actual situation, and this embodiment is not limited thereto.
It can be understood that the pre-warning can be performed according to the performance parameter detection result, the return time detection result and the frequency comparison result.
Further, for more convenient early warning, the early warning according to the performance parameter detection result, the return time detection result, and the frequency comparison result includes:
judging whether the target server side is abnormal or not according to the performance parameter detection result, the return time detection result and the frequency comparison result; when the target server side is abnormal, determining the reason of the abnormality according to the performance parameter detection result, the return time detection result and the frequency comparison result; generating an abnormal prompt message according to the abnormal reason, and searching a target mailbox address corresponding to a target mailbox; and sending the abnormal prompt information to the target mailbox for early warning according to the target mailbox address.
It should be understood that whether the target server is abnormal or not may be determined according to the performance parameter detection result, the return time detection result, and the frequency comparison result, and when the target server is abnormal, the cause of the abnormality may be determined according to the performance parameter detection result, the return time detection result, and the frequency comparison result.
And generating abnormal prompt information according to the abnormal reason, and searching a target mailbox address corresponding to the target mailbox to send the abnormal prompt information to the target mailbox for early warning.
Through the technical scheme of the embodiment, the monitoring result can be sent to related personnel through the mail, so that the purpose of detecting the server side is achieved. And a time curve can be returned through the interface, the abnormity of the server interface is warned, and the warned abnormal condition is sent to related personnel through a mail, so that the server is prevented from causing serious consequences in the follow-up process. The server performance curve can be used for early warning the abnormity of the server and sending the abnormity to related personnel through mails, so that the server is prevented from causing serious consequences subsequently. The seedling with the problem can be found in time as long as the server side has the seedling head with the problem. The regression test of the interface can be easily completed. The BUG with unstable interface can be timely discovered. Unstable BUG of the server can be found in time. The code quality of the developer can be monitored. Whether the deployment of the server-side program is complete or not can be monitored. And may be continuously monitored without time intervals.
According to the embodiment, a performance parameter statistical graph is generated according to the performance parameters, and a return time statistical graph is generated according to the return time; and early warning is carried out according to the performance parameter statistical curve graph, the return time statistical curve graph and the error frequency, so that the accuracy of early warning is improved.
In addition, an embodiment of the present invention further provides a storage medium, where a server automated testing and early warning program is stored on the storage medium, and when the server automated testing and early warning program is executed by a processor, the steps of the server automated testing and early warning method described above are implemented.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
In addition, referring to fig. 6, an embodiment of the present invention further provides a server automated testing and early warning apparatus, where the server automated testing and early warning apparatus includes:
and the test information module 10 is configured to determine a target server and target test parameters according to the test information when the test information is received.
It should be understood that the test information may be input by the user when the test is needed, or may be set in advance, and automatically triggered when a certain condition is reached. For example, the user may input test information in advance, set triggering after 5 minutes, and the server automated test early warning device may receive the test information after 5 minutes, and may also be in another manner, which is not limited in this embodiment.
It will be appreciated that upon receiving the test information, the target server and the target test parameters may be determined based on the test information. The target server is a server that needs to be tested, the target test parameter is a parameter that needs to be tested, and may also be other parameter data, for example, CPU occupancy data of the server, memory occupancy data of the server, network transmission rate data of the server, CPU temperature data of the server, hard disk occupancy data of the server, and the like.
And the test script module 20 is configured to search for a test script corresponding to the target test parameter.
It should be understood that the test script in this embodiment includes a variety of scripts, such as a Shell script, a python script, and the like, and this embodiment does not limit this. Each test parameter has a corresponding test script, and after the target test parameter is determined, the test script corresponding to the target test parameter can be searched.
Further, in order to improve the searching efficiency and accuracy of searching the test script, the step S20 includes:
matching the target test parameter with a test parameter to be selected in a preset mapping table, wherein the preset mapping table comprises: test parameters to be selected and test scripts to be selected; and determining a test script corresponding to the target test parameter according to the matching result.
It should be understood that the test parameters to be selected and the test scripts to be selected may be preset, and there is a corresponding relationship between the test parameters to be selected and the test scripts to be selected, for example, the test parameters to be selected a correspond to the test scripts to be selected a, the test parameters to be selected B correspond to the test scripts to be selected B, the test parameters to be selected C correspond to the test scripts to be selected C, and a preset mapping table is established according to the corresponding relationship between the test parameters to be selected and the test scripts to be selected.
It can be understood that the target test parameters may be matched with the test parameters to be selected in the preset mapping table, and the test script corresponding to the target test parameters may be determined according to the matching result. For example, when the target test parameter is matched with the test parameter a to be selected, the test script to be selected corresponding to the test parameter a to be selected is taken as the test script corresponding to the target test parameter.
And the performance monitoring module 30 is configured to perform performance monitoring on the target server based on the test script to obtain performance monitoring information.
It should be appreciated that after determining the target server and the test script, performance monitoring may be performed on the target server based on the test script to obtain performance monitoring information.
And the performance parameter module 40 is configured to determine a performance parameter of the target server according to the performance monitoring information.
It should be appreciated that after obtaining the performance monitoring information, performance parameters of the target server may be determined according to the performance monitoring information.
And the data counting module 50 is used for counting the return time of each interface in the test script and counting the error frequency of the test script.
It can be understood that, while detecting the performance parameter of the target server, the return time of each interface in the test script can be counted, and the error frequency of the test script can be counted.
And a test early warning module 60, configured to perform early warning according to the performance parameter, the return time, and the error frequency.
It should be understood that after the performance parameters, the return time and the error frequency are determined, early warning can be performed according to the performance parameters, the return time and the error frequency, and under the condition that at least one of the parameters is abnormal, early warning can be performed, the reason of the abnormality can be prompted, and the effect of performing test early warning on the service end is improved.
It can be understood that the early warning mode can be directly showing the early warning prompt information and the test result, and can also be sending the early warning prompt information and the test result to related personnel through mails, so as to achieve the purpose of monitoring and early warning the server.
In the embodiment, when the test information is received, the target server and the target test parameters are determined according to the test information; searching a test script corresponding to the target test parameter; performing performance monitoring on the target server based on the test script to obtain performance monitoring information; determining performance parameters of the target server according to the performance monitoring information; counting the return time of each interface in the test script, and counting the error frequency of the test script; and carrying out early warning according to the performance parameters, the return time and the error frequency. The test script is searched according to the target test parameters, performance monitoring is carried out according to the test script to obtain the performance parameters, the return time of each interface in the test script and the error frequency of the test script are counted, early warning is carried out according to the multiple information, the condition of incomplete test is avoided, and the effect of carrying out test early warning on the server side is improved.
In an embodiment, the performance monitoring module 30 is further configured to obtain information to be processed through the test interface, and search for an assertion rule corresponding to the target test parameter; and performing assertion verification on the information to be processed according to the assertion rule.
In an embodiment, the performance monitoring module 30 is further configured to, when the assertion check passes, obtain current response time of the test interface, and search for assertion duration corresponding to the test interface; determining an expected response time from the assertion duration, comparing the current response time to the expected response time; and when the current response time is consistent with the expected response time, determining performance monitoring information corresponding to the target server according to the information to be processed.
In an embodiment, the test script module 20 is further configured to match the target test parameter with a test parameter to be selected in a preset mapping table, where the preset mapping table includes: test parameters to be selected and test scripts to be selected; and determining a test script corresponding to the target test parameter according to the matching result.
In an embodiment, the test early warning module 60 is further configured to generate a performance parameter statistical graph according to the performance parameter, and generate a return time statistical graph according to the return time; and carrying out early warning according to the performance parameter statistical graph, the return time statistical graph and the error frequency.
In an embodiment, the test early warning module 60 is further configured to detect the performance parameter statistical graph to obtain a performance parameter detection result; detecting the return time statistical curve graph to obtain a return time detection result; comparing the error frequency with a preset frequency to obtain a frequency comparison result; and carrying out early warning according to the performance parameter detection result, the return time detection result and the frequency comparison result.
In an embodiment, the test early warning module 60 is further configured to determine whether the target server is abnormal according to the performance parameter detection result, the return time detection result, and the frequency comparison result; when the target server side is abnormal, generating abnormal prompt information; and carrying out early warning according to the abnormal prompt information.
In an embodiment, the test early warning module 60 is further configured to determine, when the target server is abnormal, an abnormal reason according to the performance parameter detection result, the return time detection result, and the frequency comparison result; and generating abnormal prompt information according to the abnormal reason.
In an embodiment, the test early warning module 60 is further configured to search for a target mailbox address corresponding to a target mailbox; and sending the abnormal prompt information to the target mailbox for early warning according to the target mailbox address.
Other embodiments or specific implementation methods of the server automatic test early warning apparatus according to the present invention may refer to the above embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) readable by an estimator, and includes instructions for enabling an intelligent device (e.g. a mobile phone, an estimator, a server-side automatic testing and warning device, an air conditioner, or a network server-side automatic testing and warning device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
The invention discloses A1 and a server automatic test early warning method, which comprises the following steps:
when test information is received, determining a target server and target test parameters according to the test information;
searching a test script corresponding to the target test parameter;
performing performance monitoring on the target server based on the test script to obtain performance monitoring information;
determining the performance parameters of the target server according to the performance monitoring information;
counting the return time of each interface in the test script, and counting the error frequency of the test script;
and carrying out early warning according to the performance parameters, the return time and the error frequency.
A2, the method for automated testing and warning of a server according to a1, before the monitoring performance of the target server based on the test script to obtain the performance monitoring information, further comprising:
extracting script execution information from the test information;
correspondingly, the performance monitoring is performed on the target server based on the test script to obtain performance monitoring information, including:
and performing performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
A3, the method for server automated test early warning as in A2, the monitoring performance of the target server based on the script execution information and the test script to obtain performance monitoring information, including:
determining a script execution strategy according to the script execution information;
and performing performance monitoring on the target server based on the script execution strategy and the test script to obtain performance monitoring information.
A4, the method for server automated test early warning as described in A3, the performing performance monitoring on the target server based on the script execution policy and the test script to obtain performance monitoring information includes:
determining a test interface corresponding to the test script according to the script execution strategy, and determining a test frequency according to the script execution strategy;
monitoring the performance of the target server according to the test frequency and the test script;
and acquiring performance monitoring information corresponding to the target server through the test interface.
A5, the method for automated testing and early warning at a server end as described in a4, where the obtaining of the performance monitoring information corresponding to the target server through the test interface includes:
acquiring information to be processed through the test interface, and performing assertion verification on the information to be processed;
and when the assertion passes the verification, determining the performance monitoring information corresponding to the target server according to the information to be processed.
A6, the method for automated testing and early warning at a server end as described in a5, where the obtaining of the information to be processed through the test interface and the assertion verification of the information to be processed include:
obtaining information to be processed through the test interface, and searching an assertion rule corresponding to the target test parameter;
and performing assertion verification on the information to be processed according to the assertion rule.
A7, the method for automated testing and early warning at a server end as described in a5, wherein when the assertion verification passes, determining the performance monitoring information corresponding to the target server according to the information to be processed includes:
when the assertion verification passes, acquiring the current response time of the test interface, and searching assertion duration time corresponding to the test interface;
determining an expected response time from the assertion duration, comparing the current response time to the expected response time;
and when the current response time is consistent with the expected response time, determining performance monitoring information corresponding to the target server according to the information to be processed.
A8, in the automated testing and early warning method for the server side as described in any one of A1-A7, the searching for the test script corresponding to the target test parameter includes:
matching the target test parameter with a test parameter to be selected in a preset mapping table, wherein the preset mapping table comprises: test parameters to be selected and test scripts to be selected;
and determining a test script corresponding to the target test parameter according to the matching result.
A9, the method for server side automated test early warning as any one of A1-A7, wherein the early warning according to the performance parameter, the return time and the error frequency comprises:
generating a performance parameter statistical curve graph according to the performance parameters, and generating a return time statistical curve graph according to the return time;
and carrying out early warning according to the performance parameter statistical graph, the return time statistical graph and the error frequency.
A10, the method for server side automated test early warning as described in A9, the early warning according to the performance parameter statistical graph, the return time statistical graph and the error frequency includes:
detecting the performance parameter statistical curve graph to obtain a performance parameter detection result;
detecting the return time statistical curve graph to obtain a return time detection result;
comparing the error frequency with a preset frequency to obtain a frequency comparison result;
and carrying out early warning according to the performance parameter detection result, the return time detection result and the frequency comparison result.
A11, the method for automatic testing and early warning at a server side as described in A10, wherein the early warning according to the performance parameter detection result, the return time detection result and the frequency comparison result comprises:
judging whether the target server side is abnormal or not according to the performance parameter detection result, the return time detection result and the frequency comparison result;
when the target server side is abnormal, generating abnormal prompt information;
and carrying out early warning according to the abnormal prompt information.
A12, the method for automated testing and early warning at a server side as described in a11, wherein the generating of the abnormal prompt information when the target server side is abnormal includes:
when the target server side is abnormal, determining the reason of the abnormality according to the performance parameter detection result, the return time detection result and the frequency comparison result;
and generating abnormal prompt information according to the abnormal reason.
A13, the method for the server side automatic test early warning according to A11, the early warning according to the abnormal prompt information includes:
searching a target mailbox address corresponding to the target mailbox;
and sending the abnormal prompt information to the target mailbox for early warning according to the target mailbox address.
The invention also discloses B14 and a server automatic test early warning device, wherein the server automatic test early warning device comprises:
the test information module is used for determining a target server and target test parameters according to the test information when the test information is received;
the test script module is used for searching a test script corresponding to the target test parameter;
the performance monitoring module is used for monitoring the performance of the target server based on the test script so as to obtain performance monitoring information;
the performance parameter module is used for determining the performance parameters of the target server according to the performance monitoring information;
the data statistics module is used for counting the return time of each interface in the test script and counting the error frequency of the test script;
and the test early warning module is used for carrying out early warning according to the performance parameters, the return time and the error frequency.
15. The server-side automated testing and pre-warning apparatus of B14, wherein the test script module is further configured to extract script execution information from the test information;
the performance monitoring module is further configured to perform performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
B16, the server automatic test early warning device as described in B15, the performance monitoring module further used for determining script execution strategy according to the script execution information; and performing performance monitoring on the target server based on the script execution strategy and the test script to obtain performance monitoring information.
B17, the server automatic test early warning device as described in B16, the performance monitoring module further configured to determine a test interface corresponding to the test script according to the script execution policy, and determine a test frequency according to the script execution policy; monitoring the performance of the target server according to the test frequency and the test script; and acquiring performance monitoring information corresponding to the target server through the test interface.
B18, the server automatic test early warning device as described in B17, the performance monitoring module is further configured to obtain information to be processed through the test interface, and perform assertion verification on the information to be processed; and when the assertion passes the verification, determining the performance monitoring information corresponding to the target server according to the information to be processed.
The invention also discloses C19 and a server automatic test early warning device, wherein the server automatic test early warning device comprises: the server side automatic testing early warning method comprises a memory, a processor and a server side automatic testing early warning program which is stored on the memory and can run on the processor, wherein the server side automatic testing early warning program is configured with the steps of the server side automatic testing early warning method.
The invention also discloses D20 and a storage medium, wherein the storage medium is stored with the server automatic test early warning program, and the server automatic test early warning program is executed by the processor to realize the steps of the server automatic test early warning method.

Claims (10)

1. A server automatic test early warning method is characterized by comprising the following steps:
when test information is received, determining a target server and target test parameters according to the test information;
searching a test script corresponding to the target test parameter;
performing performance monitoring on the target server based on the test script to obtain performance monitoring information;
determining the performance parameters of the target server according to the performance monitoring information;
counting the return time of each interface in the test script, and counting the error frequency of the test script;
and carrying out early warning according to the performance parameters, the return time and the error frequency.
2. The server-side automated testing and early warning method of claim 1, wherein before the performance monitoring of the target server side based on the test script to obtain performance monitoring information, the method further comprises:
extracting script execution information from the test information;
correspondingly, the performance monitoring is performed on the target server based on the test script to obtain performance monitoring information, including:
and performing performance monitoring on the target server based on the script execution information and the test script to obtain performance monitoring information.
3. The server-side automated testing and early warning method of claim 2, wherein the performing performance monitoring on the target server side based on the script execution information and the test script to obtain performance monitoring information comprises:
determining a script execution strategy according to the script execution information;
and performing performance monitoring on the target server based on the script execution strategy and the test script to obtain performance monitoring information.
4. The server-side automated testing and early warning method of claim 3, wherein the performing performance monitoring on the target server side based on the script execution policy and the test script to obtain performance monitoring information comprises:
determining a test interface corresponding to the test script according to the script execution strategy, and determining a test frequency according to the script execution strategy;
monitoring the performance of the target server according to the test frequency and the test script;
and acquiring performance monitoring information corresponding to the target server through the test interface.
5. The server-side automated testing and early warning method of claim 4, wherein the obtaining of the performance monitoring information corresponding to the target server through the testing interface comprises:
acquiring information to be processed through the test interface, and performing assertion verification on the information to be processed;
and when the assertion passes the verification, determining the performance monitoring information corresponding to the target server according to the information to be processed.
6. The server-side automated testing and early warning method of claim 5, wherein the obtaining of the information to be processed through the testing interface and the assertion verification of the information to be processed comprise:
obtaining information to be processed through the test interface, and searching an assertion rule corresponding to the target test parameter;
and performing assertion verification on the information to be processed according to the assertion rule.
7. The server-side automatic test early warning method according to claim 5, wherein when the assertion verification passes, determining the performance monitoring information corresponding to the target server according to the to-be-processed information includes:
when the assertion verification passes, acquiring the current response time of the test interface, and searching assertion duration time corresponding to the test interface;
determining an expected response time from the assertion duration, comparing the current response time to the expected response time;
and when the current response time is consistent with the expected response time, determining performance monitoring information corresponding to the target server according to the information to be processed.
8. The utility model provides a server side automation test early warning device which characterized in that, server side automation test early warning device includes:
the test information module is used for determining a target server and target test parameters according to the test information when the test information is received;
the test script module is used for searching a test script corresponding to the target test parameter;
the performance monitoring module is used for monitoring the performance of the target server based on the test script so as to obtain performance monitoring information;
the performance parameter module is used for determining the performance parameters of the target server according to the performance monitoring information;
the data statistics module is used for counting the return time of each interface in the test script and counting the error frequency of the test script;
and the test early warning module is used for carrying out early warning according to the performance parameters, the return time and the error frequency.
9. The utility model provides a server side automation test early warning equipment which characterized in that, server side automation test early warning equipment includes: the system comprises a memory, a processor and a server-side automatic test early warning program which is stored on the memory and can run on the processor, wherein the server-side automatic test early warning program is configured with steps for realizing the server-side automatic test early warning method as claimed in any one of claims 1 to 7.
10. A storage medium, wherein the storage medium stores thereon a server-side automated testing and warning program, and the server-side automated testing and warning program, when executed by a processor, implements the steps of the server-side automated testing and warning method according to any one of claims 1 to 7.
CN202010902741.4A 2020-08-31 2020-08-31 Server-side automatic test early warning method, device, equipment and storage medium Pending CN112000582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010902741.4A CN112000582A (en) 2020-08-31 2020-08-31 Server-side automatic test early warning method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010902741.4A CN112000582A (en) 2020-08-31 2020-08-31 Server-side automatic test early warning method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112000582A true CN112000582A (en) 2020-11-27

Family

ID=73466092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010902741.4A Pending CN112000582A (en) 2020-08-31 2020-08-31 Server-side automatic test early warning method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112000582A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685305A (en) * 2020-12-30 2021-04-20 北京字节跳动网络技术有限公司 User interface performance test method and device, electronic equipment and readable storage medium
CN113326209A (en) * 2021-08-03 2021-08-31 航天中认软件测评科技(北京)有限责任公司 Hierarchical segmentation monitoring and intervention method for large-scale parallel test task
CN117687893A (en) * 2024-02-04 2024-03-12 深圳市冠群电子有限公司 Mobile phone APP port testing method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634837A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Automated testing method, device, equipment and storage medium
CN110275822A (en) * 2019-04-26 2019-09-24 武汉众邦银行股份有限公司 Performance test methods, device, equipment and the storage medium of application programming interfaces
CN110784374A (en) * 2019-10-25 2020-02-11 上海中通吉网络技术有限公司 Method, device, equipment and system for monitoring operation state of service system
WO2020048047A1 (en) * 2018-09-03 2020-03-12 平安科技(深圳)有限公司 System fault warning method, apparatus, and device, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020048047A1 (en) * 2018-09-03 2020-03-12 平安科技(深圳)有限公司 System fault warning method, apparatus, and device, and storage medium
CN109634837A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Automated testing method, device, equipment and storage medium
CN110275822A (en) * 2019-04-26 2019-09-24 武汉众邦银行股份有限公司 Performance test methods, device, equipment and the storage medium of application programming interfaces
CN110784374A (en) * 2019-10-25 2020-02-11 上海中通吉网络技术有限公司 Method, device, equipment and system for monitoring operation state of service system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112685305A (en) * 2020-12-30 2021-04-20 北京字节跳动网络技术有限公司 User interface performance test method and device, electronic equipment and readable storage medium
CN112685305B (en) * 2020-12-30 2024-02-09 抖音视界有限公司 User interface performance test method and device, electronic equipment and readable storage medium
CN113326209A (en) * 2021-08-03 2021-08-31 航天中认软件测评科技(北京)有限责任公司 Hierarchical segmentation monitoring and intervention method for large-scale parallel test task
CN117687893A (en) * 2024-02-04 2024-03-12 深圳市冠群电子有限公司 Mobile phone APP port testing method and system
CN117687893B (en) * 2024-02-04 2024-05-10 深圳市冠群电子有限公司 Mobile phone APP port testing method and system

Similar Documents

Publication Publication Date Title
US10949329B2 (en) Machine defect prediction based on a signature
CN107766190B (en) Interface testing method and device, computer equipment and storage medium
CN112000582A (en) Server-side automatic test early warning method, device, equipment and storage medium
CN110908909B (en) Automatic test method, device, storage medium and equipment
CN111459794A (en) Communication network testing method, device, computer equipment and storage medium
CN108491321B (en) Method and device for determining test case range and storage medium
CN108509344B (en) Daily cutting batch test method, equipment and readable storage medium
CN107329894B (en) Application program system testing method and device and electronic equipment
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
WO2019214109A1 (en) Monitoring device and method for testing process, and computer readable storage medium
CN110502442B (en) Dynamic parameter checking method, device, equipment and storage medium
CN113282513B (en) Interface test case generation method and device, computer equipment and storage medium
CN112667424A (en) Abnormal data processing method and device, computer equipment and storage medium
CN111045879A (en) Pressure test report generation method and device and storage medium
CN110750460A (en) Browser compatibility detection method, device, equipment and readable storage medium
CN112948224B (en) Data processing method, device, terminal and storage medium
CN111061637B (en) Interface testing method, interface testing device and storage medium
CN112612706A (en) Automated testing method, computer device and storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN116302910A (en) Use case retry method, device, equipment and storage medium
CN113821389A (en) Method, device and equipment for testing performance of solid state disk and readable storage medium
CN110517010B (en) Data processing method, system and storage medium
CN109829681B (en) Software development monitoring method, device, computer equipment and storage medium
CN109240906B (en) Database configuration information adaptation method and device, computer equipment and storage medium
CN113342600A (en) Method and device for monitoring program dependent plug-in

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