CN116048975A - Database testing method and device, electronic equipment and storage medium - Google Patents

Database testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116048975A
CN116048975A CN202211729679.9A CN202211729679A CN116048975A CN 116048975 A CN116048975 A CN 116048975A CN 202211729679 A CN202211729679 A CN 202211729679A CN 116048975 A CN116048975 A CN 116048975A
Authority
CN
China
Prior art keywords
test
database
tested
testing
core parameter
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
CN202211729679.9A
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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202211729679.9A priority Critical patent/CN116048975A/en
Publication of CN116048975A publication Critical patent/CN116048975A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

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

Abstract

The embodiment of the invention provides a database testing method, a database testing device, electronic equipment and a storage medium, and relates to the field of computer database management systems. In the embodiment of the invention, the shell script can be written by using a benchmark test tool, and the quantitative, reproducible and comparable OLTP test can be automatically performed on the performance indexes of the database. Analyzing the sysbench reference test result after the reference test is finished, and extracting key indexes such as TPS, QPS, response time, concurrency and the like; meanwhile, in the embodiment of the invention, prometheus Exporter monitoring service is also accessed to provide operation indexes (such as cpu utilization rate, memory utilization rate, disk uteil and other monitoring data) of the host machine during database test, the key indexes and the data are stored in the database, and corresponding test reports are automatically generated. The technical scheme provided by the embodiment of the invention is simple and efficient, the data comparison is clear and visual, and the time cost of the reference test of the database by technicians can be effectively reduced.

Description

Database testing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of computer database management systems, in particular to a database testing method, a database testing device, electronic equipment and a storage medium.
Background
A cloud database is a database service that is built, deployed, and delivered through a cloud platform. It is essentially a cloud platform-as-a-service (PaaS) delivery model that allows organizations, end users and their applications to store, manage and retrieve data from the cloud. Before delivering cloud database services, each cloud manufacturer performs performance benchmark tests on the database and provides database benchmark test reports. The database benchmark report is helpful for operation staff to analyze the performance of the database under the current configuration (including hardware configuration, operating system, database setting, etc.), so as to find out the performance threshold of the database and adjust the configuration according to the requirements of the actual system.
The main test schemes in the industry are: the tester uses a benchmark tool such as sysbench, mysqlslap to record key indexes such as TPS, QPS, response time, concurrency and the like, and generates a benchmark report. However, this test scheme has the following disadvantages: 1) The test personnel is required to preset a script in advance or manually input a plurality of test commands, and finally, the test results of various scenes are recorded manually. 2) Typical database benchmarking lacks monitoring of host hardware aspects such as cpu utilization, memory utilization, disk util, etc. during testing.
Thus, a new database testing method is needed.
Disclosure of Invention
The embodiment of the invention provides a database testing method, a database testing device, electronic equipment and a storage medium, which are used for at least partially solving the problems in the related art.
An embodiment of the present invention provides a database testing method, where the method includes:
receiving test core parameter item configuration aiming at a database to be tested;
executing a sysbench script, testing the database to be tested according to the test core parameter item, and collecting operation indexes of a host machine during the test;
and outputting a database test result of the database to be tested and running indexes of the host machine during the test.
Optionally, the method further comprises:
installing a sysbench for testing the database; and installing Prometa and Node Exporter for collecting operation index of host during test.
Optionally, executing the sysbank script, and testing the database to be tested according to the test core parameter item, including:
preparing test data according to the test core parameter item;
running a test model based on the test data;
the test data obtained by the test model are arranged;
and generating a sysbank test result file.
Optionally, the method further comprises:
analyzing the sysbench test result file, and filtering and extracting the result key data to obtain a complete yaml format test result;
and analyzing the yaml format test data to obtain a database test result.
Optionally, the test core parameter item includes at least: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
Optionally, the database test result at least includes: the number of transactions executed per second, the number of SQL executed per second, the response time, the concurrency, the total number of reads, the total number of writes, the total number of other operations, the number of errors, the number of reconnections, the run time, and the average time consumption.
Optionally, outputting a database test result of the database to be tested and an operation index of the host during the test, including:
and aggregating the database test results into a table and displaying, and aggregating the operation indexes of the host machine during the test into a line graph and displaying.
Optionally, the method further comprises:
receiving new test core parameter item configuration aiming at the database to be tested;
according to the new test core parameter item, testing the database to be tested, and collecting operation indexes of a host machine during testing;
outputting new database test results and running indexes of the host machine during the test;
summarizing and outputting the database test result of the database to be tested and the new database test result;
and summarizing and outputting the operation indexes of the host machine during the test.
A second aspect of an embodiment of the present invention provides a database testing apparatus, the apparatus including:
the first receiving module is used for receiving test core parameter item configuration aiming at the database to be tested;
the first test module is used for executing a sysbank script, testing the database to be tested according to the test core parameter item, and collecting the operation index of the host machine during the test;
the first output module is used for outputting database test results of the database to be tested and operation indexes of the host machine during the test.
Optionally, the apparatus further comprises:
the installation module is used for installing a sysbank and testing the database; and installing Prometa and Node Exporter for collecting operation index of host during test.
Optionally, the first test module is specifically configured to:
preparing test data according to the test core parameter item;
running a test model based on the test data;
the test data obtained by the test model are arranged;
and generating a sysbank test result file.
Optionally, the apparatus further comprises:
the first analysis module is used for analyzing the sysbank test result file, filtering and extracting the result key data to obtain a complete yaml format test result;
the second analysis module is used for analyzing the yaml format test data to obtain a database test result.
Optionally, the test core parameter item includes at least: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
Optionally, the database test result at least includes: the number of transactions executed per second, the number of SQL executed per second, the response time, the concurrency, the total number of reads, the total number of writes, the total number of other operations, the number of errors, the number of reconnections, the run time, and the average time consumption.
Optionally, the output module is specifically configured to:
and aggregating the database test results into a table and displaying, and aggregating the operation indexes of the host machine during the test into a line graph and displaying.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving new test core parameter item configuration aiming at the database to be tested;
the second test module is used for testing the database to be tested according to the new test core parameter item, and collecting the operation index of the host machine during the test;
the second output module is used for outputting new database test results and running indexes of the host machine during the test;
the summarizing module is used for summarizing and outputting the database test result of the database to be tested and the new database test result;
and the third output module is used for summarizing and outputting the operation indexes of the host machine during the test period.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to the first aspect of the present invention.
A fourth aspect of the embodiments of the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed implements the steps of the method according to the first aspect of the invention.
In the embodiment of the invention, the shell script can be written by using a benchmark test tool, and the quantitative, reproducible and comparable OLTP test can be automatically performed on the performance indexes of the database. Analyzing the sysbench reference test result after the reference test is finished, and extracting key indexes such as TPS, QPS, response time, concurrency and the like; meanwhile, in the embodiment of the invention, prometheus Exporter monitoring service is also accessed to provide operation indexes (such as cpu utilization rate, memory utilization rate, disk uteil and other monitoring data) of the host machine during database test, the key indexes and the data are stored in the database, and corresponding test reports are automatically generated. The technical scheme provided by the embodiment of the invention is simple and efficient, the data comparison is clear and visual, and the time cost of the reference test of the database by technicians can be effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a database testing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of another database testing method according to an embodiment of the present invention;
fig. 3 is a block diagram of a database testing apparatus according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a flowchart of a database testing method according to an embodiment of the present invention is shown, where the database testing method provided by the embodiment of the present invention is applied to a database testing host, and the database testing method provided by the embodiment of the present invention may include the following steps:
s101, receiving test core parameter item configuration aiming at a database to be tested.
In the embodiment of the invention, a technician can firstly determine the database to be tested, thereby determining the key parameters of the database to be tested.
In the embodiment of the present invention, a technician may further configure a test core parameter for the database to be tested, where in the embodiment of the present invention, the test core parameter item at least includes: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
Therefore, in the embodiment of the invention, the pressure test can be performed on the database to be tested based on the configuration of the test core parameter item aiming at the database to be tested.
Specifically, in the embodiment of the present invention, a technician may select, through a web page on a database test host, a name of a database to be tested during a sysbank pressure test, and a test core parameter item, for example, a common test core parameter item for sysbank, such as a test specified lua pressure test script, a record line number generated by each table of oltp-table-size, a number of table tables of oltp-tables-count, a number of concurrent threads of num-threads=12, and the like, which is specifically shown in table 1.
TABLE 1
Figure BDA0004031049180000071
Optionally, in the embodiment of the present invention, a technician may configure the test core parameter item strip by strip through a web page on the database test host. The test core parameter items corresponding to various common test scenes can be configured on the database test host, so that technicians can directly select according to the test scenes required by the current database to be tested, and the configuration of the test core parameter items is directly completed, so that the method is simpler and more convenient.
S102, executing a sysbench script, testing the database to be tested according to the test core parameter item, and collecting operation indexes of the host machine during the test.
The sysbench is a modularized, cross-platform and multi-thread benchmark test tool and is mainly used for evaluating and testing the load condition of a database under various system parameters. The method mainly comprises the following steps of: 1. cpu performance; 2. disk io performance; 3. mutex performance; 4. memory allocation and transmission speed; 5. POSIX thread performance; 6. database performance (OLTP benchmarking). Currently, sysbench mainly supports 3 databases of MySQL, pgsql and oracle.
In the embodiment of the invention, the host can execute the sysbank script according to the configuration of the database parameters and the test core parameter items of the database to be tested, and perform the OLTP reference test on the database to be tested.
In the embodiment of the invention, the sysbench can accurately simulate the I/O mode of the disk of the MySQL database storage engine InnoDB. Thus, based on this feature of sysbank, sysbank scripts can be utilized to support benchmarking and validation of MySQL database workloads from simple to complex transactions.
In the embodiment of the invention, in order to avoid the secondary test to collect the operation index of the host machine during the test, it is also proposed that the operation index of the host machine during the test is monitored and collected by a monitoring tool during the test.
In the embodiment of the invention, the monitoring tool can be as follows: prometa and Node Exporter.
S103, outputting a database test result of the database to be tested and an operation index of the host machine during the test.
In the embodiment of the invention, after the test is completed, the database test result of the database to be tested and the operation index of the host machine during the test can be output, and the display is carried out on the front-end page of the host machine.
In an embodiment of the present invention, the database test result at least includes: the number of transactions executed per second, the number of SQL executed per second, the response time, the concurrency, the total number of reads, the total number of writes, the total number of other operations, the number of errors, the number of reconnections, the run time, and the average time consumption.
Therefore, in the embodiment of the invention, technicians can automatically generate the OLTP database benchmark test report by only completing the configuration of the test core parameters on the front-end page, so that the cost of manually filling scripts and filling test results by the technicians is reduced; in the embodiment of the invention, the monitoring of the hardware level of the host is further combined, so that a technician can better know the performance of the current hardware configuration.
Referring to fig. 2, a flowchart of a database testing method according to an embodiment of the present invention is shown, where the database testing method provided by the embodiment of the present invention may specifically include the following steps:
s201, installing a sysbench for testing a database; and installing Prometa and Node Exporter for collecting operation index of host during test.
In the embodiment of the invention, the sysbank can be installed on the host machine and used for testing the database.
In the embodiment of the invention, the Prometa and the Node Exporter are also provided to be installed on the host machine and used for collecting the operation index of the host machine during the test. NodeExporter is an application program provided by Prometaus and capable of collecting host information, and can collect information such as CPU, memory, magnetic disk and the like of a machine.
In the embodiment of the invention, the configuration service can be automatically started after the Prometa and the Node Exporter are installed, so that the operation index of the host is collected during the test through the Prometa and the Node Exporter.
In Prometheus architecture design, prometheus Server does not directly serve the monitoring specific objective, its main task is responsible for data collection, storage and providing data query support to the outside. So in order to be able to monitor some east-west, such as CPU usage of the host, it is necessary to pull monitoring sample data using the HTTP service address (typically/metrics) exposed from the exoter periodically by exoter, promethaus. The Exporter may be an independent running program independent of the monitoring target, or may be directly built in the monitoring target, so long as monitoring sample data in a standard format can be provided to promethaus.
In the embodiment of the invention, in order to collect the running index of the host machine, such as the information of a CPU, a memory, a disk and the like, a Node Exporter can be used.
S202, receiving test core parameter item configuration aiming at a database to be tested.
Step S202 is similar to step S101, and the description of the embodiment of the present invention is omitted here.
S203, preparing test data according to the test core parameter items; running a test model based on the test data; the test data obtained by the test model are arranged; and generating a sysbank test result file.
In the embodiment of the invention, the sysbank benchmark test comprises the following steps: preparing data, run: running a test model, clearup: and cleaning test data, namely after the benchmark test is completed, generating a benchmark test result file under the/sysbank/result/designated path.
In the embodiment of the invention, in the data preparation stage, test data can be prepared according to related parameter items in the test core parameter items; in the stage of operating the test model, the test model can be operated based on the test data and related parameter items in the test core parameter items; and in the stage of cleaning the test data, the test data obtained by the test model can be arranged, and finally a sysbankh test result file is generated.
S204, analyzing the sysbench test result file, and filtering and extracting the result key data to obtain a complete yaml format test result; and analyzing the yaml format test data to obtain a database test result.
In the embodiment of the invention, because the sysbench test result file is not a conventional YAML/JSON format file, the test result file needs to be analyzed, and the result key data is filtered and extracted to obtain the complete YAML format reference test result. Finally, yaml format benchmark data can be analyzed by using a YamlReader component to obtain database OLTP benchmark results, and specific OLTP benchmark results and meanings are shown in Table 2.
TABLE 2
Figure BDA0004031049180000111
In the embodiment of the invention, the sysbench reference test result can be analyzed, and key indexes such as TPS, QPS, response time, concurrency and the like are extracted.
In the embodiment of the invention, the start time and the end time of the pressure measurement are also recorded, and the monitoring data such as a host CPU, a memory, a disk util and the like in the pressure measurement time period are queried by calling the Promethus server API interface.
S205, aggregating the database test results into a table and displaying, and aggregating the operation indexes of the host machine during the test into a line graph and displaying.
In the embodiment of the invention, the database test results are finally aggregated into the form, the Prometheus monitoring data are aggregated into the line graph for display, and the PDF format report is downloaded through the web front end for reference by operation and maintenance testers.
Therefore, in the embodiment of the invention, the shell script can be written by using the benchmark test tool sysbank, and the quantitative, reproducible and comparable OLTP test can be automatically performed on the performance indexes of the database. Analyzing the result of the sysbench benchmark test after the benchmark test is finished, and extracting key indexes such as transaction number TPS (based on the successful times of the commit) executed by the database per second, SQL number QPS (containing insert, select, update, delete and the like) executed by the database per second, response time, concurrency and the like; meanwhile, in the embodiment of the invention, prometheus Exporter monitoring service is also accessed to provide monitoring data such as cpu utilization rate, memory utilization rate, disk uteil and the like during the host pressure measurement period, the key indexes and the data are stored in a database, and a corresponding test report is automatically generated. The technical scheme provided by the embodiment of the invention is simple and efficient, the data comparison is clear and visual, and the time cost of the reference test of the database by technicians can be effectively reduced.
In an alternative embodiment of the invention, the method further comprises the steps of:
s1, receiving new test core parameter item configuration aiming at the database to be tested.
S2, testing the database to be tested according to the new test core parameter item, and collecting operation indexes of the host machine during testing.
And S3, outputting new database test results and running indexes of the host machine during the test.
And S4, summarizing and outputting the database test result of the database to be tested and the new database test result.
And S5, summarizing and outputting the operation indexes of the host machine during the test period.
In the embodiment of the invention, a technician can also input new test core parameter item configuration aiming at the database to be tested through the front-end web page of the host machine, so that the database to be tested is tested again based on the new test core parameter item configuration, and a new test result is obtained. Correspondingly, in the embodiment of the invention, each group of test results can be analyzed to obtain key test indexes (such as the number of transactions executed per second and the number of SQL executed per second).
Therefore, in the embodiment of the invention, the database to be tested can be tested for multiple times based on different test core parameter item configurations, a plurality of groups of test results and corresponding key test indexes are obtained, and then each group of test results are summarized according to the key test indexes. Therefore, in the embodiment of the invention, the database to be tested can be simply and conveniently tested for multiple times, and a more perfect test report can be obtained. The data comparison is clear and visual, and the time cost of the reference test of the database by technicians can be effectively reduced.
In the embodiment of the invention, the running index condition of the host machine can be displayed in the form of a line graph aiming at each test process, and the line graphs corresponding to the running index condition of the host machine in the multiple test processes can be summarized into the same graph, so that the data comparison is clearer and more visual.
In the embodiment of the invention, a plurality of groups of test core parameter items can be fixedly configured on the host, and the test sequence corresponding to each group of test core parameter items is set, so that a technician can directly execute a sysbank script after designating the database to be tested, test the database to be tested for a plurality of times according to the plurality of groups of test core parameter items according to the sequence, and collect the operation index of the host during each test. Therefore, a clear and visual test report of data comparison is automatically obtained.
In the embodiment of the invention, the basic information of the database of the test and the related parameters of the database can be recorded in the finally generated test report so as to facilitate the analysis of the possible subsequent test report.
In the embodiment of the invention, the detailed information of the test core parameter item, the test environment and the test model can be recorded in the finally generated test report, so that the subsequent possible test report analysis and duplication can be realized.
Based on the test report finally generated by the embodiment of the invention, the performance of the database under the current configuration (including hardware configuration, OS, database setting and the like) can be analyzed, so that the performance threshold of MySQL is found out, and the configuration is adjusted according to the requirements of an actual system. Wherein, key index in the test report: TPS/QPS: may be used to measure throughput; response time: including average response time, minimum response time, maximum response time, percentage of time, etc., where the percentage of time is referenced to a greater meaning, such as the first 95% of the maximum response time of the request; concurrency amount: the number of query requests processed simultaneously.
For most Web applications, the bottleneck of the overall system is the database. Other factors in Web applications, such as network bandwidth, load balancing nodes, application servers (including CPU, memory, hard disk, number of connections, etc.), cache, are all easily extended horizontally (commonly known as add-on machines) to achieve performance improvements. For MySQL, because of the requirement of data consistency, the pressure brought by writing data to a database cannot be dispersed by adding a machine; although the pressure can be relieved by pre-caching (Redis, etc.), read-write separation, library splitting, and table splitting, there are too many limitations compared to the horizontal expansion of other components of the system.
In the embodiment of the invention, the sysbank script is adopted to automatically test the database to be tested, and the tool can automatically construct a large amount of data in the database to be tested. Meanwhile, thousands of threads can be simulated to access the database simultaneously, various SQL sentences are simulated to be used, various transactions are simulated to be submitted to the database to be tested, and even hundreds of thousands of TPS (secure application protocol) compression testing databases can be simulated.
For example, a test library may be created in the database to be tested, named sbtest, and a corresponding test account may be created, which may be called root, with a password of 123456, to allow the user access to the sbtest. The test core parameter item configuration (comprising, for example, 100 ten thousand record lines generated by each table, 20 tables and 100 concurrent threads) is configured, so that 20 test tables can be constructed based on sysbank, each table has 100 ten thousand data, and then 100 concurrent threads are used to initiate access to the database, and the continuous access is performed for 5 minutes, namely 300 seconds. And simultaneously starting a Prometa and Node Exporter monitoring tool to collect operation indexes of the host during the test.
Further, executing a test, specifically, testing the comprehensive read-write TPS of the database, and using an oltp_read_write mode; testing read-only performance of a database, and using oltp_read_only mode; the write performance of the database was tested, using oltp_write_only mode. By using the models, the sysbank tool can construct various SQL sentences to update or inquire the data in 20 test tables, monitor the pressing performance indexes of the database to be tested, execute a cleanup command after the pressing is finished, clean the data and output test results.
Meanwhile, based on the test starting time and the test ending time, monitoring data such as a host CPU, a memory, a disk util and the like in the compression time period can be queried by calling the Promethus server API interface. And analyzing the monitoring data to obtain a line graph.
Finally, in the embodiment of the invention, the test results can be aggregated into a table and displayed, and meanwhile, the line graph corresponding to the running index change of the host machine during the test period is displayed on the test report.
Based on the same inventive concept, an embodiment of the present invention provides a database testing apparatus, and referring to fig. 3, fig. 3 is a schematic diagram of the database testing apparatus provided in the embodiment of the present invention, where the apparatus includes:
a first receiving module 301, configured to receive a configuration of a test core parameter item for a database to be tested;
the first test module 302 is configured to execute a sysbank script, test the database to be tested according to the test core parameter item, and collect an operation index of the host during the test;
the first output module 303 is configured to output a database test result of the database to be tested and an operation index of the host during the test.
Optionally, the apparatus further comprises:
the installation module is used for installing a sysbank and testing the database; and installing Prometa and Node Exporter for collecting operation index of host during test.
Optionally, the first testing module 301 is specifically configured to:
preparing test data according to the test core parameter item;
running a test model based on the test data;
the test data obtained by the test model are arranged;
and generating a sysbank test result file.
Optionally, the apparatus further comprises:
the first analysis module is used for analyzing the sysbank test result file, filtering and extracting the result key data to obtain a complete yaml format test result;
the second analysis module is used for analyzing the yaml format test data to obtain a database test result.
Optionally, the test core parameter item includes at least: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
Optionally, the database test result at least includes: the number of transactions executed per second, the number of SQL executed per second, the response time, the concurrency, the total number of reads, the total number of writes, the total number of other operations, the number of errors, the number of reconnections, the run time, and the average time consumption.
Optionally, the output module 303 is specifically configured to:
and aggregating the database test results into a table and displaying, and aggregating the operation indexes of the host machine during the test into a line graph and displaying.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving new test core parameter item configuration aiming at the database to be tested;
the second test module is used for testing the database to be tested according to the new test core parameter item, and collecting the operation index of the host machine during the test;
the second output module is used for outputting new database test results and running indexes of the host machine during the test;
the summarizing module is used for summarizing and outputting the database test result of the database to be tested and the new database test result;
and the third output module is used for summarizing and outputting the operation indexes of the host machine during the test period.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Based on the same inventive concept, an embodiment of the present invention provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the database test method described in any of the above embodiments.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the steps in the database test method described in any one of the foregoing embodiments.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The database testing method, device, electronic equipment and storage medium provided by the invention are described in detail, and specific examples are applied to illustrate the principles and the implementation modes of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (15)

1. A database testing method, the method comprising:
receiving test core parameter item configuration aiming at a database to be tested;
executing a sysbench script, testing the database to be tested according to the test core parameter item, and collecting operation indexes of a host machine during the test;
and outputting a database test result of the database to be tested and running indexes of the host machine during the test.
2. The method according to claim 1, wherein the method further comprises:
installing a sysbench for testing the database; and installing Prometa and Node Exporter for collecting operation index of host during test.
3. The method of claim 1, wherein executing the sysbank script, according to the test core parameter item, tests the database to be tested, comprises:
preparing test data according to the test core parameter item;
running a test model based on the test data;
the test data obtained by the test model are arranged;
and generating a sysbank test result file.
4. A method according to claim 3, characterized in that the method further comprises:
analyzing the sysbench test result file, and filtering and extracting the result key data to obtain a complete yaml format test result;
and analyzing the yaml format test data to obtain a database test result.
5. The method according to claim 1, wherein the test core parameter items comprise at least: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
6. The method according to any one of claims 1 to 5, wherein the database test results comprise at least: the number of transactions executed per second, the number of SQL executed per second, the response time, the concurrency, the total number of reads, the total number of writes, the total number of other operations, the number of errors, the number of reconnections, the run time, and the average time consumption.
7. The method of claim 1, wherein outputting the database test results of the database under test and the operation index of the host during the test comprises:
and aggregating the database test results into a table and displaying, and aggregating the operation indexes of the host machine during the test into a line graph and displaying.
8. The method according to claim 1, wherein the method further comprises:
receiving new test core parameter item configuration aiming at the database to be tested;
according to the new test core parameter item, testing the database to be tested, and collecting operation indexes of a host machine during testing;
outputting new database test results and running indexes of the host machine during the test;
summarizing and outputting the database test result of the database to be tested and the new database test result;
and summarizing and outputting the operation indexes of the host machine during the test.
9. A database testing apparatus, the apparatus comprising:
the first receiving module is used for receiving test core parameter item configuration aiming at the database to be tested;
the first test module is used for executing a sysbank script, testing the database to be tested according to the test core parameter item, and collecting the operation index of the host machine during the test;
the first output module is used for outputting database test results of the database to be tested and operation indexes of the host machine during the test.
10. The apparatus of claim 9, wherein the apparatus further comprises:
the installation module is used for installing a sysbank and testing the database; and installing Prometa and Node Exporter for collecting operation index of host during test.
11. The apparatus of claim 9, wherein the first test module is specifically configured to:
preparing test data according to the test core parameter item;
running a test model based on the test data;
the test data obtained by the test model are arranged;
and generating a sysbank test result file.
12. The apparatus of claim 11, wherein the apparatus further comprises:
the first analysis module is used for analyzing the sysbank test result file, filtering and extracting the result key data to obtain a complete yaml format test result;
the second analysis module is used for analyzing the yaml format test data to obtain a database test result.
13. The apparatus of claim 9, wherein the test core parameter items comprise at least: specifying test script, number of record lines generated by each table, number of tables and number of concurrent threads.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the database testing method of any of claims 1-8 when the program is executed by the processor.
15. A computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the steps of the database testing method of any of claims 1-8.
CN202211729679.9A 2022-12-30 2022-12-30 Database testing method and device, electronic equipment and storage medium Pending CN116048975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211729679.9A CN116048975A (en) 2022-12-30 2022-12-30 Database testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211729679.9A CN116048975A (en) 2022-12-30 2022-12-30 Database testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116048975A true CN116048975A (en) 2023-05-02

Family

ID=86128867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211729679.9A Pending CN116048975A (en) 2022-12-30 2022-12-30 Database testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116048975A (en)

Similar Documents

Publication Publication Date Title
WO2019153487A1 (en) System performance measurement method and device, storage medium and server
CN108153587B (en) Slow task reason detection method for big data platform
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
US9043327B1 (en) Performing flexible pivot querying of monitoring data using a multi-tenant monitoring system
CN111563014A (en) Interface service performance test method, device, equipment and storage medium
CN107733735B (en) Script recording system and method implanted in pressure measurement device
CN109144862A (en) Statistical method, device, computer equipment and the storage medium of test data
CN114385877B (en) Visual processing method and system of test process and computer readable medium
CN112269697B (en) Equipment storage performance testing method, system and related device
CN114490375A (en) Method, device and equipment for testing performance of application program and storage medium
CN112148616B (en) Performance test management platform
CN115248782B (en) Automatic testing method and device and computer equipment
CN111930611A (en) Statistical method and device for test data
CN116527553A (en) Processing method, system and storage medium for automatic test report of switch
CN116048975A (en) Database testing method and device, electronic equipment and storage medium
CN113535560B (en) Test execution method, device, storage medium and computing equipment
CN111949504A (en) Pressure testing method, device and medium
CN112527584A (en) Software efficiency improving method and system based on script compiling and data acquisition
CN113138917A (en) Performance test platform
CN113360182A (en) Method and apparatus for system performance diagnostics
CN110046098B (en) Real-time library testing method and system
CN115629950B (en) Extraction method of performance test asynchronous request processing time point
CN112968806B (en) Service scene testing method and device, storage medium and electronic equipment
CN117077592B (en) Regression data monitoring method, monitoring device and monitoring system
CN117421196A (en) Performance test method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100007 room 205-32, floor 2, building 2, No. 1 and No. 3, qinglonghutong a, Dongcheng District, Beijing

Applicant after: Tianyiyun Technology Co.,Ltd.

Address before: 100093 Floor 4, Block E, Xishan Yingfu Business Center, Haidian District, Beijing

Applicant before: Tianyiyun Technology Co.,Ltd.

CB02 Change of applicant information