CN113505073A - Database performance test method, device, equipment and medium - Google Patents

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

Info

Publication number
CN113505073A
CN113505073A CN202110801754.7A CN202110801754A CN113505073A CN 113505073 A CN113505073 A CN 113505073A CN 202110801754 A CN202110801754 A CN 202110801754A CN 113505073 A CN113505073 A CN 113505073A
Authority
CN
China
Prior art keywords
test
database
target
configuration information
performance
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
CN202110801754.7A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110801754.7A priority Critical patent/CN113505073A/en
Publication of CN113505073A publication Critical patent/CN113505073A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • 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/3684Test management for test design, e.g. generating new test cases
    • 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

Abstract

The embodiment of the disclosure relates to a method, a device, equipment and a medium for testing the performance of a database, wherein the method comprises the following steps: acquiring performance test configuration information of a target database; a test task is created according to the performance test configuration information and the target cloud platform, and a deployment test tool is installed in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database; the performance of the target database is tested based on the test tool and the test task. By adopting the technical scheme, the performance test of the database can be realized only by inputting the cloud platform and the configuration information by the tester, and the performance test of the database of different cloud platforms can be realized due to the fact that the interfaces supporting a plurality of cloud platforms are configured in advance, so that the code integration level is high, the maintenance is easy, and the performance test efficiency is improved through a universal test flow.

Description

Database performance test method, device, equipment and medium
Technical Field
The present disclosure relates to the field of database testing technologies, and in particular, to a method, an apparatus, a device, and a medium for testing performance of a database.
Background
The database performance test is a test means for testing database examples by using a test tool according to a prepared test scheme aiming at database products.
In the related art, aiming at the cloud computing field, the implementation is usually performed through manual execution or partial general process scripted execution, but the above scheme has the problems of low test efficiency, and the defects of poor code integration and difficult maintenance caused by different cloud service platforms or test tools in the cloud computing field.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a method, an apparatus, a device, and a medium for testing performance of a database.
The embodiment of the disclosure provides a method for testing the performance of a database, which comprises the following steps:
acquiring performance test configuration information of a target database;
creating a test task according to the performance test configuration information and a target cloud platform, and installing a deployment test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database;
testing the performance of the target database based on the test tool and the test task.
Optionally, the performance test configuration information includes cloud server configuration information and database configuration information.
Optionally, installing and deploying a test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, including:
and calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
Optionally, the cloud server configuration information includes at least one of IP information, login information, grouping information, concurrency information, and test tool parameters of the cloud server.
Optionally, creating a test task according to the performance test configuration information and the target cloud platform includes:
and creating a test task according to database configuration information in the performance test configuration information, wherein the database configuration information comprises configuration information of a plurality of database instances of the target database.
Optionally, testing the performance of the target database based on the test tool and the test task includes:
executing the test task, and creating a plurality of database instances of the target database based on the database configuration information;
and sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
Optionally, creating a plurality of database instances based on the database configuration information includes:
and calling a creating interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances.
Optionally, the calling of the test execution script through the target cloud platform includes:
calling a query interface corresponding to the target cloud platform by adopting a multi-platform interface to acquire connection information of the plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information;
and calling the test execution script based on the connection information of the plurality of database instances.
Optionally, the method further includes:
and sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
Optionally, the method further includes:
and receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete the plurality of database instances.
Optionally, the method further includes:
and sending a test result summarizing instruction to the target cloud platform, executing a test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
The embodiment of the present disclosure further provides a performance testing apparatus for a database, where the apparatus includes:
the configuration information module is used for acquiring performance test configuration information of the target database;
the task and tool module is used for creating a test task according to the performance test configuration information and a target cloud platform, and installing and deploying a test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database;
and the performance testing module is used for testing the performance of the target database based on the testing tool and the testing task.
Optionally, the performance test configuration information includes cloud server configuration information and database configuration information.
Optionally, the task and tool module is specifically configured to:
and calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
Optionally, the cloud server configuration information includes at least one of IP information, login information, grouping information, concurrency information, and test tool parameters of the cloud server.
Optionally, the task and tool module is specifically configured to:
and creating a test task according to database configuration information in the performance test configuration information, wherein the database configuration information comprises configuration information of a plurality of database instances of the target database.
Optionally, the performance testing module includes:
the instance creating unit is used for executing the test task and creating a plurality of database instances of the target database based on the database configuration information;
and the test execution unit is used for sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
Optionally, the instance creating unit is configured to:
and calling a creating interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances.
Optionally, the test execution unit is configured to:
calling an inquiry interface corresponding to the target cloud platform by adopting a multi-platform interface to acquire connection information of the plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information;
and calling the test execution script based on the connection information of the plurality of database instances.
Optionally, the apparatus further includes a test termination module, configured to:
and sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
Optionally, the apparatus further includes an instance deletion module, configured to:
and receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete the plurality of database instances.
Optionally, the apparatus further includes a test result module, configured to:
and sending a test result summarizing instruction to the target cloud platform, executing a test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
An embodiment of the present disclosure further provides an electronic device, which includes: a processor; a memory for storing the processor-executable instructions; the processor is used for reading the executable instructions from the memory and executing the instructions to realize the performance test method of the database provided by the embodiment of the disclosure.
The embodiment of the disclosure also provides a computer-readable storage medium, which stores a computer program for executing the performance testing method of the database provided by the embodiment of the disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: according to the performance test scheme of the database provided by the embodiment of the disclosure, performance test configuration information of a target database is acquired; a test task is created according to the performance test configuration information and the target cloud platform, and a deployment test tool is installed in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database; the performance of the target database is tested based on the test tool and the test task. By adopting the technical scheme, the performance test of the database can be realized only by inputting the cloud platform and the configuration information by the tester, and the performance test of the database of different cloud platforms can be realized due to the fact that the interfaces supporting a plurality of cloud platforms are configured in advance, so that the code integration level is high, the maintenance is easy, and the performance test efficiency is improved through a universal test flow.
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.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for testing performance of a database according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another method for testing performance of a database according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a performance testing entry of a database according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a performance testing apparatus for a database according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The database performance test is a test means for testing database examples by using a test tool according to a prepared test scheme aiming at database products. For the database performance test under the common environment, a developer only needs to pay attention to the type selection of a test tool, the installation and the deployment of the test tool on a server, the adjustment of test parameters, the continuous performance observation, the result summarization and the like, and one-time performance test can be completed based on the type selection, the installation and the deployment of the test tool on the server, the performance continuous observation, the result summarization and the like. For the cloud computing industry, the type selection of a developer for a cloud server can be realized based on a cloud platform, and a database instance of a database to be tested generates 1 to n quantitative changes due to lots of packages, specifications or versions of the cloud database, that is, performance tests with almost completely consistent processes are evolved into n performance tests due to different database instances. In the whole cloud computing industry, a plurality of cloud platforms provided by cloud service providers exist, and when the performance of the same database is compared, the quantity of n to m x n generated by different cloud platforms is changed, and m is the quantity of the cloud platforms.
In the related art, in the field of cloud computing, testing is usually completed by manually executing m × n tests, and subsequent testing is completed by manually executing a part of general processes in a scripted manner, or testing is completed by executing m × n tests even though automatic execution is possible. In order to solve the above technical problem, embodiments of the present disclosure provide a method for testing performance of a database, and the method is described below with reference to specific embodiments.
Fig. 1 is a schematic flowchart of a method for testing performance of a database according to an embodiment of the present disclosure, where the method may be performed by a device for testing performance of a database, where the device may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 1, the method includes:
step 101, obtaining performance test configuration information of a target database.
The target database may be a database that needs to be subjected to a performance test, for example, the target database may be a key value database Redis, a document database MongoDB, a column database infiluxdb, and the like, which is not limited in this disclosure. The performance test configuration information may include cloud server configuration information and database configuration information, that is, the performance test configuration information may be configuration information related to a database and configuration information related to a cloud server, which are required when the database is tested.
Specifically, the performance testing device of the database may obtain the performance testing configuration information of the target database configured by the tester for subsequent use.
Step 102, creating a test task according to the performance test configuration information and the target cloud platform, and installing and deploying a test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform.
The target cloud platform may be a platform for providing cloud services corresponding to a target database, and different cloud platforms correspond to the same database with different codes and specifications. The test task may be a task for performing a performance test on the target database, where the test task may be used to call an interface of the target cloud platform to create and test multiple database instances of the target database, and specifically may call an interface of the target cloud platform based on a multi-platform interface, where the multi-platform interface may be a general interface or an interface function that supports calling related functional interfaces of multiple cloud platforms, and the multiple database instances of the target database may be instances of the target database under different specifications, and may include instances of different memories, for example.
The test tool may be a tool for testing performance of a database, and different databases may be tested using different test tools, for example, the test tool corresponding to Redis may include Redis-benchmark, Memtier _ benchmark, Ycsb for Redis, and the like; the testing tool corresponding to MongoDB can be Ycsb for MongoDB; the testing tool corresponding to InfluxDB may be Influx-stress, for example only.
In this embodiment, creating a test task according to the performance test configuration information and the target cloud platform includes: and creating a test task according to the database configuration information in the performance test configuration information, wherein the database configuration information comprises the configuration information of a plurality of database instances of the target database.
The database configuration information may be used to represent rules of multiple instances of a target database that needs to be subjected to performance testing, that is, may include configuration information of multiple database instances, for example, the configuration information of one database instance may be a Central Processing Unit (CPU) single core plus a memory 2G, and the configuration information of another database instance may be a CPU double core plus a memory 4G. Specifically, after the performance testing device of the database acquires the performance testing configuration information, a testing task may be created according to the database configuration information, and one database instance may correspond to one testing task.
In this embodiment, installing and deploying a test tool in a cloud server of a target cloud platform according to the performance test configuration information and the target cloud platform may include: and calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
The tool deployment script can be a functional script written by a shell, and the scripts corresponding to different databases are different. The cloud server configuration information includes at least one of IP information, login information, grouping information, concurrency information, and test tool parameters of the cloud server. The IP information of the cloud server may be an IP address corresponding to the cloud server. The login information may include a login password, and when the number of the cloud servers is multiple, the login passwords of the multiple cloud servers may be set to be the same. The grouping information may be related information for performing group assignment on the plurality of cloud servers, and for example, the grouping information may include the number of groups. The concurrent information may be a concurrent execution count set for each group of cloud servers, and may be specifically set according to an actual situation, for example, the concurrent execution count may be set to 3, and at this time, each group of cloud servers concurrently execute 3 test tasks.
Specifically, the performance testing device of the database calls a tool deployment script corresponding to the target database by using a multi-database interface written by python, and installs and deploys a testing tool corresponding to the target database in one or more cloud servers of the target cloud platform according to the configuration information of the cloud servers. The multi-database interface may be an interface that supports the invocation of functional scripts of multiple databases, and may be pre-programmed and configured.
Optionally, the performance testing apparatus of the database may further designate a cloud server in the target cloud platform as a test controller for performing a subsequent test, and upload a preset functional script file of the target database to the test controller.
It can be understood that the test task creation and the test tool installation and deployment in the cloud server of the target cloud platform may be executed concurrently or sequentially, and are not limited specifically.
Step 103, testing the performance of the target database based on the test tool and the test task.
After creating a test task and installing and deploying a test tool in a cloud server of the target cloud platform, the performance testing device of the database may test the performance of a plurality of database instances of the target database based on the test tool and the test task in each cloud server.
In this embodiment, testing the performance of the target database based on the test tool and the test task may include: executing a test task, and creating a plurality of database instances of a target database based on the database configuration information; and sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
The performance testing device of the database can receive a testing starting instruction of a tester, execute each testing task, and create a plurality of database instances of the target database according to the database configuration information corresponding to each testing task. Optionally, creating a plurality of database instances based on the database configuration information may include: and calling a creation interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances. The creation interface may be an interface for creating an instance of a database, and the creation interfaces corresponding to different databases may be different. Specifically, the creation interface may be called based on the database configuration information to generate the creation request parameters of all the plurality of database instances by using a cartesian product function, and then create the plurality of database instances according to the creation request parameters.
After the plurality of database instances are created, a test starting instruction can be sent to a test controller in the target cloud platform, so that the test controller calls a test execution script to control performance testing between the cloud server and the plurality of database instances, and the test process can be realized based on a test tool installed and deployed in the cloud server.
Optionally, the invoking of the test execution script by the target cloud platform may include: calling an inquiry interface corresponding to a target cloud platform by adopting a multi-platform interface to acquire connection information of a plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information; and calling the test execution script based on the connection information of the plurality of database instances.
Specifically, the performance testing apparatus of the database may use a multi-platform interface to call an inquiry interface corresponding to a target cloud platform to inquire connection information of multiple database instances created before, where the connection information may be related information for performing data interaction with the database instances, for example, the connection information may include at least one of an IP address, port information, user information, and the like, and the user information may include a user name, a password, and the like. Then, after receiving the test start instruction, the test controller in the target cloud platform may call a test execution script corresponding to the target database based on the connection information of the multiple database instances to perform a performance test.
In some embodiments, the method for testing the performance of the database may further include: and sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
Specifically, in the test process, the performance test device of the database may receive a test termination instruction sent by a tester, and send the test termination instruction to the test controller in the target cloud platform, and the test controller may call a test termination script of the target database to control the plurality of cloud servers to terminate the ongoing test.
In the scheme, the test can be terminated at any time according to the requirement in the process of testing the performance of the database, so that the flexibility of performance test control is improved, and the actual requirement is met better.
In some embodiments, the method for testing the performance of the database may further include: and receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete a plurality of database instances. Specifically, after the test of each cloud server is completed, the performance testing device of the database can receive the test completion instruction sent by the performance testing device, and call the deletion interface corresponding to the target cloud platform by using the multi-platform interface, so as to delete a plurality of database instances, thereby completing the test task.
The performance test in this embodiment may be a process of accessing the database instances on one or more cloud servers by using corresponding test tools for one or more database instances of one database, summarizing test results of the cloud servers, and obtaining a final test result. In some embodiments, the method for testing the performance of the database may further include: and sending a test result summarizing instruction to the target cloud platform, executing the test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
Specifically, after the test task is completed, the performance test device of the database can receive a test result summarizing instruction sent by a tester, send the test result summarizing instruction to the test controller in the target cloud platform, and the test controller can call the test result summarizing script of the target database to obtain the test result of a single test task stored in each cloud server, summarize the test result, and return the summarized test result to the performance test device of the database to return the summarized test result to the tester. According to the scheme, after the test is completed, the test results of the plurality of test tasks can be collected and returned to the user, the user can be helped to know the test results intuitively, and the test efficiency is improved.
According to the performance test scheme of the database provided by the embodiment of the disclosure, performance test configuration information of a target database is acquired; a test task is created according to the performance test configuration information and the target cloud platform, and a deployment test tool is installed in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database; the performance of the target database is tested based on the test tool and the test task. By adopting the technical scheme, the performance test of the database can be realized only by inputting the cloud platform and the configuration information by the tester, and the performance test of the database of different cloud platforms can be realized due to the fact that the interfaces supporting a plurality of cloud platforms are configured in advance, so that the code integration level is high, the maintenance is easy, and the performance test efficiency is improved through a universal test flow.
Fig. 2 is a schematic flow chart of another database performance testing method according to an embodiment of the present disclosure, and the embodiment further optimizes the database performance testing method based on the above embodiment. As shown in fig. 2, the method includes:
step 201, obtaining performance test configuration information of the target database.
The performance test configuration information comprises cloud server configuration information and database configuration information.
After step 201, step 202 and step 203 may be executed, the specific execution sequence is not limited, step 202 may be executed first and then step 203 may be executed, or step 203 may be executed first and then step 202 may be executed,
Step 202, calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
The cloud server configuration information comprises at least one of IP information, login information, grouping information, concurrency information and test tool parameters of the cloud server.
And step 203, creating a test task according to the database configuration information in the performance test configuration information.
The testing task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database. The database configuration information includes configuration information for a plurality of database instances of the target database.
Step 204, executing the test task, and creating a plurality of database instances of the target database based on the database configuration information.
Optionally, creating a plurality of database instances based on the database configuration information includes: and calling a creation interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances.
And 205, sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
Optionally, the invoking of the test execution script by the target cloud platform includes: calling an inquiry interface corresponding to a target cloud platform by adopting a multi-platform interface to acquire connection information of a plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information; and calling the test execution script based on the connection information of the plurality of database instances.
After step 205, step 206 or steps 207-208 may be executed, which may be determined according to actual situations.
And step 206, sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
And step 207, receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by using the multi-platform interface to delete the plurality of database instances.
And 208, sending a test result summarizing instruction to the target cloud platform, executing the test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
The method for testing the performance of the database provided by the embodiment of the present disclosure is further described below by a specific example. Fig. 3 is a schematic diagram of a performance test entry of a database according to an embodiment of the present disclosure, as shown in fig. 3, an entry interface for helping a tester complete a performance test of the database is shown, where the entry interface may include a scheduling module, a task executor, and a multi-platform interface. The multi-platform interface can be a general calling interface written based on python, is open to testers, can call functional interfaces open to a database of different cloud platforms by using the interface, and comprises a creation interface, an inquiry interface, a deletion interface and the like, and is used for achieving creation, inquiry and deletion of database instances based on database configuration information, namely achieving life cycle management of the database instances of the cloud platforms and enabling the database instances to be used in testing. The database configuration information can be configured in advance by a tester, can also be configured in real time, and can be maintained by json for use in instance management. The figure exemplarily shows three cloud platforms, including a cloud platform a, a cloud platform B, and a cloud platform C.
The task executor in the figure can be responsible for deployment of a test tool, generation and implementation of the test task and test result collection, and the task executor can include a plurality of function scripts written by using a shell, such as a tool deployment script, a test execution script, a test termination script and a result collection script in the figure, and can respectively complete remote installation and deployment of the test tool for a single cloud server, remote execution of the test task for a plurality of cloud servers, remote termination and collection of the test result. In this embodiment, the task executor may further include a multi-database call interface written by python and used for calling the shell script at the corresponding stage, and the multi-database call interface is used for realizing the call of different function scripts of different databases.
As shown in fig. 3, the scheduling module may include cloud server configuration information and multiple entries for testing. The cloud server configuration information can be pre-configured by a tester and read from an uploaded ini-format configuration file, or can be configured in real time, and the installation and deployment of the test tool can be realized based on the cloud server configuration information.
The test entry may be written using python, and may include generation of a test task (generation), installation and deployment of a test tool (deployment), Start of a test (Start), termination of a test (Stop), Summary of a test result (Summary), and the like in the diagram, which respectively implement corresponding functions. After the test is started to be triggered, the concurrent test can be implemented by using multiple threads, for example, 8 cloud servers can be divided into 2 groups, each group measures three database instances simultaneously, and then 2 × 3 threads can be started to execute the test.
Based on the entry of the performance test shown in fig. 3, the performance test process of the database may include: 1. in the configuration information of the cloud server of the scheduling module, the IP address and the password of the cloud server are set, usually a plurality of cloud servers are set, and the passwords are the same, and 1 cloud server can be designated as a test controller for subsequent performance tests. 2. And installing and deploying the test tool through the scheduling module, installing and deploying the specified test tool of the target database on the cloud server set in the configuration information of the cloud server, and uploading the script file corresponding to the task executor to the test controller. 3. In the database configuration information, configuration information of a plurality of database instances of the target database is set. 4. And generating a test task according to the database configuration information by triggering the test task generated in the scheduling module.
5. By triggering the start of the test in the scheduling module, the following operations are performed according to each test task: (1) executing the test task, and obtaining database configuration information from the test task; (2) calling a creation interface of the current target cloud platform through a multi-platform interface, and creating a plurality of database instances corresponding to the database configuration information; (3) after the database instance is established, calling a query interface through a multi-platform interface, and querying connection information of the database instance, wherein the connection information specifically comprises an IP address, a port number, a user name, a password and the like; (4) sending a test starting instruction to the target cloud platform, informing a test controller in the target cloud platform, and calling a test execution script based on the connection information of the database example; (5) the test controller can inform all the cloud servers to start performance testing, and test tools which are installed and deployed in advance are used in the testing process; (6) after the test of each cloud server is finished, the test result is temporarily stored on the cloud server; (7) after all the cloud servers are tested, calling a deleting interface through the multi-platform interface to delete the database instance; (8) and finishing the current testing task.
6. In the testing process, the ongoing testing task can be terminated at any time through triggering the test termination in the scheduling module, and the termination process performs the following operations: and sending a test termination instruction to the test controller, and informing the test controller to call a test termination script so as to inform all the cloud servers of terminating the test.
7. And waiting for the test tasks to be completed, and obtaining the test results of all the test tasks by triggering the test result summary in the scheduling module, wherein the summary process can perform the following operations: (1) sending a test result summarizing instruction to the test controller, and calling a test result summarizing script; (2) in the test result summarizing script, the test controller collects the test results of a single test task from all the cloud servers, calculates the test results to obtain the final result of the test task, and writes the final test results of all the test tasks into a result file by analogy; (3) and obtaining a final result file.
According to the scheme, a set of universal performance test integration scheme is provided, under the scenes of a cloud platform, a database, a test tool and a plurality of test specifications, a relatively universal and easily-understood automatic test process is provided, developers only need to pay attention to the calling mode of a corresponding Application Programming Interface (API) or Software Development Kit (SDK) of the life cycle of the cloud platform, example configuration information required by testing and the deployment and use of the test tool on a cloud server, so that the developers can concentrate on the test task and conveniently develop automation, and the working efficiency of performance testing is improved.
According to the performance test scheme of the database provided by the embodiment of the disclosure, the performance test configuration information of a target database is obtained, a tool deployment script corresponding to the target database is called according to the cloud server configuration information in the performance test configuration information, and a test tool is installed and deployed in one or more cloud servers of a target cloud platform; creating a test task according to the database configuration information in the performance test configuration information; executing a test task, creating a plurality of database instances of a target database based on database configuration information, sending a test starting instruction to a target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server; sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test; or receiving a test completion instruction, calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete a plurality of database instances, sending a test result summarizing instruction to the target cloud platform, executing a test result summarizing script through the target cloud platform to obtain and summarize test results stored in the cloud server, and returning the summarized test results. By adopting the technical scheme, the performance test of the database can be realized only by inputting the cloud platform and the configuration information by the tester, and the performance test of the database of different cloud platforms can be realized due to the fact that the interfaces supporting a plurality of cloud platforms are configured in advance, so that the code integration level is high, the maintenance is easy, and the performance test efficiency is improved through a universal test flow.
Fig. 4 is a schematic structural diagram of a performance testing apparatus for a database according to an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 4, the apparatus includes:
a configuration information module 301, configured to obtain performance test configuration information of the target database;
a task and tool module 302, configured to create a test task according to the performance test configuration information and a target cloud platform, and install and deploy a test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, where the test task is used to invoke an interface of the target cloud platform to create and test multiple database instances of the target database;
a performance testing module 303, configured to test performance of the target database based on the testing tool and the testing task.
Optionally, the performance test configuration information includes cloud server configuration information and database configuration information.
Optionally, the task and tool module 302 is specifically configured to:
and calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
Optionally, the cloud server configuration information includes at least one of IP information, login information, grouping information, concurrency information, and test tool parameters of the cloud server.
Optionally, the task and tool module 302 is specifically configured to:
and creating a test task according to database configuration information in the performance test configuration information, wherein the database configuration information comprises configuration information of a plurality of database instances of the target database.
Optionally, the performance testing module 303 includes:
the instance creating unit is used for executing the test task and creating a plurality of database instances of the target database based on the database configuration information;
and the test execution unit is used for sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
Optionally, the instance creating unit is configured to:
and calling a creating interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances.
Optionally, the test execution unit is configured to:
calling an inquiry interface corresponding to the target cloud platform by adopting a multi-platform interface to acquire connection information of the plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information;
and calling the test execution script based on the connection information of the plurality of database instances.
Optionally, the apparatus further includes a test termination module, configured to:
and sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
Optionally, the apparatus further includes an instance deletion module, configured to:
and receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete the plurality of database instances.
Optionally, the apparatus further includes a test result module, configured to:
and sending a test result summarizing instruction to the target cloud platform, executing a test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
The performance testing device for the database provided by the embodiment of the disclosure can execute the performance testing method for the database provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 5, the electronic device 400 includes one or more processors 401 and memory 402.
The processor 401 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
Memory 402 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 401 to implement the performance testing methods of the databases of the embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 403 may also include, for example, a keyboard, a mouse, and the like.
The output device 404 may output various information to the outside, including the determined distance information, direction information, and the like. The output devices 404 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 400 relevant to the present disclosure are shown in fig. 5, omitting components such as buses, input/output interfaces, and the like. In addition, electronic device 400 may include any other suitable components depending on the particular application.
In addition to the above methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform a method of performance testing of a database provided by embodiments of the present disclosure.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure 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.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the performance testing method of a database provided by embodiments of the present disclosure.
The computer-readable storage medium may take 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 include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (14)

1. A performance testing method of a database is characterized by comprising the following steps:
acquiring performance test configuration information of a target database;
creating a test task according to the performance test configuration information and a target cloud platform, and installing a deployment test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database;
testing the performance of the target database based on the test tool and the test task.
2. The method of claim 1, wherein the performance test configuration information comprises cloud server configuration information and database configuration information.
3. The method of claim 2, wherein installing a deployment test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform comprises:
and calling a tool deployment script corresponding to the target database according to the cloud server configuration information in the performance test configuration information, and installing and deploying the test tool in one or more cloud servers of the target cloud platform.
4. The method of claim 2, wherein the cloud server configuration information comprises at least one of IP information, login information, group information, concurrency information, and test tool parameters of a cloud server.
5. The method of claim 2, wherein creating a test task according to the performance test configuration information and a target cloud platform comprises:
and creating a test task according to database configuration information in the performance test configuration information, wherein the database configuration information comprises configuration information of a plurality of database instances of the target database.
6. The method of claim 1, wherein testing the performance of the target database based on the test tool and the test task comprises:
executing the test task, and creating a plurality of database instances of the target database based on the database configuration information;
and sending a test starting instruction to the target cloud platform, and calling a test execution script through the target cloud platform so as to control the cloud server and the plurality of database instances to execute performance tests based on a test tool in the cloud server.
7. The method of claim 6, wherein creating a plurality of database instances based on the database configuration information comprises:
and calling a creating interface corresponding to the target cloud platform by adopting a multi-platform interface based on the database configuration information, and creating a plurality of database instances.
8. The method of claim 6, wherein invoking, by the target cloud platform, a test execution script comprises:
calling a query interface corresponding to the target cloud platform by adopting a multi-platform interface to acquire connection information of the plurality of database instances, wherein the connection information comprises at least one of IP information, port information and user information;
and calling the test execution script based on the connection information of the plurality of database instances.
9. The method of claim 6, further comprising:
and sending a test termination instruction to the target cloud platform, and calling a test termination script through the target cloud platform to control the cloud server to terminate the performance test.
10. The method of claim 6, further comprising:
and receiving a test completion instruction, and calling a deletion interface corresponding to the target cloud platform by adopting a multi-platform interface to delete the plurality of database instances.
11. The method of claim 6, further comprising:
and sending a test result summarizing instruction to the target cloud platform, executing a test result summarizing script through the target cloud platform to obtain and summarize the test results stored in the cloud server, and returning the summarized test results.
12. A database performance testing apparatus, comprising:
the configuration information module is used for acquiring performance test configuration information of the target database;
the task and tool module is used for creating a test task according to the performance test configuration information and a target cloud platform, and installing and deploying a test tool in a cloud server of the target cloud platform according to the performance test configuration information and the target cloud platform, wherein the test task is used for calling an interface of the target cloud platform to create and test a plurality of database instances of the target database;
and the performance testing module is used for testing the performance of the target database based on the testing tool and the testing task.
13. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the performance testing method of the database of any one of the claims 1-11.
14. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the method for testing the performance of a database according to any of the claims 1-11.
CN202110801754.7A 2021-07-15 2021-07-15 Database performance test method, device, equipment and medium Pending CN113505073A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110801754.7A CN113505073A (en) 2021-07-15 2021-07-15 Database performance test method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110801754.7A CN113505073A (en) 2021-07-15 2021-07-15 Database performance test method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN113505073A true CN113505073A (en) 2021-10-15

Family

ID=78012903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110801754.7A Pending CN113505073A (en) 2021-07-15 2021-07-15 Database performance test method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113505073A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114968748A (en) * 2022-07-29 2022-08-30 北京奥星贝斯科技有限公司 Database testing method, system and device
CN115174158A (en) * 2022-06-14 2022-10-11 阿里云计算有限公司 Cloud product configuration checking method based on multi-cloud management platform
CN117596174A (en) * 2023-12-11 2024-02-23 中国铁塔股份有限公司北京市分公司 Iron tower video data cloud transmission adjustment and measurement method, system and medium
CN117596174B (en) * 2023-12-11 2024-05-14 中国铁塔股份有限公司北京市分公司 Iron tower video data cloud transmission adjustment and measurement method, system and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103795582A (en) * 2012-10-30 2014-05-14 上海今日在线科技发展有限公司 Test method realized based on cloud service platform
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports
CN109240662A (en) * 2018-08-09 2019-01-18 赛尔网络有限公司 A kind of software development methodology based on cloud platform, cloud platform, equipment and medium
CN109547514A (en) * 2017-09-22 2019-03-29 北京金山云网络技术有限公司 A kind of task processing method, device, electronic equipment and storage medium
CN109783348A (en) * 2018-12-06 2019-05-21 中国电力科学研究院有限公司 Testing tool method for managing resource based on cloud platform, system
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium
CN111124850A (en) * 2019-11-12 2020-05-08 上海移远通信科技有限公司 MQTT server performance testing method, system, computer equipment and storage medium
CN112286786A (en) * 2019-07-24 2021-01-29 北京金山云网络技术有限公司 Database testing method and device and server

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103795582A (en) * 2012-10-30 2014-05-14 上海今日在线科技发展有限公司 Test method realized based on cloud service platform
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports
CN109547514A (en) * 2017-09-22 2019-03-29 北京金山云网络技术有限公司 A kind of task processing method, device, electronic equipment and storage medium
CN109240662A (en) * 2018-08-09 2019-01-18 赛尔网络有限公司 A kind of software development methodology based on cloud platform, cloud platform, equipment and medium
CN109783348A (en) * 2018-12-06 2019-05-21 中国电力科学研究院有限公司 Testing tool method for managing resource based on cloud platform, system
CN110389900A (en) * 2019-07-10 2019-10-29 深圳市腾讯计算机系统有限公司 A kind of distributed experiment & measurement system test method, device and storage medium
CN112286786A (en) * 2019-07-24 2021-01-29 北京金山云网络技术有限公司 Database testing method and device and server
CN111124850A (en) * 2019-11-12 2020-05-08 上海移远通信科技有限公司 MQTT server performance testing method, system, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174158A (en) * 2022-06-14 2022-10-11 阿里云计算有限公司 Cloud product configuration checking method based on multi-cloud management platform
CN115174158B (en) * 2022-06-14 2024-04-16 阿里云计算有限公司 Cloud product configuration checking method based on multi-cloud management platform
CN114968748A (en) * 2022-07-29 2022-08-30 北京奥星贝斯科技有限公司 Database testing method, system and device
CN114968748B (en) * 2022-07-29 2022-10-21 北京奥星贝斯科技有限公司 Database testing method, system and device
CN117596174A (en) * 2023-12-11 2024-02-23 中国铁塔股份有限公司北京市分公司 Iron tower video data cloud transmission adjustment and measurement method, system and medium
CN117596174B (en) * 2023-12-11 2024-05-14 中国铁塔股份有限公司北京市分公司 Iron tower video data cloud transmission adjustment and measurement method, system and medium

Similar Documents

Publication Publication Date Title
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN105302722B (en) CTS automatic testing method and device
WO2007099058A2 (en) Software testing automation framework
CN109558320B (en) System testing method, device, system, equipment and computer readable storage medium
CN113505073A (en) Database performance test method, device, equipment and medium
CN113312064B (en) Method and device for installing and configuring physical machine and computer readable medium
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN111026670A (en) Test case generation method, test case generation device, and storage medium
CN111475390A (en) Log collection system deployment method, device, equipment and storage medium
CN111462811A (en) Automatic testing method and device, storage medium and electronic equipment
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN115904959A (en) Software integration and deployment method and software development management system
CN111459504A (en) Intelligent contract processing method, device, equipment and storage medium
CN110928777A (en) Test case processing method, device, equipment and storage medium
CN110187890B (en) Project deployment method, electronic equipment and storage medium
CN110955449A (en) Method and device for releasing gray scale of client
CN114528214A (en) Unit testing method and device
CN114936152A (en) Application testing method and device
CN111581081B (en) Automatic test system and method
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN110928798A (en) Code testing method, device and equipment
CN111506490A (en) Automatic test method and device for application service interface and storage medium
US10303531B2 (en) Console application through web service
KR100404908B1 (en) Apparatus and method for testing interfaces of enterprise javabeans components
CN113660133B (en) Simulation test system and method supporting SaaS mode

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