CN108845921A - A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance - Google Patents
A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance Download PDFInfo
- Publication number
- CN108845921A CN108845921A CN201810541054.7A CN201810541054A CN108845921A CN 108845921 A CN108845921 A CN 108845921A CN 201810541054 A CN201810541054 A CN 201810541054A CN 108845921 A CN108845921 A CN 108845921A
- Authority
- CN
- China
- Prior art keywords
- database
- performance
- configuration file
- module
- data
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
- G06F11/3476—Data logging
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses method, apparatus, readable storage medium storing program for executing and the computer equipments of a kind of test database performance, can be realized quick test database performance.The method includes:It is configured to the configuration file that circulation is created and inserted into data at random;The configuration file is imported and executes, the insertion of data into data library that will be generated at random obtains implementing result;According to the implementing result, the performance of the database is obtained.Using the embodiment of the present invention, the problem of capable of quickly being tested before mongoDB database is online, save manpower and material resources, improve production efficiency, while avoid online rear hardware performance deficiency or the serious wasting of resources.
Description
Technical field
The present invention relates to measuring technology, espespecially a kind of method, apparatus, readable storage medium storing program for executing and the meter of test database performance
Calculate machine equipment.
Background technique
MongoDB is the database based on distributed document storage, it is intended to expansible high property is provided for WEB application
It can Data Storage Solution.MongoDB database is a product between relational database and non-relational database,
It is that function is most abundant in non-relational database, is most like relational database.The data structure that he supports is very loose, is similar
The data of the bson format of json, therefore can store the data of more complicated data type.The feature of Mongo maximum is for he
The query language of support is very powerful, and grammer is somewhat similarly to the query language of object-oriented, and similar pass almost may be implemented
It is most functions of database list table inquiry, but also supports to establish data and index.Its feature is high-performance, easy portion
Administration easily uses, and storing data is very convenient.
It can not assess whether hardware structure can support production system before since MongoDB database is online, so to the greatest extent
Amount amplification hardware resource requirements, lead to hardware resource serious waste.Usually we need to put into a large amount of manpower to build environment
Process test, inefficiency.The online performance for quickly assessing MongoDB before of MongoDB database is not present in the prior art,
Thus the method for preferably designing the hardware structure of MongoDB.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method, apparatus of test database performance, readable deposit
Storage media and computer equipment can quickly assess the performance of database.
In order to reach the object of the invention, the present invention provides a kind of methods of test database performance, including:
It is configured to the configuration file that circulation is created and inserted into data at random;
The configuration file is imported and executes, the insertion of data into data library that will be generated at random obtains implementing result;
According to the implementing result, the performance of the database is obtained.
Further, the method also includes settings to execute cycle-index;
The importing simultaneously executes the configuration file, including:
After importing the configuration file, according to the execution cycle-index of the setting, circulation executes the configuration file.
Further, described according to implementing result, obtain the performance of the database, including at least one of:
It is inserted into the quantity of data according to the unit time, determines the performance of the database;
According to the time used in insertion preset quantity data, the performance of the database is determined.
Further, described to import and execute the configuration file, the insertion of data into data library that generated at random, packet
It includes:
The configuration file is imported in pymongo module;
The configuration file for importing pymongo module, the data insert number that will be generated at random are executed using python
According to library.
Further, the database is MongoDB database.
In order to reach the object of the invention, the present invention also provides a kind of device of test database performance, described device packets
It includes configuration module, execution module and performance and obtains module, wherein:
The configuration module, the configuration file for being created and inserted into data at random for configuring circulation;
The execution module, for importing and executing the configuration file, the insertion of data into data library that will be generated at random,
Obtain implementing result;
The performance obtains module, for obtaining the performance of the database according to the implementing result.
Further,
Described device further includes setup module, and the setup module executes cycle-index for being arranged;
The execution module imports and executes the configuration file, including:
After the execution module imports the configuration file, recycled according to the execution of setup module setting secondary
Number, circulation execute the configuration file.
Further, the performance obtains module according to implementing result, obtains the performance of the database, including with down toward
It is one of few:
The performance obtains the quantity that module is inserted into data according to the unit time, determines the performance of the database;
The performance obtains module time according to used in insertion preset quantity data, determines the performance of the database.
Further,
Import and execute the configuration file described in the execution module, the insertion of data into data library that will be generated at random,
Including:
The execution module imports the configuration file in pymongo module;
The execution module executes the configuration file for importing pymongo module using python, will generate at random
Insertion of data into data library.
Further,
The database is MongoDB database.
In order to reach the object of the invention, the present invention also provides a kind of computer readable storage mediums, are stored thereon with meter
Calculation machine program, when described program is executed by processor the step of the realization above method.
In order to reach the object of the invention, the present invention also provides a kind of computer equipment, including memory, processor and
The computer program that can be run on a memory and on a processor is stored, the processor is realized as above when executing described program
State the step in method.
Compared with prior art, the present invention includes the configuration file for being configured to circulation and being created and inserted into data at random;It leads
Enter and execute the configuration file, the insertion of data into data library that will be generated at random obtains implementing result;Knot is executed according to described
Fruit obtains the performance of the database, can quickly test before mongoDB is online, save manpower and material resources, improve production
Efficiency, at the same avoid it is online after the problem of hardware performance is insufficient or the serious wasting of resources.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right
Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this
The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart of the method for the test database performance of the embodiment of the present invention one;
Fig. 2 is the flow chart of the device of the test database performance of the embodiment of the present invention three;
Fig. 3 is the structural schematic diagram of the computer equipment of the embodiment of the present invention three.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention
Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application
Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions
It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable
Sequence executes shown or described step.
Embodiment one
A kind of method for present embodiments providing test database performance, as shown in Figure 1, the party includes S11-S13:
S11, it is configured to the configuration file that circulation is created and inserted into data at random;
S12, importing simultaneously execute the configuration file, and the insertion of data into data library that will be generated at random obtains implementing result;
S13, according to the implementing result, obtain the performance of the database.
In the embodiment of the present invention, the test to database is the insertion of data into data library that will be generated at random, is held according to described
Row is built test environment compared to the conventional a large amount of manpower of investment and is tested as a result, obtain the performance of the database, energy
The performance of enough quickly assessment databases.
Optionally, the method also includes settings to execute cycle-index;
The importing simultaneously executes the configuration file, including:
After importing the configuration file, according to the execution cycle-index of the setting, circulation executes the configuration file.
Optionally, described according to implementing result, obtain the performance of the database, including at least one of:
It is inserted into the quantity of data according to the unit time, determines the performance of the database;Alternatively, can also be by the number of acquisition
Amount does existing processing and calculating, determines the performance of the database;
According to the time used in insertion preset quantity data, the performance of the database is determined;Alternatively, can also will obtain
Time do existing processing and calculating, determine the performance of the database.
Optionally, the importing and the configuration file is executed, the insertion of data into data library that will be generated at random, including:
The configuration file is imported in pymongo module;
The configuration file for importing pymongo module, the data insert number that will be generated at random are executed using python
According to library.
Optionally, the database is MongoDB database.
In the embodiment of the present invention, it is configured to the configuration file that circulation is created and inserted into data at random;It imports and executes institute
Configuration file is stated, the insertion of data into data library that will be generated at random obtains implementing result;According to the implementing result, institute is obtained
The performance for stating database is built test environment compared to the conventional a large amount of manpower of investment and is tested, can be in mongoDB number
According to the online preceding quickly test in library, manpower and material resources are saved, production efficiency is improved, while it is insufficient to avoid online rear hardware performance
Or the problem of serious wasting of resources.
Embodiment two
Above-described embodiment method is specifically described in the present embodiment, includes the following steps:
Step S21 installs python module, boos-dev module, pip module, pymongo in linux operating system
Module;
Pip module is the tool an of installation and management Python packet;
Pymongo module is driver, so that python program is able to use MongoDB database, is compiled using python
It writes;
Step S22 configures MongoDB;
Configuration MongoDB refers to using the configurations before MongoDB, enables MongoDB normal use;
Step S23, editor's circulation stochastic production and the mo.py configuration file for being inserted into data, configuration file is imported
In pymongo (no Universal Chinese character technical term) module, thus in the data insertion MongoDB for generating mo.py;
Mo.py configuration file is for by function, circulation to be randomly generated and be inserted into the program of data, as long as file designation
Discord python internal module is ordered again, and mo.py is named as in this example;
Step S24, linux operating system executes the configuration file mo.py root for importeding into pymongo module using python
According to implementing result, the performance of MongoDB module is checked.
The cycle-index for executing configuration file can also be set, including,
Configuration file mo.py is executed in operating system level recursive call python, is voluntarily adjusted according to system pressure
Python cycle-index, so that the performance test under completing different pressures, more flexible can be arranged the data amount check generated, quickly
Test mongoDB performance;For example, mo.py configuration file setting cycle-index is that 10, python cycle-index is set as 5, then follow
The number of ring stochastic production data is 10*5 times;If mo.py configuration file configuration circulation stochastic production data amount check is 100,
Then recycling stochastic production data is 50*100, can produce 5000 data.
According to implementing result, the performance of MongoDB module is checked;
The quantity per second for loading record in database can be inquired, determines the performance of the database;For example, when CPU makes
When reaching 100% with rate, the quantity of load record per second illustrates that performance is better when quantity is bigger;
It can also look at and load the default item record time used in the database, determine the performance of the database;Example
Such as, the record time used when loading 100W in the database, when the time more in short-term, performance is better.
Embodiment three
A kind of device of test database performance is present embodiments provided, description is also applied for this in above method embodiment
In embodiment, shown in Fig. 2, which includes that configuration module 21, execution module 22 and performance obtain module 23, wherein:
The configuration module 21, the configuration file for being created and inserted into data at random for configuring circulation;
The execution module 22, for importing and executing the configuration file, the insertion of data into data that will be generated at random
Library obtains implementing result;
The performance obtains module 23, for obtaining the performance of the database according to the implementing result.
In one alternate embodiment, described device further includes setup module 24, and the setup module 24 is held for being arranged
Row cycle-index;
The execution module 22 imports and executes the configuration file, including:
After the execution module 22 imports the configuration file, circulation is executed according to the setup module 24 setting
Number, circulation execute the configuration file.
In one alternate embodiment,
The performance obtains module 23 according to implementing result, obtains the performance of the database, including at least one of:
The performance obtains the quantity that module 23 is inserted into data according to the unit time, determines the performance of the database;
The performance obtains the time according to used in insertion preset quantity data of module 23, determines the property of the database
Energy.
In one alternate embodiment, the execution module 22 imports and executes the configuration file, will generate at random
Insertion of data into data library, including:
The execution module 22 imports the configuration file in pymongo module;
The execution module 22 executes the configuration file for importing pymongo module using python, will give birth at random
At insertion of data into data library.
In one alternate embodiment, the database is MongoDB database.
The embodiment of the present invention also provides a kind of computer storage medium, and the computer storage medium is stored with computer journey
Sequence;After the computer program is performed, the test database performance methodology of previous embodiment offer can be realized, for example, holding
Row method as shown in Figure 1.
The embodiment of the present invention also provides a kind of computer equipment, can be structure as shown in Figure 3, including processor
31, memory 32 and storage on a memory and the computer program that can run on a processor, processor execution institute
Part or Overall Steps in embodiment one or embodiment two can be realized when stating program.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use
Embodiment is not intended to limit the invention.Technical staff in any fields of the present invention is taken off not departing from the present invention
Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation
Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.
It will appreciated by the skilled person that whole or certain steps, system, dress in method disclosed hereinabove
Functional module/unit in setting may be implemented as software, firmware, hardware and its combination appropriate.In hardware embodiment,
Division between the functional module/unit referred in the above description not necessarily corresponds to the division of physical assemblies;For example, one
Physical assemblies can have multiple functions or a function or step and can be executed by several physical assemblies cooperations.Certain groups
Part or all components may be implemented as by processor, such as the software that digital signal processor or microprocessor execute, or by
It is embodied as hardware, or is implemented as integrated circuit, such as specific integrated circuit.Such software can be distributed in computer-readable
On medium, computer-readable medium may include computer storage medium (or non-transitory medium) and communication media (or temporarily
Property medium).As known to a person of ordinary skill in the art, term computer storage medium is included in for storing information (such as
Computer readable instructions, data structure, program module or other data) any method or technique in the volatibility implemented and non-
Volatibility, removable and nonremovable medium.Computer storage medium include but is not limited to RAM, ROM, EEPROM, flash memory or its
His memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storages, magnetic holder, tape, disk storage or other
Magnetic memory apparatus or any other medium that can be used for storing desired information and can be accessed by a computer.This
Outside, known to a person of ordinary skill in the art to be, communication media generally comprises computer readable instructions, data structure, program mould
Other data in the modulated data signal of block or such as carrier wave or other transmission mechanisms etc, and may include any information
Delivery media.
Claims (12)
1. a kind of method of test database performance, which is characterized in that including:
It is configured to the configuration file that circulation is created and inserted into data at random;
The configuration file is imported and executes, the insertion of data into data library that will be generated at random obtains implementing result;
According to the implementing result, the performance of the database is obtained.
2. the method according to claim 1, wherein
The method also includes settings to execute cycle-index;
The importing simultaneously executes the configuration file, including:
After importing the configuration file, according to the execution cycle-index of the setting, circulation executes the configuration file.
3. obtaining the property of the database the method according to claim 1, wherein described according to implementing result
Can, including at least one of:
It is inserted into the quantity of data according to the unit time, determines the performance of the database;
According to the time used in insertion preset quantity data, the performance of the database is determined.
4. method according to claim 1 or 2 or 3, which is characterized in that
The importing simultaneously executes the configuration file, the insertion of data into data library that will be generated at random, including:
The configuration file is imported in pymongo module;
The configuration file for importing pymongo module, the insertion of data into data library that will be generated at random are executed using python.
5. according to the method described in claim 4, it is characterized in that,
The database is MongoDB database.
6. a kind of device of test database performance, which is characterized in that described device includes configuration module, execution module and performance
Module is obtained, wherein:
The configuration module, the configuration file for being created and inserted into data at random for configuring circulation;
The execution module, for importing and executing the configuration file, the insertion of data into data library that will be generated at random is obtained
Implementing result;
The performance obtains module, for obtaining the performance of the database according to the implementing result.
7. device according to claim 6, which is characterized in that
Described device further includes setup module, and the setup module executes cycle-index for being arranged;
The execution module imports and executes the configuration file, including:
After the execution module imports the configuration file, according to the execution cycle-index that the setup module is arranged, follow
Ring executes the configuration file.
8. device according to claim 6, which is characterized in that the performance obtains module according to implementing result, obtains institute
State the performance of database, including at least one of:
The performance obtains the quantity that module is inserted into data according to the unit time, determines the performance of the database;
The performance obtains module time according to used in insertion preset quantity data, determines the performance of the database.
9. device described according to claim 6 or 7 or 8, which is characterized in that
The execution module imports and executes the configuration file, the insertion of data into data library that will be generated at random, including:
The execution module imports the configuration file in pymongo module;
The execution module executes the configuration file for importing pymongo module, the number that will be generated at random using python
According to insertion database.
10. device according to claim 9, which is characterized in that
The database is MongoDB database.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed
The step of any claim the method in claim 1-5 is realized when device executes.
12. a kind of computer equipment, can run on a memory and on a processor including memory, processor and storage
Computer program, which is characterized in that the processor is realized when executing described program such as any claim in claim 1-5
Step in the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810541054.7A CN108845921A (en) | 2018-05-30 | 2018-05-30 | A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810541054.7A CN108845921A (en) | 2018-05-30 | 2018-05-30 | A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108845921A true CN108845921A (en) | 2018-11-20 |
Family
ID=64211017
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810541054.7A Pending CN108845921A (en) | 2018-05-30 | 2018-05-30 | A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108845921A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990482A (en) * | 2019-11-11 | 2020-04-10 | 中国建设银行股份有限公司 | Data synchronization method and device between asynchronous databases |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160055233A1 (en) * | 2014-08-25 | 2016-02-25 | Ca, Inc. | Pre-join tags for entity-relationship modeling of databases |
CN105512042A (en) * | 2015-12-22 | 2016-04-20 | 广东金赋信息科技有限公司 | Automatic generation method and device for testing data of database and testing system |
CN106815136A (en) * | 2015-11-30 | 2017-06-09 | 北京国双科技有限公司 | Unit test method and device |
CN107193967A (en) * | 2017-05-25 | 2017-09-22 | 南开大学 | A kind of multi-source heterogeneous industry field big data handles full link solution |
CN107506436A (en) * | 2017-08-23 | 2017-12-22 | 福建星瑞格软件有限公司 | A kind of method and device for Internet of Things data library storage performance test |
-
2018
- 2018-05-30 CN CN201810541054.7A patent/CN108845921A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160055233A1 (en) * | 2014-08-25 | 2016-02-25 | Ca, Inc. | Pre-join tags for entity-relationship modeling of databases |
CN106815136A (en) * | 2015-11-30 | 2017-06-09 | 北京国双科技有限公司 | Unit test method and device |
CN105512042A (en) * | 2015-12-22 | 2016-04-20 | 广东金赋信息科技有限公司 | Automatic generation method and device for testing data of database and testing system |
CN107193967A (en) * | 2017-05-25 | 2017-09-22 | 南开大学 | A kind of multi-source heterogeneous industry field big data handles full link solution |
CN107506436A (en) * | 2017-08-23 | 2017-12-22 | 福建星瑞格软件有限公司 | A kind of method and device for Internet of Things data library storage performance test |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990482A (en) * | 2019-11-11 | 2020-04-10 | 中国建设银行股份有限公司 | Data synchronization method and device between asynchronous databases |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020220638A1 (en) | Method and apparatus for associating link system with log system, and storage medium | |
CN107872528B (en) | Message pushing method and device | |
US20170262531A1 (en) | Data Visualization Method and Apparatus, and Database Server | |
CN105824849A (en) | Data import method and adapter | |
CN109558525A (en) | A kind of generation method of test data set, device, equipment and storage medium | |
CN110704418A (en) | Block chain information query method, device and equipment | |
CN107741935A (en) | Data lead-in method and data importing device | |
CN104408118A (en) | Database establishing method and device | |
CN107153717A (en) | Million grades of method and system that recorded form are exported from database by browser | |
US20150112993A1 (en) | Method and Apparatus for Importing and Exporting Contact | |
US9084131B2 (en) | Data cut-over method and apparatus | |
CN108845921A (en) | A kind of method, apparatus, readable storage medium storing program for executing and the computer equipment of test database performance | |
CN105808539A (en) | Data import and export method and device | |
CN112148713B (en) | Method and device for data migration between heterogeneous databases | |
CN109101641B (en) | Form processing method, device, system and medium | |
CN111143426A (en) | Multi-system user information association method and device | |
CN103176843B (en) | The file migration method and apparatus of MapReduce distributed system | |
CN109032582A (en) | A kind of method and device generating server O&M script | |
CN111275553B (en) | Block chain data storage method and block chain system | |
CN111092949B (en) | Method and device for registering equipment | |
CN111160403B (en) | API (application program interface) multiplexing discovery method and device | |
CN107704557B (en) | Processing method and device for operating mutually exclusive data, computer equipment and storage medium | |
CN113157306A (en) | Resource packaging management method, device, equipment and storage medium | |
CN106951427B (en) | Data extraction method and device for business object | |
CN104461552B (en) | The analytic method and resolver of bar code attribute |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181120 |
|
RJ01 | Rejection of invention patent application after publication |