CN110874304A - Pressure testing method, device, equipment and computer readable storage medium - Google Patents
Pressure testing method, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110874304A CN110874304A CN201811020574.XA CN201811020574A CN110874304A CN 110874304 A CN110874304 A CN 110874304A CN 201811020574 A CN201811020574 A CN 201811020574A CN 110874304 A CN110874304 A CN 110874304A
- Authority
- CN
- China
- Prior art keywords
- pressure measurement
- pressure
- task
- machine
- request
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3055—Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
-
- 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/3409—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 for performance assessment
- G06F11/3433—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 for performance assessment for load management
-
- 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/3495—Performance evaluation by tracing or monitoring for systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Measuring Fluid Pressure (AREA)
Abstract
The invention provides a pressure test method, a pressure test device, pressure test equipment and a computer readable storage medium, wherein the pressure test request sent by a user is received, and the pressure test request comprises an identifier and pressure test configuration of a machine room to be tested; then, a producer thread acquires a pressure measurement task according to the pressure measurement request and puts the pressure measurement task into an idle queue; and finally, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be measured to execute the pressure measurement task. In the method provided by the invention, a user only needs to set the pressure measurement configuration and send the pressure measurement request to the pressure measurement engine, the user does not need any programming skill, does not need to deploy and maintain the environment, the learning cost is reduced, and the performance test and the capacity evaluation can be conveniently and efficiently completed.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a pressure testing method, apparatus, device, and computer readable storage medium.
Background
Pressure testing, i.e., pressure testing, is a test method for establishing the stability of a system, and is usually performed outside the normal operation range of the system to examine the functional limit and hidden danger.
In the prior art, tools such as a meter and a LoadRunner are usually used for pressure testing, a user needs to know how to deploy an environment first, if the environment is under high pressure, the distributed mode needs to be considered, and after deployment is finished, the user needs to learn how to use the environment, so that pressure testing is repeated and inefficient, the cost of manpower and time is high, and the user is inconvenient to use.
Disclosure of Invention
The invention provides a pressure testing method, a pressure testing device, pressure testing equipment and a computer readable storage medium, so that a user does not need to deploy and maintain an environment, learning cost is reduced, and performance testing and capacity evaluation can be conveniently and efficiently completed.
The first aspect of the present invention provides a pressure testing method, including:
receiving a pressure measurement request sent by a user, wherein the pressure measurement request comprises an identifier and a pressure measurement configuration of a machine room to be measured;
acquiring a pressure measurement task by a producer thread according to the pressure measurement request, and putting the pressure measurement task into an idle queue;
and the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
Further, before the producer thread acquires the pressure measurement task according to the pressure measurement request, the method further includes:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
the obtaining, by the producer thread, a pressure measurement task according to the pressure measurement request includes:
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
Further, the controlling the pressure applying machine of the machine room to be tested to execute the pressure testing task includes:
pushing test data to the press according to the pressure test task;
and selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
Further, the selecting a press according to the pressure measurement configuration includes:
acquiring the required resource ratio and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
Further, the method further comprises:
and when a process ending signal or a task stopping signal is received or a preset stopping condition is judged to be reached, ending the pressure measurement task.
Further, the method further comprises:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
Further, after controlling the pressure applying machine of the machine room to be tested to execute the pressure measurement task, the method further includes:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
A second aspect of the present invention provides a pressure testing apparatus, comprising:
the communication module is used for receiving a pressure measurement request sent by a user, wherein the pressure measurement request comprises an identifier and a pressure measurement configuration of a machine room to be measured;
the processing module is used for acquiring a pressure measurement task by a producer thread according to the pressure measurement request and putting the pressure measurement task into an idle queue; and the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
Further, the processing module is further configured to:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
Further, the processing module is specifically configured to:
pushing test data to the press according to the pressure test task;
and selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
Further, the processing module is specifically configured to:
acquiring the required resource ratio and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
Further, the communication module is further configured to receive a process end signal or a task stop signal;
the processing module is also used for judging whether a preset stopping condition is reached or not;
and the processing module is also used for finishing the pressure measurement task when receiving a process finishing signal or a task stopping signal or judging that a preset stopping condition is reached.
Further, the processing module is further configured to:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
Further, the processing module is further configured to:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
A third aspect of the present invention is to provide a pressure testing apparatus, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
A fourth aspect of the present invention is to provide a computer-readable storage medium having stored thereon a computer program;
which when executed by a processor implements the method according to the first aspect.
According to the pressure testing method, the pressure testing device, the pressure testing equipment and the computer readable storage medium, the pressure testing request sent by a user is received, and the pressure testing request comprises the identification and the pressure testing configuration of a machine room to be tested; then, a producer thread acquires a pressure measurement task according to the pressure measurement request and puts the pressure measurement task into an idle queue; and finally, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be measured to execute the pressure measurement task. In the method provided by the invention, a user only needs to set the pressure measurement configuration and send the pressure measurement request to the pressure measurement engine, the user does not need any programming skill, does not need to deploy and maintain the environment, the learning cost is reduced, and the performance test and the capacity evaluation can be conveniently and efficiently completed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a pressure testing method provided by an embodiment of the present invention;
FIG. 2 is a flow chart of a pressure testing method according to another embodiment of the present invention;
FIG. 3 is a flow chart of a pressure testing method according to another embodiment of the present invention;
FIG. 4 is a structural diagram of a pressure testing apparatus according to an embodiment of the present invention;
fig. 5 is a structural diagram of a pressure testing apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a pressure testing method according to an embodiment of the present invention. As shown in fig. 1, the embodiment provides a pressure testing method, where an execution subject is a pressure testing engine (xperf), and the method includes the following specific steps:
s101, receiving a pressure measurement request sent by a user, wherein the pressure measurement request comprises an identifier and a pressure measurement configuration of a machine room to be measured.
In this embodiment, a user sends a pressure measurement request to a pressure measurement engine, where the pressure measurement request includes an identifier of a machine room to be measured, so that the pressure measurement engine searches the machine room to be measured (Internet Data Center, idc) according to the identifier of the machine room to be measured, and the pressure measurement request also includes a pressure measurement configuration (config) set by the user, where the pressure measurement configuration includes a user request (query), a service node, an indicator threshold correlation configuration (amonitor), a service and an alarm configuration (alert) related to a service dependent service, and the like, where the query is a source of pressure measurement, for example, for a search engine service, the query is a search word of the user, and also includes a search word of the user (search word is spliced according to a service communication protocol, for example,. In this embodiment, the pressure measurement engine may store the pressure measurement request in the database after receiving the pressure measurement request sent by the user.
And S102, acquiring a pressure measurement task by a producer thread according to the pressure measurement request, and putting the pressure measurement task into an idle queue.
In this embodiment, after receiving a pressure measurement request sent by a user, the pressure measurement engine parses the pressure measurement configuration, and translates the pressure measurement configuration into an executable pressure measurement language to obtain a pressure measurement task. Specifically, a Producer thread (Producer) may obtain a pressure measurement task according to a pressure measurement request and place the pressure measurement task into an idle queue (worker). In addition, the pressure measurement engine can also store the pressure measurement task in a database, and the producer thread acquires the pressure measurement task from the database.
S103, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
In this embodiment, the pressure measurement engine obtains the pressure measurement task from the idle queue through a Consumer thread (Consumer), sends data related to the pressure measurement task to a pressure applicator (slave) of the machine room to be tested, and executes the pressure measurement task by the pressure applicator, thereby implementing the pressure test.
In the pressure testing method provided by this embodiment, a pressure testing request sent by a user is received, where the pressure testing request includes an identifier and a pressure testing configuration of a machine room to be tested; then, a producer thread acquires a pressure measurement task according to the pressure measurement request and puts the pressure measurement task into an idle queue; and finally, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be measured to execute the pressure measurement task. In the method provided by the embodiment, the user only needs to set the pressure measurement configuration and send the pressure measurement request to the pressure measurement engine, the user does not need any programming skill, does not need to deploy and maintain the environment, the learning cost is reduced, and the performance test and the capacity evaluation can be conveniently and efficiently completed.
Based on the foregoing embodiment, as shown in fig. 2, before the obtaining, by the producer thread, the pressure measurement task according to the pressure measurement request in S102, the method may further include:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
correspondingly, the step S102 of obtaining, by the producer thread, a pressure measurement task according to the pressure measurement request specifically includes:
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
In this embodiment, before the producer thread obtains the pressure measurement task, the validity of the pressure measurement request sent by the user needs to be verified, specifically including determining whether a pressure applying machine is installed in the machine room to be measured, and/or determining whether the pressure measurement configuration is legal, specifically including whether query, perf, amonitor, alert configuration is legal; and when the machine room to be tested is judged to be provided with the pressure applying machine and the pressure measurement configuration is legal, the producer thread acquires a pressure measurement task according to the pressure measurement request.
FIG. 3 is a flow of a consumer thread. Further, the step S103 of controlling the pressure applying machine of the machine room to be tested to execute the pressure measuring task may specifically include:
s1031, pushing test data to the press according to the pressure testing task;
s1032, selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
In this embodiment, after the consumer thread acquires the pressure measurement task from the idle queue, test data is pushed to the pressure applying machine according to the pressure measurement task, and the pressure applying machine for performing pressure measurement is selected according to the pressure measurement configuration, where the selected pressure applying machine may be selected according to a predetermined rule, and then the selected pressure applying machine is started to perform pressure measurement. Of course, it is also possible to select the press first, then send the test data to the selected press, and then start the press for the pressure test.
Further, selecting a pressing machine according to the pressure measurement configuration in S1031 may specifically include:
acquiring the required resource occupation ratio (quota) and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
In the embodiment, based on pressure measurement configuration, the required quota resources and the number of the pressing machines are calculated, continuous use with the highest utilization rate in the currently used pressing machines meeting the conditions is given according to quota, the pressing machines meeting the quota requirements exist, and pressure measurement is started; if not, polling is performed, so that resources are fully utilized and fragments are reduced.
Further, after the consumer thread acquires the pressure measurement task from the idle queue in S103, the method may further include:
judging whether the process is stopped, including a producer thread and a consumer thread, and a task left in operation (running), ② if not, performing query processing, such as setting a configuration to fragment a query, the query processing needs to fragment a query file, increasing pressure step by step requires a pressure source, and the fragmented query is a source for increasing pressure step by step, wherein the fragmentation is mainly because the same query does not request for service too many times at the same time, which does not conform to an actual scene, and the service capability is not an actual performance under the actual scene.
Further, the method may further include:
and when a process ending signal or a task stopping signal is received or a preset stopping condition is judged to be reached, ending the pressure measurement task.
In this embodiment, when a process termination signal (kill daemon) or a task stop signal is received or a preset stop condition is determined to be reached, it is determined that the pressure measurement task needs to be stopped, and thus the pressure measurement engine terminates the current pressure measurement task. It should be noted that, when the pressure measurement engine receives a process end signal or a task stop signal or judges that a preset stop condition is reached in the polling process of the pressure applicator, the pressure measurement task is ended; and in the pressure measurement process, when the pressure measurement engine receives a process ending signal or a task stopping signal or judges that a preset stopping condition is reached, the pressure measurement task is also ended. Wherein the preset stop condition includes: a set pressure time is reached or exceeded, or a failure qps (amount requested per second) exceeds a success qps according to an assertion condition (such as a return code of 200) when the pressure is performed by the pressure applicator, or a condition set in an amonitor alert configuration, etc. Additionally, if the pressure measurement engine receives a pause signal, the pressure measurement is paused until a resume signal is received, qps before pausing is resumed, and pressure measurement continues according to the pressure profile.
Further, the method may further include:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
Specifically, whether qps is newly added or not is judged on the basis of the existing pressure, and if so, the corresponding pressure is increased; whether the step length, the estimator and the alert in the pressure measurement configuration perf are updated or not can be judged, and if the step length, the estimator and the alert are updated, the subsequent pressure measurement task is continuously executed according to the latest configuration; whether pressure is increased according to the step length can be judged, if yes, whether the set target is reached is judged qps, if not, pressure parameters are set according to the step length, and the required quota and the number of pressure applicators are calculated to execute pressure measurement; it is also possible to determine whether the target qps has been reached and, if so, to decrement the pressure in steps, then gradually decrease qps the corresponding steps so that the pressure is gradually decreased until the final pressure is 0.
Further, after controlling the pressure applying machine of the machine room to be tested to execute the pressure measurement task, the method further includes:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
In this embodiment, under different scenarios, machine resource adjustment is performed according to a pressure measurement result and a resource adjustment formula, where:
peak qps: qpspeakLimit qps: qpsmaxThe number of machines: n is a radical ofmachine
the resource utilization rate RA and the preset resource red line RA are comparedred(e.g., 40%) and corresponding operations are performed according to the comparison result, and the specific operations are shown in table 1. Also shown in table 1 is qps corresponding operations when traffic changes, and resource adjustment can be performed according to table 1 when qps traffic changes.
TABLE 1
Note that, the machine in table 1 refers to a machine deployed by the service itself, for example: the service is provided with 2 machines, the pressure can be endured by 200qps at most, but the flow is increased, the service needs to endure 300qps now, and the service can provide the whole enduring capacity (whole capacity) of the service only by increasing the deployment machines without optimization, and the flow is reduced, so that the corresponding machines are reduced.
In the pressure testing method provided by this embodiment, a pressure testing request sent by a user is received, where the pressure testing request includes an identifier and a pressure testing configuration of a machine room to be tested; then, a producer thread acquires a pressure measurement task according to the pressure measurement request and puts the pressure measurement task into an idle queue; and finally, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be measured to execute the pressure measurement task. In the method provided by the embodiment, the user only needs to set the pressure measurement configuration and send the pressure measurement request to the pressure measurement engine, the user does not need any programming skill, does not need to deploy and maintain the environment, the learning cost is reduced, and the performance test and the capacity evaluation can be conveniently and efficiently completed. The support template can generate a pressure source more flexibly and support the stepped smooth increase of the pressure; the automatic stop of the pressure measurement can be judged according to the service node, the index threshold, the alarm information and the pressure measurement result; the configuration can be dynamically updated in the pressure measurement process so that the subsequent pressure measurement can be carried out according to the latest configuration; the execution records of each task can be managed in a centralized manner, so that follow-up investigation is facilitated; under different scenes, the machine adjustment number can be quickly given according to the pressure measurement result and the resource adjustment formula.
Fig. 4 is a structural diagram of a pressure testing apparatus according to an embodiment of the present invention. The pressure testing apparatus provided in this embodiment may specifically be the pressure testing engine in the foregoing embodiment, and may execute the processing procedure provided in the foregoing pressure testing method embodiment, as shown in fig. 4, the pressure testing apparatus includes: a communication module 41 and a processing module 42.
The communication module 41 is configured to receive a pressure measurement request sent by a user, where the pressure measurement request includes an identifier and a pressure measurement configuration of a machine room to be measured;
the processing module 42 is used for obtaining a pressure measurement task by a producer thread according to the pressure measurement request and placing the pressure measurement task into an idle queue; and the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
Further, the processing module 42 is further configured to:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
Further, the processing module 42 is specifically configured to:
pushing test data to the press according to the pressure test task;
and selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
Further, the processing module 42 is specifically configured to:
acquiring the required resource ratio and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
Further, the communication module 41 is further configured to receive a process end signal or a task stop signal;
the processing module 42 is further configured to determine whether a preset stop condition is reached;
the processing module 42 is further configured to end the pressure measurement task when receiving a process end signal or a task stop signal, or when determining that a preset stop condition is reached.
Further, the processing module 42 is further configured to:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
Further, the processing module 42 is further configured to:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
The pressure testing apparatus provided in the embodiment of the present invention may be specifically configured to perform the method embodiments provided in fig. 1 to 3, and specific functions are not described herein again.
The pressure test device provided by this embodiment receives a pressure test request sent by a user, where the pressure test request includes an identifier and a pressure test configuration of a machine room to be tested; then, a producer thread acquires a pressure measurement task according to the pressure measurement request and puts the pressure measurement task into an idle queue; and finally, the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be measured to execute the pressure measurement task. In the embodiment, the user only needs to set the pressure measurement configuration and send the pressure measurement request to the pressure measurement engine, the user does not need any programming skill, does not need to deploy and maintain the environment, the learning cost is reduced, and the performance test and the capacity evaluation can be conveniently and efficiently completed.
Fig. 5 is a structural diagram of a pressure testing apparatus according to another embodiment of the present invention. The pressure testing equipment provided by the embodiment of the invention can execute the processing flow provided by the pressure testing method embodiment. As shown in fig. 5, the present embodiment provides a pressure test apparatus including: a processor 51; a memory 52; and a computer program.
Wherein the computer program is stored in the memory 52 and configured to be executed by the processor 51 to implement the processing procedure provided by the method embodiment shown in fig. 1 to 3, and the implementation principle and technical effect thereof are similar to those of the method embodiment described above, and are not described herein again.
More specifically, the apparatus further includes a receiver 53 and a transmitter 54, which are connected to the processor 51 and the memory 52 via the bus.
In addition, the present embodiment also provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the pressure testing method described in the above embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (16)
1. A pressure testing method, comprising:
receiving a pressure measurement request sent by a user, wherein the pressure measurement request comprises an identifier and a pressure measurement configuration of a machine room to be measured;
acquiring a pressure measurement task by a producer thread according to the pressure measurement request, and putting the pressure measurement task into an idle queue;
and the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
2. The method of claim 1, wherein before the obtaining, by the producer thread, a pressure measurement task from the pressure measurement request, further comprising:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
the obtaining, by the producer thread, a pressure measurement task according to the pressure measurement request includes:
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
3. The method according to claim 1, wherein the controlling the pressure applying machine of the machine room to be tested to execute the pressure testing task comprises:
pushing test data to the press according to the pressure test task;
and selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
4. The method of claim 3, wherein selecting a press according to the pressure measurement configuration comprises:
acquiring the required resource ratio and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
5. The method according to any one of claims 1-4, further comprising:
and when a process ending signal or a task stopping signal is received or a preset stopping condition is judged to be reached, ending the pressure measurement task.
6. The method according to any one of claims 1-4, further comprising:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
7. The method according to any one of claims 1 to 4, wherein after the controlling the pressure applying machine of the machine room to be tested to perform the pressure testing task, the method further comprises:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
8. A pressure testing device, comprising:
the communication module is used for receiving a pressure measurement request sent by a user, wherein the pressure measurement request comprises an identifier and a pressure measurement configuration of a machine room to be measured;
the processing module is used for acquiring a pressure measurement task by a producer thread according to the pressure measurement request and putting the pressure measurement task into an idle queue; and the consumer thread acquires the pressure measurement task from the idle queue and controls a pressure applying machine of the machine room to be tested to execute the pressure measurement task.
9. The apparatus of claim 8, wherein the processing module is further configured to:
judging whether the machine room to be tested is provided with a pressure applying machine and/or judging whether the pressure measurement configuration is legal;
and if the machine room to be tested is provided with the pressure applying machine and the pressure measurement configuration is legal, acquiring a pressure measurement task by a producer thread according to the pressure measurement request.
10. The apparatus of claim 8, wherein the processing module is specifically configured to:
pushing test data to the press according to the pressure test task;
and selecting a pressing machine according to the pressure measurement configuration, and starting the selected pressing machine to perform pressure measurement.
11. The apparatus of claim 10, wherein the processing module is specifically configured to:
acquiring the required resource ratio and the number of pressure applying machines according to the pressure measurement configuration;
searching whether a pressing machine which meets the resource occupation ratio exists in the pressing machine or not through polling;
if the pressing machine exists, the pressing machine which is currently used and has the highest utilization rate is preferably selected.
12. The apparatus according to any one of claims 8 to 11,
the communication module is also used for receiving a process ending signal or a task stopping signal;
the processing module is also used for judging whether a preset stopping condition is reached or not;
and the processing module is also used for finishing the pressure measurement task when receiving a process finishing signal or a task stopping signal or judging that a preset stopping condition is reached.
13. The apparatus of any of claims 8-11, wherein the processing module is further configured to:
and judging whether the pressure measurement configuration and/or the request quantity per second qps change or not, and correspondingly adjusting the pressure measurement task if the pressure measurement configuration and/or the request quantity per second change.
14. The apparatus of any of claims 8-11, wherein the processing module is further configured to:
and adjusting the resources according to the pressure measurement result and a preset resource calling formula.
15. A pressure testing apparatus, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-8.
16. A computer-readable storage medium, having stored thereon a computer program;
the computer program, when executed by a processor, implementing the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811020574.XA CN110874304A (en) | 2018-09-03 | 2018-09-03 | Pressure testing method, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811020574.XA CN110874304A (en) | 2018-09-03 | 2018-09-03 | Pressure testing method, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110874304A true CN110874304A (en) | 2020-03-10 |
Family
ID=69716622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811020574.XA Pending CN110874304A (en) | 2018-09-03 | 2018-09-03 | Pressure testing method, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110874304A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414300A (en) * | 2020-03-27 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Method and device for pressure test of server |
CN111949504A (en) * | 2020-08-19 | 2020-11-17 | 政采云有限公司 | Pressure testing method, device and medium |
CN112199218A (en) * | 2020-10-26 | 2021-01-08 | 北京百家科技集团有限公司 | Pressure measurement method and device, electronic equipment and storage medium |
CN113626295A (en) * | 2020-05-07 | 2021-11-09 | 云米互联科技(广东)有限公司 | Pressure measurement data processing method and system and computer readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105207832A (en) * | 2014-06-13 | 2015-12-30 | 腾讯科技(深圳)有限公司 | Server stress testing method and device |
CN106649088A (en) * | 2016-10-09 | 2017-05-10 | 网易(杭州)网络有限公司 | Distributed pressure test method and system |
CN106815141A (en) * | 2015-12-02 | 2017-06-09 | 北京奇虎科技有限公司 | A kind of method for testing software and device |
CN107220165A (en) * | 2016-03-21 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure test on a kind of artificial line |
US9847950B1 (en) * | 2017-03-16 | 2017-12-19 | Flexera Software Llc | Messaging system thread pool |
CN107632935A (en) * | 2017-09-22 | 2018-01-26 | 郑州云海信息技术有限公司 | A kind of software systems method for testing pressure, device, equipment and storage medium |
-
2018
- 2018-09-03 CN CN201811020574.XA patent/CN110874304A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105207832A (en) * | 2014-06-13 | 2015-12-30 | 腾讯科技(深圳)有限公司 | Server stress testing method and device |
CN106815141A (en) * | 2015-12-02 | 2017-06-09 | 北京奇虎科技有限公司 | A kind of method for testing software and device |
CN107220165A (en) * | 2016-03-21 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure test on a kind of artificial line |
CN106649088A (en) * | 2016-10-09 | 2017-05-10 | 网易(杭州)网络有限公司 | Distributed pressure test method and system |
US9847950B1 (en) * | 2017-03-16 | 2017-12-19 | Flexera Software Llc | Messaging system thread pool |
CN107632935A (en) * | 2017-09-22 | 2018-01-26 | 郑州云海信息技术有限公司 | A kind of software systems method for testing pressure, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
唐胡鑫: "《网站运营与数据分析 双色版》", pages: 139 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111414300A (en) * | 2020-03-27 | 2020-07-14 | 北京字节跳动网络技术有限公司 | Method and device for pressure test of server |
CN113626295A (en) * | 2020-05-07 | 2021-11-09 | 云米互联科技(广东)有限公司 | Pressure measurement data processing method and system and computer readable storage medium |
CN113626295B (en) * | 2020-05-07 | 2023-07-07 | 云米互联科技(广东)有限公司 | Method and system for processing pressure measurement data and computer readable storage medium |
CN111949504A (en) * | 2020-08-19 | 2020-11-17 | 政采云有限公司 | Pressure testing method, device and medium |
CN112199218A (en) * | 2020-10-26 | 2021-01-08 | 北京百家科技集团有限公司 | Pressure measurement method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110874304A (en) | Pressure testing method, device, equipment and computer readable storage medium | |
CN108924221B (en) | Method and device for allocating resources | |
CN106302434B (en) | Server adaptation method, device and system | |
CN109495306B (en) | Method and equipment for expanding capacity of service network | |
US8572621B2 (en) | Selection of server for relocation of application program based on largest number of algorithms with identical output using selected server resource criteria | |
CN110351198B (en) | Flow regulation method, data transmission system, storage medium and equipment | |
CN108279974B (en) | Cloud resource allocation method and device | |
CN112311628B (en) | Network speed measuring method, system, network equipment and storage medium | |
CN104410543A (en) | An automatic testing method and system based on cloud resource | |
CN111431813B (en) | Access current limiting method, device and storage medium | |
CN112752324B (en) | Network distribution method, device and system of intelligent equipment, electronic equipment and storage medium | |
CN105791254B (en) | Network request processing method and device and terminal | |
CN108092956B (en) | Method and device for acquiring compression dictionary | |
CN110830565A (en) | Resource downloading method, device, system, electronic equipment and storage medium | |
CN108154024B (en) | Data retrieval method and device and electronic equipment | |
CN109491702B (en) | Optimization scheme determination method and device, terminal equipment and storage medium | |
CN112118151A (en) | Network speed measuring method, device, system, electronic equipment and storage medium | |
CN115225504B (en) | Resource allocation method, device, electronic equipment and storage medium | |
CN112765035A (en) | Distributed pressure test system, method, device, electronic equipment and storage medium | |
CN112566078A (en) | Device connection method and apparatus, storage medium, and electronic apparatus | |
CN112486535A (en) | Remote upgrading method and system for NB-IoT (NB-IoT) equipment | |
CN112052227A (en) | Data change log processing method and device and electronic equipment | |
US9077735B2 (en) | Method and related device for controlling service charging | |
CN111159131A (en) | Performance optimization method, device, equipment and computer readable storage medium | |
EP3579526A1 (en) | Resource file feedback method and apparatus |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200421 Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province Applicant after: Alibaba (China) Co.,Ltd. Address before: 510000 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 12 layer self unit 01 Applicant before: GUANGZHOU SHENMA MOBILE INFORMATION TECHNOLOGY Co.,Ltd. |
|
TA01 | Transfer of patent application right |