CN110162471A - A kind of method for testing pressure and system based on container cloud - Google Patents

A kind of method for testing pressure and system based on container cloud Download PDF

Info

Publication number
CN110162471A
CN110162471A CN201910348961.4A CN201910348961A CN110162471A CN 110162471 A CN110162471 A CN 110162471A CN 201910348961 A CN201910348961 A CN 201910348961A CN 110162471 A CN110162471 A CN 110162471A
Authority
CN
China
Prior art keywords
pressure
container
script
survey
concurrent
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.)
Granted
Application number
CN201910348961.4A
Other languages
Chinese (zh)
Other versions
CN110162471B (en
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910348961.4A priority Critical patent/CN110162471B/en
Publication of CN110162471A publication Critical patent/CN110162471A/en
Application granted granted Critical
Publication of CN110162471B publication Critical patent/CN110162471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Software Systems (AREA)
  • Measuring Fluid Pressure (AREA)
  • Investigating Strength Of Materials By Application Of Mechanical Stress (AREA)

Abstract

The present invention provides a kind of method for testing pressure and system based on container cloud, this method comprises: surveying element assembling pressure according to the pressure for receiving pressure survey task surveys script;The value for needing to change during pressing and surveying in script message body is surveyed to pressure to parameterize, and combines pressure measured data that the value of parametrization is substituted for different data, observes and predicts text to generate effective pressure when operation presses and surveys script;Number of containers needed for being calculated according to the number of concurrent of pressure survey task and the container that respective numbers are generated on Docker container cloud;Container progress pressure test generated will be distributed to comprising pressing the pressure of measured data to survey script.The present invention realizes the situation of conventional pressure thousandfold rising, and the pressure for meeting internet finance surveys demand;It realizes that pressure surveys resource multiplex, reduces pressure survey machine lower deployment cost;It introduces cloud pressure to survey, makes full use of idle machine, and the characteristic expansible by cloud elasticity, realize that super large is concurrent, even wave is concurrent;It realizes lightweight deployment, realizes the coordination of exploitation, test.

Description

A kind of method for testing pressure and system based on container cloud
Technical field
The present invention relates to software pressure test automatic field, especially a kind of method for testing pressure based on container cloud and System.
Background technique
The Internet service of rapid growth requires product development, iteration and delivery cycle shorter and shorter, IT infrastructure A large amount of uses of extensive cloud and third party's api interface, make traditional method for testing pressure built based on internal environment and survey Trial work tool is increasingly difficult to meet the needs of application function is available and container planning is estimated.
Existing pressure survey process is usually: it is up to a hundred to survey tool LOADRUNNER (hereinafter LR) progress by traditional pressure Concurrent pressure is surveyed, and gets the resource consumption situation of record server ready by hand, and pressure is surveyed result by hand after pressing and surveying and is returned It receives, reaches thousands of test pressure up to ten thousand if necessary, it is necessary to which tens several hundred pressures survey machine and load onto LR to complete.Mesh Before, existing performance test has the following problems:
1) the tradition pressure survey concurrency carried out using LR is not high enough, can not effectively simulate internet high concurrent scene, lack Effective means passes through test environment and the capacity ability to bear on producing is estimated in the comparison of production environment, so that some performances are asked Topic is until production is just found.
2) pressure is surveyed tangible machine demand greatly and can not rationally be utilized.For example, entity pressure survey machine to A apply into During pressure of going is surveyed, lack the monitoring of available resources, causing the pressure to survey machine can not be rationally by B application while as pressure survey machine Device.
3) pressure survey tool disposes complicated and time consumption.For example, one LR pressure of deployment surveys tangible machine and needs cost nearly one small When time, and surveyed for different pressure and also need to modify different configurations, this consumes deployment time again significantly.
4) currently, pressure survey monitoring also need manual operations, press survey during, need manually to it is each by pressure system into The record of row resource consumption, and after pressing survey, the pressure for artificially collecting LR and application layer and data Layer surveys result.
Summary of the invention
To overcome existing performance pressures to test existing defect, the present invention realizes multi-homed host more piece by container cloud The distributed pressure of point is surveyed, and realizes that test script prepares to automate by one-touch hair die block, using container cluster administrative skill, It realizes such as staged, awave pressure change, graphical exhibition in real time is carried out to the container during operation, host state Show, diagrammatic representation function is carried out to modal analysis results.
On the one hand, the embodiment of the invention provides a kind of method for testing pressure based on container cloud, which comprises
Element assembling pressure is surveyed according to the pressure for receiving pressure survey task and surveys script, and it includes needed for pressure is surveyed that the pressure, which surveys element, URL, the message that need to be sent, number of concurrent, pressure survey mode and pressure, which are surveyed, continues the duration;
The value for needing to change during pressing and surveying in script message body is surveyed to the pressure to parameterize, and pressure is combined to survey number According to the value of parametrization to be substituted for different data, text is observed and predicted to generate effective pressure when operation presses and surveys script;
Number of containers needed for being calculated according to the number of concurrent of pressure survey task simultaneously generates respective numbers on Docker container cloud Container;
Container progress pressure test generated will be distributed to comprising pressing the pressure of measured data to survey script.
In one embodiment, the method also includes: the duration is surveyed according to the pressure of pressure survey task and calculates the life of each container The period is ordered, recycles the container to discharge after reaching its life cycle.
In one embodiment, the method also includes: obtain the pressure testing results of each container and display.
In one embodiment, after the container for generating respective numbers, the method also includes: with obtaining the IP of the container Location will will include to press the pressure of measured data to survey script to be distributed to cell therefor according to the IP address.
In one embodiment, the method also includes: when the number of concurrent of the pressure survey task is reduced, recycle idle appearance Device;When the number of concurrent of the pressure survey task increases, increase the container of respective numbers to execute the pressure survey task.
On the other hand, the embodiment of the invention also provides a kind of pressure testing system based on container cloud, the system packets It includes:
Script assembling unit surveys script for surveying element assembling pressure according to the pressure for receiving pressure survey task, and the pressure survey is wanted Element includes that URL needed for pressure survey, the message that need to be sent, number of concurrent, pressure survey mode and pressure survey the lasting duration;
Script argument unit is carried out for surveying the value for needing to change during pressing and surveying in script message body to the pressure Parametrization, and combine pressure measured data that the value of parametrization is substituted for different data, it is effective to be generated when operation presses and surveys script Pressure observe and predict text;
Container generation unit, for number of containers needed for being calculated according to the number of concurrent of pressure survey task and in Docker container cloud The upper container for generating respective numbers;
Script Dispatching Unit, for that will include to press the pressure of measured data to survey script to be distributed to container progress pressure survey generated Examination.
In one embodiment, the container generation unit is also used to: it is each to survey duration calculating according to the pressure of pressure survey task The life cycle of container recycles the container to discharge after reaching its life cycle.
In one embodiment, the system also includes: monitoring display unit, for obtaining the pressure testing results of each container And it shows.
In one embodiment, after the container that the container generation unit generates respective numbers, the script Dispatching Unit It is also used to: obtaining the IP address of the container, will will include to press the pressure of measured data to survey script to be distributed to phase according to the IP address The container answered.
In one embodiment, the system also includes elastic telescopic units, for subtracting in the number of concurrent of the pressure survey task When few, idle container is recycled, and when the number of concurrent of the pressure survey task increases, increases the container of respective numbers to execute State pressure survey task.
The embodiment of the present invention realizes the rising of conventional pressure thousandfold by the distributed pressure survey scheme based on container cloud Situation, the pressure for meeting internet finance survey demand;It realizes that pressure surveys resource multiplex, reduces pressure survey machine lower deployment cost;Cloud pressure is introduced to survey, Idle machine, and the characteristic expansible by cloud elasticity are made full use of, realizes that super large is concurrent and wave is concurrent;It uses Docker builds pressure test cloud as the container of testing tool, realizes lightweight deployment, realizes the coordination of exploitation, test.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the general process schematic diagram for the method for testing pressure based on container cloud that one embodiment of the invention provides;
Fig. 2 is the general structure schematic diagram for the pressure testing system based on container cloud that one embodiment of the invention provides;
Fig. 3 be another embodiment of the present invention provides the pressure testing system based on container cloud structural schematic diagram;
Fig. 4 is the structural schematic diagram of master control set 1;
Fig. 5 is the structural schematic diagram of container cloud dispatching device 2;
Fig. 6 is the structural schematic diagram of script diostribution device 3;
Fig. 7 is the structural schematic diagram of executive device 4;
Fig. 8 is the structural schematic diagram for showing device 5;
Fig. 9 is the substantially process flow that pressure test is carried out using system shown in Figure 3;
Figure 10 is when carrying out pressure test using system shown in Figure 3, and pressure surveys the execution process of script.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is the general process schematic diagram for the method for testing pressure based on container cloud that one embodiment of the invention provides.Such as Shown in Fig. 1, this method is mainly comprised the steps that
Step S1, element assembling pressure is surveyed according to the pressure for receiving pressure survey task and surveys script, it includes that pressure is surveyed that the pressure, which surveys element, Required URL, the message that need to be sent, number of concurrent, pressure survey mode and pressure, which are surveyed, continues the duration.
After receiving a pressure survey task, the various pressures for including in survey task survey feature object will be pressed to be put into database and deposited Storage, the pressure for being combined into the distributed XML format for pressing survey tool of open source survey script, real so that pressure surveys use after successive container starting Show a key and generates pressure survey script.
Step S2, the value for needing to change during pressing and surveying in script message body is surveyed to the pressure to parameterize, and tie The value of parametrization is substituted for different data by combined pressure measured data, observes and predicts text to generate effective pressure when operation presses and surveys script.
The step is the content for the message body surveyed in script to pressure, i.e., needs to change inside the message request sent every time Data are parameterized, and the incoming mode of message body is the form of key-value pair, i.e. KEY/VALUE form, if above-mentioned area Number and transaction number need to carry out parameterization operations, i.e., on VALUE using front and back arrange spcial character form $ { tradeid }, so that directly $ { tradeid } is spelled into pressure according to the parametrization agreement that pressure surveys script itself when assembling script Script is surveyed, subsequent pressure survey tool completes the meaning of identification parameter character, it is ensured that it is all effective that each pressure, which is dealt into after server, 's.For example, transaction number, User ID in message, area code etc., be sent to server every time in pressure test and require not The same value needs to parameterize these values so surveying in script in pressure.In the pressure measured data for combining user to provide, will join The value of numberization is substituted for different data every time.
Step S3, number of containers needed for being calculated according to the number of concurrent of pressure survey task simultaneously generates corresponding on Docker container cloud The container of quantity.
When generating container according to the number of concurrent of pressure survey task, usually first the number of concurrent that each container can bear is carried out Estimate calculating.For example, the number of concurrent that the container of a 2C2G can be born is 200, it is if this pressure surveys the number of concurrent needed 10000, then 50 containers can be automatically generated to carry out pressure survey.
Step S4, container progress pressure test generated will be distributed to comprising pressing the pressure of measured data to survey script.
In one embodiment, while generating container, when usually can also survey lasting according to the pressure provided in pressure survey script Between (i.e. the pressure of pressure survey task surveys the duration) calculate the life cycle of each container, to discharge recycling after reaching its life cycle The container achievees the effect that resource discharges recycling in time.
In one embodiment, after pressure is completed, the pressure testing results of each container and display are obtained, can also be incited somebody to action Simultaneously directive sending gives pressure test demand to propose personnel for the pressure testing results storage of recycling.Additionally, it should be understood that can be with Obtain the resource service condition of tested application, CPU, memory and memory including service area in real time when pressure test does not complete The details such as storehouse, garbage reclamation, Thread Count.
In one embodiment, after the container that respective numbers are generated using step S3, the IP address of each container is obtained, in order to It will will include to press the pressure of measured data to survey script to be distributed to cell therefor according to the IP address.
In one embodiment, the present invention can also control starting and the elastic telescopic of container, survey script requirement to different pressures The number of concurrent layout that carries out container and reasonably elastic telescopic container during the test, that is, in the concurrent of pressure survey task When number is reduced, idle container is recycled, and when the number of concurrent for pressing survey task increases, increases the container of respective numbers to execute State pressure survey task.For example, opening different containers according to number of concurrent elasticity in different time periods when testing dynamic current limiting component Number, it is ensured that reach the test of dynamic current limiting component, and after test, container is recycled in time.
The embodiment of the present invention realizes the rising of conventional pressure thousandfold by the distributed pressure survey scheme based on container cloud Situation, the pressure for meeting internet finance survey demand;It realizes that pressure surveys resource multiplex, reduces pressure survey machine lower deployment cost;Cloud pressure is introduced to survey, Allow idle machine all to operationalize, and the characteristic expansible by cloud elasticity, realize super large it is concurrent/or even may be implemented wave Formula is concurrent;Docker is used as the container of testing tool to build pressure test cloud, realizes that lightweight is disposed, realization exploitation, The coordination of test.
Based on inventive concept identical with Fig. 1, the embodiment of the invention also provides one kind to be based on shown in FIG. 1 based on appearance The identical inventive concept of the method for testing pressure of device cloud, the embodiment of the present application also provides a kind of pressure tests based on container cloud System, as described in following example.Method for testing pressure based on container cloud in the principle and Fig. 1 solved the problems, such as due to the system It is similar, therefore the implementation of the system may refer to the implementation of the method for testing pressure based on container cloud of Fig. 1, repeat place no longer It repeats.
In another embodiment, the present invention also provides a kind of pressure testing system based on container cloud, structure such as Fig. 2 Shown, which includes: script assembling unit 10, script argument unit 20, container generation unit 30 and script Dispatching Unit 40。
Script assembling unit 10 is used to survey element assembling pressure according to the pressure for receiving pressure survey task and surveys script, and the pressure survey is wanted Element includes that URL needed for pressure survey, the message that need to be sent, number of concurrent, pressure survey mode and pressure survey the lasting duration.Script argument Unit 20 is used to survey the value for needing to change during pressing and surveying in script message body to the pressure and parameterize, and pressure is combined to survey The value of parametrization is substituted for different data by data, observes and predicts text to generate effective pressure when operation presses and surveys script.Container is raw Number of containers needed for being used to be calculated according to the number of concurrent of pressure survey task at unit 30 simultaneously generates respective counts on Docker container cloud The container of amount.Script Dispatching Unit 40, which is used to surveying the pressure comprising pressure measured data into script, is distributed to container progress pressure generated Test.
In one embodiment, container generation unit 30 is also used to survey each container of duration calculating according to the pressure of pressure survey task Life cycle, with after reaching its life cycle discharge recycle the container.
In one embodiment, above system further includes a monitoring display device 50, for obtaining the pressure test of each container As a result it and shows.
In one embodiment, after the container that container generation unit 30 generates respective numbers, script Dispatching Unit 40 is also used It will will include to press the pressure of measured data to survey script to be distributed to corresponding appearance according to the IP address in the IP address for obtaining the container Device.
In one embodiment, above system further includes an elastic telescopic unit 60, in the concurrent of the pressure survey task When number is reduced, idle container is recycled, and when the number of concurrent of the pressure survey task increases, increases the container of respective numbers to hold The row pressure survey task.
The present invention program is illustrated to be clearer, technical solution of the present invention is carried out now in conjunction with specific embodiment Explanation.
The embodiment is based on a kind of distributed pressure survey tool Tsung of open source, on its master-slave mode addition cloud Function is disposed, realizes that the distributed pressure on container cloud is surveyed, solves the not high difficult point of tradition pressure survey tool concurrency.Based on container cloud One key deployment techniques of mirror image realize pressure survey node the rapid deployment for quickly generating and press survey tool, solve pressure survey tool dispose The problem of complicated and pressure is surveyed tangible machine demand greatly and can not rationally be utilized.It is developed again based on reference jconsole source code The monitor supervision platform of JVM layers of real time monitoring, the platform realize memory/CPU/ thread pool/GC situation real time monitoring to JVM, prison The application during module monitors pressure is surveyed and the performance data of physical machine are controlled, pressure survey monitoring is solved and needs manually operated ask Topic.
Fig. 3 is the system construction drawing of the embodiment, mainly includes main control unit 1, container cloud dispatching device 2, script point Transmitting apparatus 3, executive device 4 and displaying device 5.
The present embodiment realizes the high concurrent based on container cloud by master control set 1, container cloud dispatching device 2, executive device 4 Distribution pressure is surveyed.Master control set 1, container cloud dispatching device 2, executive device 4 are all built upon on docker container cloud, are passed through Master control set 1 receives number of concurrent, pressure survey mode, pressure in pressure survey task and surveys the elements such as duration, is dispatched using container cloud The number of concurrent that device 2 can bear the container in each executive device 4 carries out estimating calculating, automatically generates this pressure survey task The data of the life cycle of the container data and calculating storage Slave container of the executive device 4 needed, i.e., executive device 4 can With elastic telescopic, and result is pooled to main control unit 1.Each executive device 4 is an independent docker container, often Master/Slave mode (master slave mode) can be realized in a distributed pressure survey tool of docker upper vessel portion administration.Pass through Slave Node hair pressure extending transversely on multi-homed host multinode, and collect in host node, realize distributed pressure survey mechanism.Pass through container Cloud dispatching device 2 obtains the container number on the cloud that needs are opened, and is carried out by container cloud dispatching device 2 to container node number Elastic telescopic control management, realizes dynamic pressure variation.During pressing survey, pressure can be surveyed by visual control module complete Process is completely shown and is recorded, and pressure measured data storage is handled, and realizes the various processes that real time monitoring pressure is surveyed.
Master control set 1 surveys the reception of script for realizing pressure and presses the preparation of measured data, while guaranteeing that pressure survey script can Smoothly flow into script diostribution device 3.Pressure survey script mainly completed in master control set 1 to foreground device be passed to pressure survey element into Pressure after the automatic script assembling of row, script argument and parametrization surveys the preparation of big data quantity, mentions for subsequent execution device 4 Script and pressure measured data for automatic running.Master control set 1 mainly includes script editor module 11, data preparation module 12, number According to parameterized module 13 and result summarizing module 14, structure is as shown in Figure 4.
Script editor module 11 surveys script for assembling pressure, and after the inflow of various performance parameters, parameter one-to-one correspondence is arrived Pressure surveys script, is assembled into the executable pressure of pressure test cloud platform and surveys script.Press survey personnel on the foreground of script editor module 11 URL, the message for needing to send, number of concurrent, concurrent duration are inputted in page input item, the foreground of script editor module 11 is logical Cross the backstage that AJAX mode is passed to object script editor module 11, backstage needs URL, message, number of concurrent, concurrent that will be incoming The feature object of duration, which is put into database, to be stored, and the pressure for being combined into the distributed pressure survey tool of open source surveys script for subsequent appearance Pressure after device starting, which is surveyed, to be used, and realizes that a key generates pressure and surveys script, it is usually XML form that pressure, which surveys script,.
Data preparation module 12 is various in the message request issued when pressing to execute and survey script for preparing pressure measured data Attribute provides sufficient test data, guarantees that the pressure condition for being tested server during the test meets pressure test demand. The data that this module provides are the parametrization content service in the message of script editor module 11.The format for pressing measured data to import can To be any one in CSV, XLS, TXT.When importing various data, it is possible to provide the importing sample of import format, for example, pressure The data changed are needed to be different ground area code and different transaction numbers when survey, then in CSV format pressure measured data file It can be different ground area codes that first row, which is inserted into data, and the insertion data of secondary series are different transaction numbers.
For the pressure side data of data preparation module 12, data parameterization module 13 is surveyed in script in the pressure for needing to parameterize Each attribute is parameterized.This module is the content (message request sent every time for the message body surveyed in script to pressure In the data that need to change) parameterized.Message body foreground incoming mode be key-value pair form, i.e. KEY/VALUE, If above-mentioned ground area code and transaction number need to carry out parameterization operations, i.e., the special of front and back agreement is used on VALUE Character style $ { tradeid }, so that the parametrization that backstage can survey script itself when assembling script according to pressure is arranged directly $ { tradeid }, which is spelled, surveys script into pressure, and subsequent pressure survey tool completes the meaning of identification parameter character, it is ensured that each pressure is dealt into clothes It is all effective after business device.
As a result the pressure that summarizing module 14 is used to collect in distributed slave container is surveyed as a result, realizing that distributed pressure surveys result Recycling.What the result recycling module in master container of this module based on the distributed pressure survey tool of open source was realized, recycle mould Block supports decentralized configuration, i.e., the IP information of all slave containers is written in the configuration file of master container, recycling module Automatically the result in slave container can be collected into result summarizing module after pressing and surveying automatically.
Container cloud dispatching device 2 surveys the Resource Distribution and Schedule work on cloud for realizing entire pressure, by pressing survey task In number of concurrent, pressure survey mode, pressure survey the elements such as duration, the container in each executive device 4 can bear concurrent Number carries out estimating calculating, automatically generates number of containers and calculate storage Slave container life week that this pressure survey task needs The data of phase, and introduce Open Framework kubernetes and carry out across host container change management, realize to include the pressure automatic portion of survey tool Administration, the management of container High Availabitity, container elastic telescopic function, be finally reached dynamic pressure variation when resource rational utilization and and When release recycling pressure survey resource-sharing effect.Container cloud dispatching device 2 mainly includes resource distribution module 21 and scheduling mould Block 22, structure is as shown in Figure 5.
Resource distribution module 21 is used to distribute the container number of resources that survey task is pressed on each cloud.By pressure survey task in and Hair number, pressure survey mode, pressure are surveyed elements, the resource distribution modules 21 such as duration and can be held to the container in each executive device 4 The number of concurrent received carries out estimating calculating, i.e., the number of concurrent that the container of one 2C2G can be born is 200, needs simultaneously if this pressure is surveyed Sending out number is 10000, then resource distribution module 21 can automatically generate 50 Slave containers, while being surveyed in script and being provided according to pressure Pressure survey the duration calculate storage Slave container life cycle data, achieve the effect that resource discharges recycling in time.
Scheduler module 22 surveys resource-sharing for realizing pressure, carries out across host appearance by introducing Open Framework kubernetes Device management realizes to include the function of pressing survey tool automatic deployment, the management of container High Availabitity, container elastic telescopic, surveys and appoint in pressure In the case that the number of concurrent of business is reduced, the Slave container of the free time of recycling in time, the case where the number of concurrent for pressing survey task increases Under, newly-increased Slave container, is finally reached the effect that the pressure of dynamic pressure variation and super large concurrently surveys resource rational utilization in time Fruit.
Script diostribution device 3, which is used to pressure surveying script, is distributed to the container in executive device 4 to carry out pressure survey.Master control set The IP address information of 1 container for generating container cloud dispatching device 2 notifies script diostribution device 3, and script diostribution device 3 is connected to point Pressure is surveyed into script after hair task and is distributed to all specified distributed containers.Script diostribution device 3 mainly includes that script stores mould Block 31 and script distribution module 32, structure is as shown in Figure 6.
Script memory module 31 surveys script for storing pressure, and surveys script for the pressure executed and backed up and deleted Except operation.This module is surveyed script to pressure using NFS (Network File System) and is stored, and NFS client is arranged in NFS and visits Ask permission, the host where allowing all containers accesses the pressure in NFS system and surveys script.Script distribution module 32 will be for that will press It surveys script and is distributed to the container in executive device 4, realize script distribution function.Master control set 1 generates container cloud dispatching device 2 Container IP information notice script diostribution device 3 script distribution module 32, after script distribution module 32 is connected to distributed tasks Pressure is surveyed into script, cell therefor is distributed to according to container IP.It can also be using script distribution module 32 in slave upper vessel portion Administration container IP reports program, reports container IP, script distribution module to script distribution module 32 in real time using port snoop realization After 32 receive slave container IP, IP is configured in the configuration file of the host node of distributed Open-Source Tools, and start host node In script distribution function, realize pressure survey script be distributed to all slave containers.
Executive device 4 is for implementing pressure test.After pressure survey script is distributed to executive device 4 by script diostribution device 3, The time that the parameter setting pressure test that executive device 4 is passed to by script diostribution device 3 needs to run, there are also number of concurrent, such as 4 hours of continuance test, number of concurrent 1000 are set.Meanwhile executive device 4 passes through the elastic telescopic function of container cloud dispatching device 2 Starting and the elastic telescopic of container can be controlled.Test scene operation after the completion of, to correlation log carry out problem collect and Storage.Executive device 4 mainly includes elastic telescopic module 41, script execution module 42, log processing module 43 and result storage Module 44, structure is as shown in Figure 7.
Elastic telescopic module 41 is used to control starting and the elastic telescopic of container, surveys the number of concurrent that script requires to different pressures The layout of progress container and during the test reasonable elastic telescopic container.For example, when testing dynamic current limiting component, root Different container numbers is opened according to number of concurrent elasticity in different time periods, it is ensured that reach the test of dynamic current limiting component, and surveying Container is recycled in time after examination.
The pressure that script execution module 42 is used to start slave container surveys script, realizes script execution function.This module is in cloud The script execution module of the upper host node for introducing the distributed pressure survey tool of open source, host node had built up in configuration file and The connection of slave container realizes the pressure test of slave container by starting the execution order of host node.Log processing module 43 are used for collection, parsing and the cleaning of log, collect the container log in all executive devices 4 and are sent to host node, then lead to The analysis module in the distributed pressure survey tool of open source is crossed, log is analyzed and the pressure of generation is observed and predicted into announcement exhibition is sent to by host node Showing device 5, and log is cleared up in timing.As a result memory module 44 is for the application end of system under test (SUT) and the performance evaluation knot of data terminal The storage of fruit, to show that device 5 provides data source.
Show resource service condition of the device 5 for the tested application of real-time exhibition, CPU/ memory/IO including server with And the details such as storehouse, GC, Thread Count of memory, and pressure recovery test result, by final result storage and directive sending pressure Testing requirement proposes personnel.Show that device 5 mainly includes real-time monitoring module 51 and report generation module 52, structure such as Fig. 8 It is shown.
Resource service condition of the real-time monitoring module 51 for the tested application of real-time exhibition, CPU, memory including server And the details such as storehouse, garbage reclamation, Thread Count of memory.This module sets up environmental information receiving module, is receiving master control After the environmental information surveyed by pressure that device 1 is distributed, the configuration surroundings information in module, refers to the source jconsole by being based in time The monitor supervision platform for JVM layers of the real time monitoring that code is developed again, realizes memory/CPU/ thread pool/garbage reclamation situation to JVM Real time monitoring.Report generation module 51 is used for pressure recovery test result, and by last result storage and directive sending is to pressure Testing requirement proposes personnel.Normally, pressure is surveyed result and is sent out by mail by report generation module 51 after receiving pressure and surveying result It gives pressure test demand and proposes personnel.
Fig. 9 is the process flow that pressure survey is carried out using above-described embodiment, is mainly comprised the steps that
Step S91, master control set 1 receives pressure survey task, and can transport according to pressing the crucial pressure in survey task to survey element generation Capable pressure surveys script.
URL, the message for needing to send, number of concurrent, concurrent duration, scripting editing are inputted in script editor module 11 Module 11 can the executable pressure survey script in key generation backstage.
Step S92, data preparation module 12 is initiated to provide sufficient pressure measured data for pressure.The number of data preparation module 12 It is one of CSV, XLS or TXT format according to import format.
Step S93, data parameterization module 13 will need the attribute parameterized to be converted into parametric form, and will be after formatting Pressure survey script and be sent to the script memory module 41 of script diostribution device 4.13 pairs of pressures of data parameterization module, which are surveyed in script, to be reported The content of style, i.e., the data for needing to change in the message request sent every time are parameterized, it is ensured that each pressure is dealt into clothes It is all effective after business device.
Step S94, script memory module 31 stores various pressures and surveys script, and surveys script for the pressure executed and carry out Backup and delete operation.Script memory module 31 is surveyed script to pressure using NFS (Network File System) and is stored, and in NFS Middle setting NFS client access authority, the host where allowing all containers access the pressure in NFS system and survey script.
Step S95,32 timing of script distribution module is distributed to executive device 4 to carry out pressure test.Script distribution module 32 report program in slave upper vessel portion administration container IP, and program is realized in real time using port snoop on script distribution module 32 Container IP is reported, after script distribution module 32 receives slave container IP, IP is configured to matching for the host node of distributed Open-Source Tools It sets in file, and starts the script distribution function in host node, pressure can be surveyed script and be distributed to all slave containers.
The pressure that the embodiment provides surveys script execution process referring to Figure 10, mainly comprises the steps that
Step S101, elastic telescopic module 41 receives the pressure from script distribution module 32 and surveys script.
Step 102, elastic telescopic module 41 generate slave container by container layout mechanism on demand, do for pressure test Prepare.
The pressure that step 103, script execution module 42 start slave container surveys script, realizes that pressure surveys script execution function.This Module introduces the script execution module of the distributed pressure survey tool of open source, since host node master container is in its container Pressure surveys the connection of foundation and slave container in the client configuration of script.By the master slave mode of Master/Slave and Slave node hair pressure extending transversely on multi-homed host multinode, and collect in host node master container, realize distributed pressure Survey mechanism.The pressure survey for starting host node when being executed executes order, and the pressure test of slave container can be realized.
Step 104, log processing module 43 complete collection, parsing and the cleaning of log, collect in all executive devices 4 Container log is simultaneously sent to host node, observes and predicts announcement to log analysis and by the pressure of generation, and pressure is observed and predicted announcement finally by host node It is sent to and shows device 4, and log is cleared up in timing.
Step 105, executive device 4 store by the application end of system under test (SUT) and the results of performance analysis of data terminal, To show that device 4 provides data source.
Step 106,52 pressure recovery test result of report generation module, by last result storage and directive sending is to pressure Power testing requirement proposes personnel.
The embodiment of the present invention provides the distribution of a set of efficient high concurrent using the distributed pressure survey technology based on container cloud Formula presses survey scheme, efficiently solve pressure survey tool is at high cost, deployment is complicated, close source, pressure measurement equipment demand is big and can not be multiplexed, Pressure surveys the problems such as monitoring craftization.The embodiment of the present invention realizes traditional pressure by the distributed pressure survey scheme based on container cloud The situation that power thousandfold rises, the pressure for meeting internet finance survey demand;It realizes that pressure surveys resource multiplex, reduces pressure survey machine and be deployed to This;Introduce cloud pressure to survey, idle machine allowed all to operationalize, and the characteristic expansible by cloud elasticity, realize super large concurrently/very It is concurrent to wave may be implemented;Docker is used as the container of testing tool to build pressure test cloud, realizes lightweight The coordination of exploitation, test is realized in deployment.Currently, automating platform by providing pressure test, developer or tester are only Interface and message provided according to specification, initiate pressure, subsequent distribution pressure surveys resource, executes and concurrently press survey, performance monitoring, knot The work such as fruit analysis can just give platform to complete.By cooperation, part presses test cross that can easily give development teams completely It operates, such as non-sensitive application/non-relates to account transaction/non-high frequency transaction etc..Performance test team more pays close attention to high-risk transaction.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Specific embodiment is applied in the present invention, and principle and implementation of the present invention are described, above embodiments Explanation be merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, According to the thought of the present invention, there will be changes in the specific implementation manner and application range, in conclusion in this specification Appearance should not be construed as limiting the invention.

Claims (10)

1. a kind of method for testing pressure based on container cloud, which is characterized in that the described method includes:
Element assembling pressure survey script is surveyed according to the pressure for receiving pressure survey task, it includes that pressure is surveyed required URL, needed that the pressure, which surveys element, Message, number of concurrent, pressure survey mode and the pressure of transmission, which are surveyed, continues the duration;
The value for needing to change during pressing and surveying in script message body is surveyed to the pressure to parameterize, and combines pressure measured data will The value of parametrization is substituted for different data, observes and predicts text to generate effective pressure when operation presses and surveys script;
Number of containers needed for being calculated according to the number of concurrent of pressure survey task and the container that respective numbers are generated on Docker container cloud;
Container progress pressure test generated will be distributed to comprising pressing the pressure of measured data to survey script.
2. the method for testing pressure according to claim 1 based on container cloud, which is characterized in that the method also includes: The life cycle of each container is calculated according to the pressure survey duration of pressure survey task, it should to discharge recycling after reaching its life cycle Container.
3. the method for testing pressure according to claim 1 based on container cloud, which is characterized in that the method also includes: Obtain the pressure testing results of each container and display.
4. the method for testing pressure according to claim 1 based on container cloud, which is characterized in that generating respective numbers After container, the method also includes: the IP address of the container is obtained, will will include the pressure for pressing measured data according to the IP address It surveys script and is distributed to cell therefor.
5. the method for testing pressure according to claim 1 based on container cloud, which is characterized in that the method also includes: When the number of concurrent of the pressure survey task is reduced, idle container is recycled;When the number of concurrent of the pressure survey task increases, increase The container of respective numbers is to execute the pressure survey task.
6. a kind of pressure testing system based on container cloud, which is characterized in that the system comprises:
Script assembling unit surveys script for surveying element assembling pressure according to the pressure for receiving pressure survey task, and the pressure surveys element packet It includes message, number of concurrent, pressure survey mode and the pressure that pressure is surveyed required URL, need to be sent and surveys and continue the duration;
Script argument unit carries out parameter for surveying the value for needing to change during pressing and surveying in script message body to the pressure Change, and combine pressure measured data that the value of parametrization is substituted for different data, to generate effective pressure when operation presses and surveys script Observe and predict text;
Container generation unit, for number of containers needed for being calculated according to the number of concurrent of pressure survey task and in Docker container Yun Shangsheng At the container of respective numbers;
Script Dispatching Unit, for that will include to press the pressure of measured data to survey script to be distributed to container progress pressure test generated.
7. the pressure testing system according to claim 6 based on container cloud, which is characterized in that the container generation unit It is also used to: calculating the life cycle of each container, according to the pressure survey duration of pressure survey task to release after reaching its life cycle It puts back to and receives the container.
8. the pressure testing system according to claim 6 based on container cloud, which is characterized in that the system also includes: Display unit is monitored, for obtaining pressure testing results and the display of each container.
9. the pressure testing system according to claim 6 based on container cloud, which is characterized in that generated in the container single After member generates the container of respective numbers, the script Dispatching Unit is also used to: the IP address of the container is obtained, according to the IP Address will will include to press the pressure of measured data to survey script to be distributed to cell therefor.
10. the pressure testing system according to claim 6 based on container cloud, which is characterized in that the system also includes: Elastic telescopic unit, for recycling idle container, and in the pressure survey task when the number of concurrent of the pressure survey task is reduced Number of concurrent increase when, increase the container of respective numbers to execute the pressure survey task.
CN201910348961.4A 2019-04-28 2019-04-28 Pressure testing method and system based on container cloud Active CN110162471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910348961.4A CN110162471B (en) 2019-04-28 2019-04-28 Pressure testing method and system based on container cloud

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910348961.4A CN110162471B (en) 2019-04-28 2019-04-28 Pressure testing method and system based on container cloud

Publications (2)

Publication Number Publication Date
CN110162471A true CN110162471A (en) 2019-08-23
CN110162471B CN110162471B (en) 2023-08-11

Family

ID=67640201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910348961.4A Active CN110162471B (en) 2019-04-28 2019-04-28 Pressure testing method and system based on container cloud

Country Status (1)

Country Link
CN (1) CN110162471B (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110677321A (en) * 2019-09-25 2020-01-10 广州通导信息技术服务有限公司 Elastically-telescopic cloud pressure measuring method, device, equipment and storage medium
CN110795304A (en) * 2019-10-11 2020-02-14 苏州浪潮智能科技有限公司 Method and device for testing performance of distributed storage system
CN110795334A (en) * 2019-09-09 2020-02-14 连连银通电子支付有限公司 Testing device and method
CN111026649A (en) * 2019-11-22 2020-04-17 紫光云技术有限公司 Method and device for testing pressure and reliability of cloud product
CN111104321A (en) * 2019-12-16 2020-05-05 烽火通信科技股份有限公司 Docker-based cloud platform stability testing method and system
CN111124850A (en) * 2019-11-12 2020-05-08 上海移远通信科技有限公司 MQTT server performance testing method, system, computer equipment and storage medium
CN111414303A (en) * 2020-03-17 2020-07-14 中国建设银行股份有限公司 Auxiliary system and method for script performance test
CN111552628A (en) * 2020-03-20 2020-08-18 北京海致星图科技有限公司 Distributed pressure measurement system and method for graph database and graph service interface
CN112486807A (en) * 2020-11-18 2021-03-12 中信银行股份有限公司 Pressure testing method and device, electronic equipment and readable storage medium
CN113010385A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Task state updating method, device, equipment and medium
CN113037594A (en) * 2021-03-24 2021-06-25 北京百度网讯科技有限公司 Pressure testing method and device based on cloud service
CN113032287A (en) * 2021-05-25 2021-06-25 常州微亿智造科技有限公司 Multi-component performance testing method and system supporting distribution
CN113377665A (en) * 2021-06-25 2021-09-10 北京百度网讯科技有限公司 Container technology-based testing method and device, electronic equipment and storage medium
CN113467886A (en) * 2021-06-25 2021-10-01 四川新网银行股份有限公司 Pressure measurement engine cluster construction method based on containerized scheduling
CN114116487A (en) * 2021-11-29 2022-03-01 北京百度网讯科技有限公司 Pressure testing method and device, electronic equipment and storage medium
CN114844814A (en) * 2022-03-30 2022-08-02 中国农业银行股份有限公司 Pressure testing method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190108110A1 (en) * 2017-10-05 2019-04-11 American Megatrends, Inc. System and method for automated integration and stress testing of hardware and software service in management controller using containerized toolbox

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190108110A1 (en) * 2017-10-05 2019-04-11 American Megatrends, Inc. System and method for automated integration and stress testing of hardware and software service in management controller using containerized toolbox

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
覃海;姬源;周思明;沈冠全;: "面向电网流式数据处理的性能测试平台" *

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795334A (en) * 2019-09-09 2020-02-14 连连银通电子支付有限公司 Testing device and method
CN110795334B (en) * 2019-09-09 2023-12-29 连连银通电子支付有限公司 Testing device and method
CN110677321A (en) * 2019-09-25 2020-01-10 广州通导信息技术服务有限公司 Elastically-telescopic cloud pressure measuring method, device, equipment and storage medium
CN110677321B (en) * 2019-09-25 2021-09-17 广州通导信息技术服务有限公司 Elastically-telescopic cloud pressure measuring method, device, equipment and storage medium
CN110795304A (en) * 2019-10-11 2020-02-14 苏州浪潮智能科技有限公司 Method and device for testing performance of distributed storage system
CN110795304B (en) * 2019-10-11 2023-01-10 苏州浪潮智能科技有限公司 Method and device for testing performance of distributed storage system
CN111124850A (en) * 2019-11-12 2020-05-08 上海移远通信科技有限公司 MQTT server performance testing method, system, computer equipment and storage medium
CN111026649A (en) * 2019-11-22 2020-04-17 紫光云技术有限公司 Method and device for testing pressure and reliability of cloud product
CN111104321A (en) * 2019-12-16 2020-05-05 烽火通信科技股份有限公司 Docker-based cloud platform stability testing method and system
CN111414303A (en) * 2020-03-17 2020-07-14 中国建设银行股份有限公司 Auxiliary system and method for script performance test
CN111414303B (en) * 2020-03-17 2023-03-14 建信金融科技有限责任公司 Auxiliary system and method for script performance test
CN111552628A (en) * 2020-03-20 2020-08-18 北京海致星图科技有限公司 Distributed pressure measurement system and method for graph database and graph service interface
CN112486807A (en) * 2020-11-18 2021-03-12 中信银行股份有限公司 Pressure testing method and device, electronic equipment and readable storage medium
CN113010385A (en) * 2021-03-18 2021-06-22 山东英信计算机技术有限公司 Task state updating method, device, equipment and medium
US11915035B1 (en) 2021-03-18 2024-02-27 Shandong Yingxin Computer Technologies Co., Ltd. Task state updating method and apparatus, device, and medium
CN113037594A (en) * 2021-03-24 2021-06-25 北京百度网讯科技有限公司 Pressure testing method and device based on cloud service
US11836065B2 (en) 2021-03-24 2023-12-05 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for testing stress based on cloud service
CN113032287A (en) * 2021-05-25 2021-06-25 常州微亿智造科技有限公司 Multi-component performance testing method and system supporting distribution
CN113467886A (en) * 2021-06-25 2021-10-01 四川新网银行股份有限公司 Pressure measurement engine cluster construction method based on containerized scheduling
CN113377665A (en) * 2021-06-25 2021-09-10 北京百度网讯科技有限公司 Container technology-based testing method and device, electronic equipment and storage medium
CN114116487A (en) * 2021-11-29 2022-03-01 北京百度网讯科技有限公司 Pressure testing method and device, electronic equipment and storage medium
CN114116487B (en) * 2021-11-29 2024-03-15 北京百度网讯科技有限公司 Pressure testing method and device, electronic equipment and storage medium
CN114844814A (en) * 2022-03-30 2022-08-02 中国农业银行股份有限公司 Pressure testing method and device

Also Published As

Publication number Publication date
CN110162471B (en) 2023-08-11

Similar Documents

Publication Publication Date Title
CN110162471A (en) A kind of method for testing pressure and system based on container cloud
CN109302522B (en) Test method, test device, computer system, and computer medium
CN109933522B (en) Test method, test system and storage medium for automatic case
CN106844198B (en) Distributed dispatching automation test platform and method
Silva et al. Cloudbench: Experiment automation for cloud environments
US8584079B2 (en) Quality on submit process
CN104541247B (en) System and method for adjusting cloud computing system
CN102214139B (en) Automatic test performance control and debugging method facing distributed system
CN111124850A (en) MQTT server performance testing method, system, computer equipment and storage medium
EP2572294B1 (en) System and method for sql performance assurance services
CN108255720A (en) Software automatic test system based on cloud computing framework
CN104461856A (en) Performance test method, device and system based on cloud computing platform
CN102693183A (en) Method and system for realizing automatic software testing
CN102141962A (en) Safety distributed test framework system and test method thereof
CN107733735B (en) Script recording system and method implanted in pressure measurement device
CN110532044A (en) A kind of big data batch processing method, device, electronic equipment and storage medium
CN110048904A (en) A kind of test macro and method for user-plane function network element in 5G core net
CN109597764A (en) A kind of test method and relevant apparatus of catalogue quota
Lei et al. Performance and scalability testing strategy based on kubemark
CN110750453B (en) HTML 5-based intelligent mobile terminal testing method, system, server and storage medium
CN113032281B (en) Method and device for acquiring code coverage rate in real time
US10200271B2 (en) Building and testing composite virtual services using debug automation
CN107678965A (en) It is automatically integrating method of testing and system, service terminal, memory
Ramakrishnan et al. WORKEM: Representing and emulating distributed scientific workflow execution state
CN109828901A (en) Build method and device, Linux server and readable storage medium storing program for executing that pressure surveys environment

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
GR01 Patent grant
GR01 Patent grant