CN114064435A - Database test method, device, medium and electronic equipment - Google Patents

Database test method, device, medium and electronic equipment Download PDF

Info

Publication number
CN114064435A
CN114064435A CN202111372132.3A CN202111372132A CN114064435A CN 114064435 A CN114064435 A CN 114064435A CN 202111372132 A CN202111372132 A CN 202111372132A CN 114064435 A CN114064435 A CN 114064435A
Authority
CN
China
Prior art keywords
database server
database
request processing
request
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
CN202111372132.3A
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202111372132.3A priority Critical patent/CN114064435A/en
Publication of CN114064435A publication Critical patent/CN114064435A/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/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment

Landscapes

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

Abstract

The disclosure provides a database testing method, a database testing device, a database testing medium and electronic equipment, and relates to the technical field of computers. The database testing method comprises the following steps: sending a plurality of data operation requests to a test database which is created in advance in a database server; receiving a request processing result returned by the database server in response to each data operation request; determining a first performance index value of the database server according to a data operation result in the test database and a first request processing result in a plurality of request processing results; and determining a second performance index value of the database server according to a second request processing result in the plurality of request processing results. According to the database test scheme provided by the disclosure, the accuracy of the performance of the determined database server is improved.

Description

Database test method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to a database testing method, a database testing apparatus, a computer storage medium, and an electronic device.
Background
With the development of internet technology, more and more data are generated by devices in the internet, and a database is generated in order to facilitate the management of the data.
The database can manage data by taking a database server as a hardware carrier, and the running state of the database server can be tested when the database server is put into use so as to determine the service performance of the database server.
In the related art, in the process of testing the database server, the accuracy of the test result is low due to the fact that the test index is single.
Disclosure of Invention
The present disclosure provides a database test method, a database test system, a computer-readable storage medium, and an electronic device, thereby improving the accuracy of determining the performance of a database service.
According to a first aspect of the present disclosure, there is provided a database testing method, the method comprising:
sending a plurality of data operation requests to a test database which is created in advance in a database server;
receiving a request processing result returned by the database server in response to each data operation request;
determining a first performance index value of the database server according to a data operation result in the test database and a first request processing result in a plurality of request processing results, wherein the first request processing result indicates that the database server successfully responds to the data operation request;
and determining a second performance index value of the database server according to a second request processing result in the plurality of request processing results, wherein the second request processing result indicates that the database server does not successfully respond to the data operation request.
According to a second aspect of the present disclosure, there is provided a database testing apparatus, the apparatus comprising:
the system comprises a sending module, a data processing module and a data processing module, wherein the sending module is configured to send a plurality of data operation requests to a test database which is created in advance in a database server;
the receiving module is configured to receive a request processing result returned by the database server in response to each data operation request;
a first determining module configured to determine a first performance index value of the database server according to a data operation result in the test database and a first request processing result in a plurality of request processing results, wherein the first request processing result indicates that the database server successfully responds to the data operation request;
a second determining module configured to determine a second performance index value of the database server according to a second request processing result of the plurality of request processing results, the second request processing result indicating that the database server does not successfully respond to the data operation request.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of the first aspect via execution of the executable instructions.
The technical scheme of the disclosure has the following beneficial effects:
the method can send a plurality of data operation requests to a database server to be tested, obtain a plurality of request processing results fed back by the database server, and determine a first performance index value through the data operation results in the database and the first request processing results fed back by the database server so as to judge whether the database server successfully executes the data processing operation corresponding to each data operation request successfully responded by the database server; and determining a second performance index value according to a second request processing result fed back by the database server so as to determine the time length of the database server which does not successfully respond to the data operation request, comprehensively determining the performance quality of the database server according to the two performance index values, and improving the accuracy of the determined performance quality of the database server.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is apparent that the drawings in the following description are only some embodiments of the present disclosure, and that other drawings can be obtained from those drawings without inventive effort for a person skilled in the art.
FIG. 1 shows a schematic architecture diagram of a database testing system in the present exemplary embodiment;
FIG. 2 illustrates a flow chart of a database testing method in the exemplary embodiment;
fig. 3 shows a flow chart of a first performance index value determination method in the present exemplary embodiment;
fig. 4 shows a flow chart of a second performance index value determination method in the present exemplary embodiment;
FIG. 5 illustrates a flow chart of another method of testing a database in the exemplary embodiment;
FIG. 6 is a schematic diagram showing the structure of a database test apparatus according to the exemplary embodiment;
fig. 7 shows a schematic structural diagram of an electronic device in the present exemplary embodiment.
Detailed Description
Exemplary embodiments will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
In the related art, a test scheme for the performance of a database server has appeared. In general, a data operation request may be sent to a database server to be tested, a request processing result for the data operation request returned by the database server is obtained, and the performance of the database server is determined according to the request processing result.
The process of determining the performance of the database server according to the request processing result generally includes: however, the test method for the database server provided in the related art can only determine one performance index value, and cannot comprehensively reflect the performance of the database server.
In view of the foregoing problems, exemplary embodiments of the present disclosure provide a database testing method, which is directed to a performance testing scenario of a database server. The application scenarios of the database testing method include but are not limited to: aiming at the cloud database server, a plurality of data operation requests can be sent to a test database which is pre-established in the cloud database server by using test equipment; receiving a request processing result returned by the cloud database server in response to each data operation request; determining a first performance index value of the cloud database server according to a data operation result in the test database and a first request processing result in the plurality of request processing results; and determining a second performance index value of the cloud database server according to a second request processing result in the plurality of request processing results.
The first request processing result indicates that the database server successfully responds to the data operation request, the second request processing result indicates that the database server does not successfully respond to the data operation request, the database server successfully responds to the data operation request refers to a process that the database server analyzes the data operation request and determines a target of the data operation request, and the data operation result is data updated in a test database after the database server successfully responds to the data operation request and successfully executes data processing operation corresponding to the data operation request. The first performance index value is used for indicating whether the database server successfully executes the data processing operation corresponding to each data operation request successfully responded by the database server; the second performance indicator value is used to indicate a length of time that the database server has not successfully responded to the data operation request. The performance of the cloud database server can be comprehensively evaluated through the finally determined first performance index value and the finally determined second performance index value of the cloud database server, and the accuracy of the determined performance of the cloud database server is improved.
In order to implement the above-described database testing method, exemplary embodiments of the present disclosure provide a database testing system. Fig. 1 shows a schematic architecture diagram of the database test system. As shown in fig. 1, the database test system 100 may include a database server 110 and a test device 120. The database server 110 is a database server that needs to perform a performance test, and the database server may be a cloud database server. The test equipment 120 is a terminal device used by a tester, and the terminal device may include a personal computer or a tablet computer, for example. The database server 110 and the testing device 120 may establish a connection through a network to implement a performance test of the database server.
The test device 120 may send a plurality of data operation requests to a test database created in advance in the database server 110, and the database server 110 may accept each data operation request and may send a request processing result for each data operation request to the test device 120. If the database server 110 successfully responds to the data operation request, a first request processing result may be returned to the test device 120, and if the database server 110 does not successfully respond to the data operation request, a second request processing result may be returned to the test device 120.
The test device 110 may receive the request processing result sent by the database server 110, and determine a first performance index value of the database server according to the data operation result in the test database and a first request processing result in the plurality of request processing results; and determining a second performance index value of the database server according to a second request processing result in the plurality of request processing results.
It should be understood that the database server 110 may be a single server or a cluster of multiple servers, and the present disclosure is not limited to the specific architecture of the server 110.
The following describes a database test method from the perspective of the test equipment. Fig. 2 shows an exemplary flow of a database testing method performed by a testing device, which may include steps S201 to S204:
step S201, sending a plurality of data operation requests to a test database created in advance in the database server.
In the embodiment of the present disclosure, the database server may be a database server that needs to be subjected to a performance test, a test database may be created in the database server in advance, and the performance of the database server may be determined by a response result of the database server to a data operation request associated with the test database, where the database server may be a cloud database server.
Step S202, receiving a request processing result returned by the database server in response to each data operation request.
In the embodiment of the present disclosure, the database server responding to the data operation request refers to a process in which the database server parses the data operation request and determines a target of the data operation request.
Step S203, determining a first performance index value of the database server according to the data operation result in the test database and a first request processing result in the plurality of request processing results.
In the embodiment of the present disclosure, the data operation result is data updated in the test database after the database server successfully responds to the data operation request and successfully executes the data processing operation corresponding to the data operation request; the first performance indicator value is used for indicating whether the database server successfully executes the data processing operation corresponding to each data operation request successfully responded by the database server.
And step S204, determining a second performance index value of the database server according to a second request processing result in the plurality of request processing results.
In the embodiment of the present disclosure, the second request processing result indicates that the database server does not successfully respond to the data operation request, and the second performance index value is used to indicate a time length for which the database server does not successfully respond to the data operation request.
To sum up, the database testing method provided by the embodiment of the present disclosure may send a plurality of data operation requests to a database server to be tested, and obtain a plurality of request processing results fed back by the database server, and determine a first performance index value by using the data operation results in the database and a first request processing result in the plurality of request processing results fed back by the database server, so as to determine whether the database server successfully executes the data processing operation corresponding to each data operation request successfully responded by the database server; and determining a second performance index value through a second request processing result in the plurality of request processing results fed back by the database server to determine the time length of the database server not successfully responding to the data operation request, comprehensively determining the performance advantages and disadvantages of the database server through the two performance index values, and improving the accuracy of the determined performance advantages and disadvantages of the database server.
In an alternative embodiment, in step S201, the testing device may send a plurality of data operation requests to a testing database created in advance in the database server.
In the embodiment of the present disclosure, for the database server to be tested, a test database may be created in the database server in advance, and the performance of the database server is determined according to the response result of the database server to the data operation request associated with the test database. The process of the test device creating the test database in the database server may include: the test equipment calls the database server interface in response to a call operation to the database server interface, and creates a test database in the database server through the database server interface in response to a creation operation of the test database.
It is to be understood that, since the data in the database is managed in the form of a data table, the test device may create the test data table in the test database of the database server through the database server interface in response to the test data table creation operation after creating the test database.
In an alternative embodiment, the process of sending a plurality of data operation requests to a test database created in advance in the database by the test device may include: the test equipment may send a plurality of data operation requests to the database server, which may be data insertion requests for the test data table.
In an alternative embodiment, in step S202, the testing device may receive a request processing result returned by the database server in response to each data operation request.
In the embodiment of the present disclosure, after receiving the data operation request, the database server may respond to the data operation request to perform a data processing operation corresponding to the data operation request. The database server responding to the data operation request refers to a process that the database server analyzes the data operation request and determines a target of the data operation request. The target of the data operation request refers to a data operation object and a data operation type of the data operation request, and the data operation object may include a target database, a target data table, or the like; the data operation type may include a data insert operation, a data update operation, or a data delete operation, etc. For example, if the data operation request is a data insertion operation for a test data table in a test database, after receiving the data operation request, the database server may determine that the target of the data operation request is a data operation object: the test data table in the test database and the data operation type data insertion operation are used, namely, the data carried in the data operation request are inserted into the test data table in the test database.
It should be noted that, in this embodiment of the present disclosure, after the database server receives the data operation request, if the database server can successfully respond to the data operation request, a first request processing result may be sent to the test device, where the first request processing result indicates that the database server successfully responds to the data operation request, and if the database server does not successfully respond to the data operation request, a second request processing result may be sent to the test device, where the second request processing result indicates that the database server does not successfully respond to the data operation request.
In an alternative embodiment, the test device may receive a request processing result returned by the database server in response to each data operation request, and store a plurality of request processing results.
In an optional implementation manner, in order to facilitate checking of a processing result of the database server on the data operation request, the test device may further operate a monitoring system, and after receiving the request processing result sent by the database server, the test device may report the request processing result to the monitoring system, so that a tester can check a response condition of the database server on the data operation request in a test process at any time based on the monitoring system, and grasp a test condition of the database server.
In an alternative embodiment, in step S203, the testing device may determine the first performance index value of the database server according to the data operation result in the test database and the first request processing result in the plurality of request processing results.
In the embodiment of the present disclosure, the data operation result is data updated in the test database after the database server successfully responds to the data operation request and successfully executes the data processing operation corresponding to the data operation request. Wherein the data updated in the test database may be data newly added in the database. For example, if the data operation request is a data insertion operation for a test data table in the test database, the database server may successfully respond to the data operation request, and may successfully execute a data processing operation corresponding to the data operation request, and then insert data carried in the data operation request into the test data table in the test database to obtain a data operation result.
It should be noted that, after the database server successfully responds to the data operation request, a situation may occur that the data processing operation corresponding to the data operation request cannot be successfully executed, and therefore, in the embodiment of the present disclosure, a first performance index value may be determined, where the first performance index value is used to indicate whether the database server successfully executes the data processing operation corresponding to each data operation request that the database server successfully responds to, and the first performance index value is a difference between the number of data operation results in the test database and the number of first request processing results.
In an alternative embodiment, as shown in fig. 3, the process of determining, by the testing device, the first performance index value of the database server according to the data operation result in the test database and the first request processing result in the plurality of request processing results may include steps S301 to S303:
and step S301, determining the number of data operation results.
In an alternative embodiment, the process of the test device determining the data operation result may include: and calling a database server interface to check the test data table in the test database, determining the updated data in the test data table, obtaining the data operation result of the test data table in the test database, and counting the number of the data operation results.
For example, if the data operation request sent by the test device is a data insertion request for a test data table in the test database, the test data table may be checked, the newly added data in the test data table may be determined, and the number of the newly added data may be counted to obtain the number of data operation results.
Step S302, determining the number of the first request processing results.
In an alternative embodiment, the process of the test device determining the number of the first request processing results may include: the method comprises the steps of obtaining a plurality of request processing results, determining a first request processing result in the plurality of request processing results, and counting the number of the first request processing results.
For example, assuming that a number 1 represents a first request processing result and a number 0 represents a second request processing result, if the test equipment sends 10 data operation requests to the database server, 10 request processing results returned by the database server are received as { x }1=1;x2=0;x3=1;x4=0;x5=0;x6=0;x7=1;x8=1;x9=1;x101, the number of the first request process results may be determined to be 6.
And step S303, determining a first performance index value of the database server according to the number of the first request processing results and the number of the data operation results.
In an alternative embodiment, the process of the testing device determining the first performance index value of the database server according to the number of the first request processing results and the number of the data operation results may include: and determining the absolute value of the difference between the number of the first request processing results and the number of the data operation results to obtain a first performance index value. The first performance index value may be a Recovery time object (RPO), and it should be noted that, if the first performance index value is 0, it indicates that each data operation request successfully responded to the database, and the database server also successfully executes the data processing operation corresponding to each data operation request; if the first performance index value is not 0, it indicates that, for each data operation request successfully responded to the database, the database server has not successfully executed the data processing operation corresponding to each data operation request, and a data loss situation occurs in the database server.
In an alternative embodiment, in step S204, the testing device may determine the second performance index value of the database server according to a second request processing result of the plurality of request processing results.
In the embodiment of the present disclosure, if the database server does not successfully respond to the data operation request, it may be determined that the database server cannot provide the data operation service temporarily, and a second performance index value may be determined to specify a time length during which the database server cannot provide the data operation service, where the second performance index value is used to indicate a time length during which the database server does not successfully respond to the data operation request.
In an alternative embodiment, as shown in fig. 4, the process that the test device determines the second performance index value of the database server according to the second request processing result in the plurality of request processing results may include steps S401 to S403:
step S401, determining a first time stamp.
In this disclosure, for a plurality of received request processing results, the test database may store the request processing results according to a time sequence of receiving the request processing results, and the test device may store a timestamp of a receiving time of each request processing result when storing each request processing result, where the first timestamp is a timestamp of receiving the second request processing result.
In an alternative embodiment, the process of the test device determining the first time stamp may comprise: and scanning the request processing results according to the arrangement sequence of the request processing results by taking the request processing result received earliest in the request processing results as a starting point, and determining the time stamp for receiving the second request processing result when the second request processing result is scanned to obtain the first time stamp.
And step S402, determining a second time stamp.
In this embodiment of the present disclosure, the second timestamp is a timestamp of a first request processing result received after the first request processing result is received.
In an alternative embodiment, the process of the test device determining the second time stamp may comprise: after the first timestamp is determined, the request processing results are continuously scanned according to the arrangement sequence of the plurality of request processing results with the second request processing result as the starting point, and when a first request processing result after the first request processing result is scanned, the timestamp of the first request processing result after the first request processing result can be acquired to obtain the second timestamp.
And S403, determining a second performance index value of the database server according to the second time stamp and the first time stamp.
In an alternative embodiment, the process of the testing device determining the second performance index value of the database server according to the second time stamp and the first time stamp may include: determining a Time difference between the second timestamp and the first timestamp to obtain a second performance index value of the database server, where the second performance index value may be a Recovery Time Objective (RTO).
For example, if the number 1 represents the first request processing result and the number 0 represents the second request processing result, the 10 request processing results returned by the database server received by the testing device are { x }1=1;x2=0;x3=1;x4=0;x5=0;x6=0;x7=1;x8=1;x9=1;x10Assuming that the 10 request processing results are arranged according to the sequence of the receiving times, the process of determining the second performance index value of the database server may include; processing a result x from a first request1Start scanning 10 request processing nodesIf the second request processing result x is scanned2Then, the request processing result x may be obtained second2And continues to process the result x with the second request2Scanning the data processing result for the starting point, when the data processing result is scanned to the second request processing result x2The latter first request processing result x3Then, the first request processing result x may be acquired3Determines the first request processing result x3And the second fetch request processing result x2Time difference t of time stamp of1Indicating that the database server is sending the first request processing result x to the test equipment1Later fault and use of time duration t1Failure recovery is carried out;
further, continue processing the result x with the first request3Scanning the data processing result for the starting point, when the second request processing result x is scanned4Then, the request processing result x may be obtained second4And continues to process the result x with the second request4Scanning the data processing result for the starting point, when the data processing result is scanned to the second request processing result x4The latter first request processing result x7Then, the first request processing result x may be acquired7Determines the first request processing result x7And the second fetch request processing result x7Time difference t of time stamp of2Indicating that the database server is sending the first request processing result x to the test equipment3Later fault and use of time duration t2Failure recovery is performed.
In an optional embodiment, after determining the first performance index value and the second performance index value of the database server, the testing device may further determine whether the database server test passes according to the first performance index value and the second performance index value, and a preset test passing condition; and if the first performance index value and the second performance index value of the database server meet the test passing condition, determining that the database server passes the test. The test passing condition may be determined based on actual needs, which is not limited in the embodiments of the present disclosure. For example, the preset test passing condition may include: if the first performance index value is 0 and the second performance index value is greater than the index time threshold, it is determined that the database server passes the test, and the time threshold may be determined based on actual needs, which is not limited in the embodiment of the present disclosure, for example, the time threshold is 30 seconds.
In the embodiment of the present disclosure, in order to test the performance of the database server under various abnormal conditions, after sending a plurality of data operation requests to a test database created in advance in the database server, the test device may further send an abnormal operation instruction to the database server, so that the database server operates according to an abnormal state corresponding to the abnormal operation instruction, and by receiving a request processing result returned by the database server in the abnormal state in response to each data operation request, the performance of the database server in the abnormal operation state may be determined.
In an optional embodiment, the process that the test device sends the abnormal operation instruction to the database server so that the database server operates according to the abnormal state corresponding to the abnormal operation instruction may include: sending a first abnormal operation instruction to the database server to enable the database server to operate according to an abnormal state corresponding to the first abnormal operation instruction, wherein the first abnormal operation instruction is used for indicating the database server to operate according to an abnormal state corresponding to equipment abnormality; the type of the device exception may include an input/output exception of the database server, a network delay of the database server, a Central Processing Unit (CPU) of the database server being fully occupied, or a process in the database server being suspended, etc.
In an optional embodiment, the process that the test device sends the abnormal operation instruction to the database server so that the database server operates according to the abnormal state corresponding to the abnormal operation instruction may include: and sending a second abnormal operation instruction to the database server so that the database server operates according to an abnormal state corresponding to the second abnormal operation instruction, wherein the second abnormal operation instruction is used for indicating the database server to operate according to the abnormal operation state caused by the abnormal data request behavior of the user. The abnormal operation state caused by the abnormal data request behavior of the user may include an operation state when the database server executes a large transaction, where the large transaction refers to a database transaction in which the database server has a long operation time and a large amount of data is operated, and the database transaction refers to a series of data operation sequences that need to be executed after responding to the data operation request.
It should be noted that, in the process of the database server receiving the second abnormal operation instruction and operating in the abnormal operation state caused by the abnormal data request behavior of the user, if the abnormal data processing operation associated with the abnormal data operation request is a single execution operation, after the abnormal data processing operation is successfully executed, the abnormal data processing operation may be executed in a reverse direction, and the database server may operate in the abnormal operation state caused by the abnormal data request behavior of the user again, so that the database server may be continuously in the abnormal state, and the requirement for the performance test of the database server in the abnormal operation state may be met. Wherein, the abnormal data operation request refers to a data operation request associated with a user abnormal data request behavior. And the information of successfully executing the abnormal data processing operation and the information of successfully reversely executing the abnormal data processing operation can be returned to the test equipment, so that a tester can conveniently check the current abnormal state of the database server.
For example, if the abnormal operation state caused by the abnormal data request behavior of the user is the operation state when the database server executes a large transaction, and the abnormal data operation request causing the large transaction is a single execution request, the reverse operation of the large transaction can be executed after the large transaction is executed, and the database server can be ensured to be in the abnormal operation state when the large transaction is executed. For example, the abnormal data operation request is to request to insert data a1 in data table a, and since data a1 is only allowed to be inserted once in the database server, after the large transaction caused by the abnormal data operation request is completed, the reverse operation of the large transaction, that is, data a1 is deleted from data table a, can be performed.
In an optional embodiment, in order to test performance of the database server during operation and maintenance of the database server, after sending a plurality of data operation requests to a test database created in advance in the database server, the test device may further send a database operation and maintenance instruction to the database server, so that the database server operates according to an operation state corresponding to the database operation and maintenance instruction, where the database operation and maintenance instruction is used to instruct the database server to perform the database operation and maintenance operation, and the database operation and maintenance operation may include that the database server performs a switching operation between a master server and a slave server, or that the database server performs a capacity expansion operation.
In an optional implementation manner, after the test device sends the database operation and maintenance instruction to the database server, the test device may further receive an instruction response result returned by the database server, so as to determine whether the database server successfully performs the database operation and maintenance operation according to the instruction response result.
In an optional embodiment, in order to test the performance of the database server under an abnormal condition during operation and maintenance of the database server, after sending the database operation and maintenance instruction to the database server so that the database server operates according to the operation state corresponding to the database operation and maintenance instruction, the test device may further send an abnormal operation instruction to the database server so that the database server operates according to the abnormal operation instruction and the abnormal state corresponding to the database operation and maintenance instruction. Wherein the abnormal operation instruction may be a first abnormal operation instruction.
For example, if the test device sends a plurality of data operation requests to a test database created in advance in the database server, then sends a database operation and maintenance instruction to the database server, and sends a first abnormal operation instruction to the database server after sending the capacity expansion instruction, where the database operation and maintenance instruction is used to instruct the database server to perform the capacity expansion operation, and the first abnormal operation quality is used to instruct the database server to operate according to a network delay condition occurring in the database server, the database server may operate according to a network delay state occurring in the process of performing the capacity expansion operation.
It can be understood that, in the embodiment of the present disclosure, in the database server test process, after the test device sends a plurality of data operation requests to the test database created in advance in the database server, an abnormal operation instruction or a database operation and maintenance instruction may also be sent to the database server, so that the database server simulates an abnormal operation state, an operation and maintenance state, or an abnormal operation state in the operation and maintenance process, receives a request processing result returned by the database server in response to the plurality of data operation requests in various operation states, and determines a first performance index value of the database server in the abnormal operation state or the operation and maintenance state according to the data operation result in the test database and a first request processing result in the plurality of request processing results; and determining a second performance index value of the database server in an abnormal operation state or an operation and maintenance state according to a second request processing result in the plurality of request processing results, and determining the performance level of the database server in the operation and maintenance state table or the abnormal operation state.
The test equipment sends a plurality of data operation requests to a test database which is pre-established in the database server, and then sends a test logic of an abnormal operation instruction or a database operation and maintenance instruction to the database server, wherein the test logic can be obtained by the test equipment responding to test configuration operation pre-configuration performed by a tester by using an integrated tool, and after a test flow is started, the database server can be automatically tested according to the pre-configured test logic. The integration tool may comprise a jenkins integration tool. The test logic may include test start time, data operation requests, data operation request number, instruction types, instruction trigger time, and/or cycle times, where the instruction types and the instruction trigger time may be determined based on actual needs, which is not limited in the embodiments of the present disclosure, for example, for a certain database server, a first abnormal operation instruction may be configured to instruct the database server to operate according to an operation condition of the database server that has network delay; for another database server, a database operation and maintenance instruction may be configured to instruct the database server to operate according to the operation condition during the capacity expansion operation.
The instruction type may be a first abnormal operation instruction, a second abnormal operation instruction, and/or a database operation and maintenance instruction, where, in a process in which the test device obtains the test logic in response to a tester performing a test configuration operation by using the integration tool, if the test logic is configured with the first abnormal instruction, a process in which the test device adds the first abnormal instruction to the test logic may include: responding to a calling operation of an equipment abnormity simulation tool and a type confirmation operation of a selected equipment abnormity, and generating a first abnormity instruction, wherein the equipment abnormity simulation tool can simulate various equipment abnormity of a database server, and can comprise an equipment abnormity simulation tool such as chaosblade; if the test logic is configured with the second exception instruction, the process of the test device adding the second exception instruction to the test logic may include: responding to a calling operation of an equipment abnormal operation state library and a selection operation of any abnormal operation state, and generating a second abnormal instruction, wherein the equipment abnormal operation state library comprises respective abnormal operation states caused by abnormal data request behaviors of a user, and can be obtained by a Database Administrator (DBA) in advance in a summarized mode; if the test logic is configured with the database operation and maintenance instruction, the process of adding the database operation and maintenance instruction to the test logic by the test device may include: the database operation and maintenance instruction is generated in response to a call operation to an Application Programming Interface (API) of the database server and a selection operation to a type of the database operation and maintenance operation.
It should be noted that the cycle number in the test logic refers to a cycle number of a process in which the test device sends a plurality of data operation requests to a test database created in advance in the database server, and then sends an abnormal operation instruction or a database operation and maintenance instruction to the database server, and determines a performance index value of the database server according to a request processing result, where the cycle number may be determined based on actual needs, and this is not limited in this disclosure. Optionally, after each cycle is completed, if the test device determines that the test of the database server fails according to the first performance index value and the second performance index value of the database server, the test may be suspended, so that a tester can check and troubleshoot the reason of the test failure.
For example, as shown in fig. 5, it is assumed that a database server to be tested is a cloud database server, the cloud database server needs to be tested, the test requirement is to test performance of the cloud database server in an abnormal operation state caused by an abnormal data request behavior of a user, in an operation and maintenance operation process, and in an abnormal device state occurring in the operation and maintenance process, after the test is started, the database server is controlled to operate according to the abnormal operation state caused by the abnormal data request behavior of the user, then the database operation and maintenance operation is performed, and the database operation and maintenance operation is performed according to an operation state corresponding to the abnormal device. After configuring the test logic according to the test requirement, the test process of the cloud database executed by the test equipment may include:
step S501, a plurality of data operation requests are sent to a test database which is created in advance in a cloud database server.
And step S502, sending a second abnormal operation instruction to the cloud database server.
Step S503, sending a database operation and maintenance instruction to the cloud database server.
Step S504, a first abnormal operation instruction is sent to the cloud database server.
And step S505, receiving a request processing result returned by the cloud database server in response to each data operation request.
Step S506, determining a first performance index value of the cloud database server according to the data operation result in the test database and a first request processing result in the plurality of request processing results.
And step S507, determining a second performance index value of the cloud database server according to a second request processing result in the plurality of request processing results.
An embodiment of the present disclosure provides a database testing apparatus, as shown in fig. 6, a database testing apparatus 600 includes:
a sending module 601 configured to send a plurality of data operation requests to a test database created in advance in a database server;
a receiving module 602, configured to receive a request processing result returned by the database server in response to each data operation request;
a first determining module 603 configured to determine a first performance index value of the database server according to the data operation result in the test database and a first request processing result in the plurality of request processing results, where the first request processing result indicates that the database server successfully responds to the data operation request;
a second determining module 604 configured to determine a second performance indicator value of the database server according to a second request processing result of the plurality of request processing results, the second request processing result indicating that the database server does not successfully respond to the data operation request.
Optionally, the first determining module 603 is configured to:
determining the number of data operation results;
determining the number of first request processing results;
and determining a first performance index value of the database server according to the number of the first request processing results and the number of the data operation results.
Optionally, the second determining module 604 is configured to:
determining a first time stamp, wherein the first time stamp is the time stamp of the received second request processing result;
determining a second time stamp, wherein the second time stamp is the time stamp of the received first request processing result after the second request processing result is received;
and determining a second performance index value of the database server according to the second time stamp and the first time stamp.
Optionally, as shown in fig. 6, the database testing apparatus 600 further includes:
the instruction sending module 605 is configured to send an abnormal operation instruction to the database server, so that the database server operates according to an abnormal state corresponding to the abnormal operation instruction.
Optionally, the instruction sending module 605 is configured to:
and sending a first abnormal operation instruction to the database server so that the database server operates according to the abnormal state corresponding to the first abnormal operation instruction, wherein the first abnormal operation instruction is used for indicating the database server to operate according to the abnormal state corresponding to the equipment abnormality.
Optionally, the instruction sending module 605 is configured to:
and sending a second abnormal operation instruction to the database server so that the database server operates according to an abnormal state corresponding to the second abnormal operation instruction, wherein the second abnormal operation instruction is used for indicating the database server to operate according to an abnormal operation state caused by the abnormal data request behavior of the user.
Optionally, the instruction sending module 605 is configured to:
and sending a database operation and maintenance instruction to the database server so that the database server operates according to the operation state corresponding to the database operation and maintenance instruction, wherein the database operation and maintenance instruction is used for indicating the database server to execute the database operation and maintenance operation.
Optionally, the instruction sending module 605 is configured to:
and sending an abnormal operation instruction to the database server so that the database server operates according to the abnormal operation instruction and the abnormal state corresponding to the database operation and maintenance instruction.
Optionally, as shown in fig. 6, the database testing apparatus 600 further includes:
a third determining module 606 configured to determine that the database server passes the test if it is determined that the first and second performance index values of the database server satisfy the test passing condition.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which may be implemented in the form of a program product, including program code for causing an electronic device to perform the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary method" section of this specification, when the program product is run on the electronic device. In one embodiment, the program product may be embodied as a portable compact disc read only memory (CD-ROM) and include program code, and may be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Exemplary embodiments of the present disclosure also provide an electronic device, which may be a test device. The electronic device is explained below with reference to fig. 7. It should be understood that the electronic device 700 shown in fig. 7 is only one example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, and a bus 730 that couples the various system components including the memory unit 720 and the processing unit 710.
Where the memory unit stores program code, the program code may be executed by the processing unit 710 such that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention as described in the above-mentioned "exemplary methods" section of this specification. For example, processing unit 710 may perform method steps, etc., as shown in fig. 2.
The memory unit 720 may include volatile memory units such as a random access memory unit (RAM)721 and/or a cache memory unit 722, and may further include a read only memory unit (ROM) 723.
The memory unit 720 may also include programs/utilities 724 having a set (at least one) of program modules 725, such program modules 725 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may include a data bus, an address bus, and a control bus.
The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/O) interface 740. The electronic device 700 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through the network adapter 750. As shown, the network adapter 750 communicates with the other modules of the electronic device 700 over the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit, according to exemplary embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the following claims.

Claims (12)

1. A method of testing a database, the method comprising:
sending a plurality of data operation requests to a test database which is created in advance in a database server;
receiving a request processing result returned by the database server in response to each data operation request;
determining a first performance index value of the database server according to a data operation result in the test database and a first request processing result in a plurality of request processing results, wherein the first request processing result indicates that the database server successfully responds to the data operation request;
and determining a second performance index value of the database server according to a second request processing result in the plurality of request processing results, wherein the second request processing result indicates that the database server does not successfully respond to the data operation request.
2. The method of claim 1, wherein determining a first performance metric value for the database server based on the data operation result in the test database and a first request processing result of the plurality of request processing results comprises:
determining the number of the data operation results;
determining the number of the first request processing results;
and determining a first performance index value of the database server according to the number of the first request processing results and the number of the data operation results.
3. The method of claim 1, wherein determining a second performance metric value for the database server based on a second request processing result of the plurality of request processing results comprises:
determining a first time stamp, wherein the first time stamp is the time stamp of the received second request processing result;
determining a second timestamp, wherein the second timestamp is the timestamp of the first request processing result received after the second request processing result is received;
and determining a second performance index value of the database server according to the second time stamp and the first time stamp.
4. The method of claim 1, wherein after sending a plurality of data operation requests to a pre-created test database in a database server, the method further comprises:
and sending an abnormal operation instruction to the database server so that the database server operates according to the abnormal state corresponding to the abnormal operation instruction.
5. The method according to claim 4, wherein the sending the abnormal operation instruction to the database server to enable the database server to operate according to the abnormal state corresponding to the abnormal operation instruction comprises:
and sending a first abnormal operation instruction to the database server so that the database server operates according to the abnormal state corresponding to the first abnormal operation instruction, wherein the first abnormal operation instruction is used for indicating the database server to operate according to the abnormal state corresponding to the equipment abnormality.
6. The method according to claim 4, wherein the sending the abnormal operation instruction to the database server to enable the database server to operate according to the abnormal state corresponding to the abnormal operation instruction comprises:
and sending a second abnormal operation instruction to the database server so that the database server operates according to an abnormal state corresponding to the second abnormal operation instruction, wherein the second abnormal operation instruction is used for indicating the database server to operate according to an abnormal operation state caused by the abnormal data request behavior of the user.
7. The method of claim 1, wherein after sending a plurality of data operation requests to a pre-created test database in a database server, the method further comprises:
and sending a database operation and maintenance instruction to the database server so that the database server operates according to the operation state corresponding to the database operation and maintenance instruction, wherein the database operation and maintenance instruction is used for indicating the database server to execute database operation and maintenance operation.
8. The method of claim 7, further comprising:
and sending an abnormal operation instruction to the database server so that the database server operates according to the abnormal operation instruction and the abnormal state corresponding to the database operation and maintenance instruction.
9. The method of claim 1, further comprising:
and if the first performance index value and the second performance index value of the database server are determined to meet the test passing condition, determining that the database server passes the test.
10. A database testing apparatus, the apparatus comprising:
the system comprises a sending module, a data processing module and a data processing module, wherein the sending module is configured to send a plurality of data operation requests to a test database which is created in advance in a database server;
the receiving module is configured to receive a request processing result returned by the database server in response to each data operation request;
a first determining module configured to determine a first performance index value of the database server according to a data operation result in the test database and a first request processing result in a plurality of request processing results, wherein the first request processing result indicates that the database server successfully responds to the data operation request;
a second determining module configured to determine a second performance index value of the database server according to a second request processing result of the plurality of request processing results, the second request processing result indicating that the database server does not successfully respond to the data operation request.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1 to 9.
12. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1 to 9 via execution of the executable instructions.
CN202111372132.3A 2021-11-18 2021-11-18 Database test method, device, medium and electronic equipment Pending CN114064435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111372132.3A CN114064435A (en) 2021-11-18 2021-11-18 Database test method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111372132.3A CN114064435A (en) 2021-11-18 2021-11-18 Database test method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114064435A true CN114064435A (en) 2022-02-18

Family

ID=80278340

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111372132.3A Pending CN114064435A (en) 2021-11-18 2021-11-18 Database test method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114064435A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115442443A (en) * 2022-11-03 2022-12-06 之江实验室 Data processing method and device, storage medium and electronic equipment
CN117596187A (en) * 2024-01-19 2024-02-23 融科联创(天津)信息技术有限公司 Server operation and maintenance method, device, equipment and medium based on multi-cloud platform

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115442443A (en) * 2022-11-03 2022-12-06 之江实验室 Data processing method and device, storage medium and electronic equipment
CN117596187A (en) * 2024-01-19 2024-02-23 融科联创(天津)信息技术有限公司 Server operation and maintenance method, device, equipment and medium based on multi-cloud platform
CN117596187B (en) * 2024-01-19 2024-04-30 融科联创(天津)信息技术有限公司 Server operation and maintenance method, device, equipment and medium based on multi-cloud platform

Similar Documents

Publication Publication Date Title
CN108959059B (en) Test method and test platform
KR20200070085A (en) Method and apparatus for processing information
JP2021190089A (en) Fault injection method, apparatus, electronic equipment, storage medium, and program
CN114064435A (en) Database test method, device, medium and electronic equipment
JPWO2009110111A1 (en) Server apparatus, server apparatus abnormality detection method, and server apparatus abnormality detection program
US8495629B2 (en) Virtual machine relocation system and associated methods
CN110784374A (en) Method, device, equipment and system for monitoring operation state of service system
CN111522703A (en) Method, apparatus and computer program product for monitoring access requests
JP2017532660A (en) Automatic tenant upgrade for multi-tenant services
CN111324441A (en) Operating environment switching method and device, computer equipment and storage medium
CN111309570A (en) Pressure testing method, medium, device and computing equipment
CN108418859B (en) Method and device for writing data
CN110569157B (en) Storage testing method, device, server and storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN109639755B (en) Associated system server decoupling method, device, medium and electronic equipment
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN113407451A (en) Test method, device, equipment, storage medium and program product
US9354962B1 (en) Memory dump file collection and analysis using analysis server and cloud knowledge base
CN112463574A (en) Software testing method, device, system, equipment and storage medium
US20120311391A1 (en) Failure data management for a distributed computer system
CN109814911A (en) Method, apparatus, computer equipment and storage medium for Manage Scripts program
CN115687129A (en) Coverage rate report generation method and device, storage medium and computer equipment
CN112965910B (en) Automatic regression testing method and device, electronic equipment and storage medium
CN114978923A (en) Fault drilling method, device and system
CN114238019A (en) Hard disk display method, device, equipment and 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