CN115408249B - Pressure testing method and device, computer equipment and storage medium - Google Patents

Pressure testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115408249B
CN115408249B CN202211341992.5A CN202211341992A CN115408249B CN 115408249 B CN115408249 B CN 115408249B CN 202211341992 A CN202211341992 A CN 202211341992A CN 115408249 B CN115408249 B CN 115408249B
Authority
CN
China
Prior art keywords
pressure
preset
pressure measurement
machine
task
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.)
Active
Application number
CN202211341992.5A
Other languages
Chinese (zh)
Other versions
CN115408249A (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.)
Shenzhen Yishi Huolala Technology Co Ltd
Original Assignee
Shenzhen Yishi Huolala Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yishi Huolala Technology Co Ltd filed Critical Shenzhen Yishi Huolala Technology Co Ltd
Priority to CN202211341992.5A priority Critical patent/CN115408249B/en
Publication of CN115408249A publication Critical patent/CN115408249A/en
Application granted granted Critical
Publication of CN115408249B publication Critical patent/CN115408249B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording 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/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

The application relates to a pressure testing method and device. The method comprises the following steps: receiving an instruction for executing a pressure measurement task, and acquiring a preset task duration, an expected value of a first target pressure measurement index, a first virtual user number and a first machine number corresponding to the pressure measurement task; selecting the pressure measuring machines with the first machine number as first target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machines according to the first virtual user number; when the running time of the pressure measurement task reaches a first time length, acquiring a first index value of a first target pressure measurement index; checking whether a preset pressurizing condition is met according to the first index value and an expected value; in response to the preset pressurization condition being met, determining a second virtual user number according to the first virtual user number, the expected value and the first index value; and performing pressure test on the first target pressure testing machine again according to the second virtual user number. The embodiment of the application can save the time for the tester to perform the pressure test and the consumed resource cost.

Description

Pressure testing method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of pressure testing, and in particular, to a pressure testing method, apparatus, computer device, and storage medium.
Background
The pressure test is an important means for software quality assurance. At present, when a server is subjected to pressure test (which may be simply referred to as pressure test), the following problems are often encountered:
1. QPS (quieries Per Second, number of interface requests Per Second) did not reach expectations;
2. in the pressure measurement process, the pressure measurement script fails to start, and no data is returned;
3. in the process of full link pressure measurement, the QPS of a single script does not reach the expectation.
When the above problem 1 occurs, the general operation flow is as follows:
(1) Setting basic information such as the number of virtual users and the number of pressure measuring machines;
(2) Performing a pressure test, the desired QPS may be pressed to a desired value, such as 200;
(3) Observing the pressure measurement result, such as the current QPS pressure reaches 100;
(4) If the QPS does not reach the expectation, stopping the wheel pressure measurement;
(5) Resetting the virtual subscriber line or adjusting the number of the pressure measuring machines, and starting a new round of test.
When the above problem 2 occurs, the general operation flow is as follows: stopping the pressure measurement, checking the log and troubleshooting the problems.
When the above problem 3 occurs, the general operation flow is as follows: and stopping the pressure testing process of all the scripts and starting a new test for all the scripts.
Therefore, when the QPS of pressure measurement is not expected, the QPS can only be continuously explored by increasing the number of pressure measurements, and in a limited pressure measurement window period, the QPS can reach an expected value by increasing the number of pressure measurement machine resources or virtual users.
Disclosure of Invention
In view of the above disadvantages, embodiments of the present application provide a pressure testing method, apparatus, computer device, and storage medium, which can save time and resource cost consumed by a tester for performing a pressure test.
The present application provides, according to a first aspect, a method of stress testing, which in one embodiment, comprises:
responding to a received instruction for executing the pressure measurement task, and acquiring a preset task duration, an expected value of a first target pressure measurement index, a first virtual user number and a first machine number corresponding to the pressure measurement task;
selecting the pressure measuring machines with the first machine number as first target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machines according to the first virtual user number;
when the running time of the pressure measurement task reaches a first time length, acquiring a first index value of a first target pressure measurement index; the first time length is less than the preset task time length;
checking whether a preset pressurizing condition is met according to the first index value and an expected value;
and responding to the satisfaction of the preset pressurization condition, determining the number of second virtual users according to the number of the first virtual users, the expected value and the first index value, and performing pressure test on the first target pressure testing machine again according to the number of the second virtual users.
In one embodiment, verifying that the preset pressurization condition is satisfied based on the first index value and the expected value includes:
judging whether the first index value is smaller than the quotient of the expected value and a preset coefficient;
if yes, judging that a preset pressurizing condition is met;
if not, judging that the preset pressurizing condition is not met.
In one embodiment, determining the second number of virtual users based on the first number of virtual users, the expected value, and the first indicator value comprises:
determining a second number of virtual users based on the following formula;
the second virtual user number = the first virtual user number + (expected value-first index value)/(first index value/first virtual user number) × 2.
In one embodiment, before checking whether the preset pressurization condition is satisfied according to the first index value and the expected value, or after performing a pressure test on the first target pressure testing machine according to the second virtual user number, the method further includes:
receiving the number of third virtual users and the number of second machines which are configured by the pressure measurement additional inlet when the running time of the pressure measurement task does not reach the preset task time;
and selecting the pressure measuring machines with the second machine number as second target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machine and the second target pressure measuring machine according to the first virtual user number and the third virtual user number.
In one embodiment, the method further comprises: when the preset machine adding condition is met, providing a pressure measurement adding inlet for a user;
the preset machine addition condition is any one of the following conditions:
a user submits a machine addition application;
the number of the current available machines is larger than a preset threshold value;
the user submits a machine addition application, and the number of the current available machines is larger than a preset threshold value.
In one embodiment, the method further comprises:
and after any pressure test of the pressure test task is completed, summarizing the pressure test results of all currently completed pressure tests of the pressure test task to obtain a summarized result, and displaying the summarized result through a report page.
In one embodiment, the method further comprises:
and responding to the situation that the preset pressurizing condition is not met, acquiring a pressure measurement result obtained by performing pressure test on the first target pressure measurement machine according to the number of the first virtual users, and displaying the pressure measurement result through a report page.
The present application provides according to a second aspect a pressure testing apparatus, which in one embodiment comprises:
the first acquisition module is used for responding to a received instruction for executing the pressure measurement task, and acquiring the preset task duration, the expected value of a first target pressure measurement index, the number of first virtual users and the number of first machines corresponding to the pressure measurement task;
the first pressure testing module is used for selecting the pressure testing machines with the first machine number as first target pressure testing machines and carrying out one-time pressure testing on the first target pressure testing machines according to the first virtual user number;
the second acquisition module is used for acquiring a first index value of the first target pressure measurement index when the running time of the pressure measurement task reaches a first time length; the first time length is less than the preset task time length;
the checking module is used for checking whether a preset pressurizing condition is met or not according to the first index value and the expected value;
and the second pressure testing module is used for responding to the satisfaction of the preset pressurization condition, determining the number of second virtual users according to the number of the first virtual users, the expected value and the first index value, and performing pressure testing on the first target pressure testing machine again according to the number of the second virtual users.
According to a third aspect, the present application provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of an embodiment of any of the methods described above when executing the computer program.
The present application provides according to a fourth aspect a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the embodiments of the method of any of the above.
In the embodiment of the application, an instruction for executing a pressure measurement task is received, and the preset task duration, the expected value of a first target pressure measurement index, the number of first virtual users and the number of first machines corresponding to the pressure measurement task are obtained; selecting the pressure measuring machines with the first machine number as first target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machines according to the first virtual user number; when the running time of the pressure measurement task reaches a first time length, acquiring a first index value of a first target pressure measurement index; checking whether a preset pressurizing condition is met according to the first index value and an expected value; in response to the preset pressurization condition being met, determining a second virtual user number according to the first virtual user number, the expected value and the first index value; and performing pressure test on the first target pressure testing machine again according to the second virtual user number. The embodiment of the application can save the time for the tester to perform the pressure test and the consumed resource cost.
Drawings
FIG. 1 is a diagram of an exemplary pressure testing method;
FIG. 2 is a schematic flow chart of a pressure testing method according to one embodiment;
FIG. 3 is a schematic flow chart of an additional pressure test in one embodiment;
FIG. 4 is a schematic diagram of a configuration page of a pressure measurement task in one embodiment;
FIG. 5 is a diagram of a report page in one embodiment;
FIG. 6 is a diagram of an alternative reporting page in one embodiment;
FIG. 7 is a schematic diagram of a configuration page for pressure tracking measurement in one embodiment;
FIG. 8 is a diagram of a post-chase tensile test report page in one embodiment;
FIG. 9 is a block diagram of a pressure testing device according to an embodiment;
fig. 10 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The application provides a pressure testing method. In one embodiment, the pressure testing method may be applied in an application environment as shown in fig. 1. Fig. 1 shows a test platform 10, and a target server 20 for performing pressure testing. The test platform can be implemented by an independent server or a server cluster composed of a plurality of servers, and the target server can be a single server or a certain service node in a full link.
A pressure testing method provided in this embodiment includes the steps shown in fig. 2, and the following description will be given by taking an example in which the method is applied to a testing platform (hereinafter, referred to as a platform) in fig. 1.
S110: in response to receiving an instruction for executing the pressure measurement task, acquiring a preset task duration, an expected value of a first target pressure measurement index, a first virtual user number and a first machine number corresponding to the pressure measurement task.
Wherein the target pressure measurement index is QPS. In other scenarios, the target pressure measurement indicator may be another indicator, such as TPS (Transactions Per Second). In the embodiments of the present application, QPS is taken as an example for explanation.
S120: and selecting the pressure measuring machines with the first machine number as first target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machines according to the first virtual user number.
S130: when the running time of the pressure measurement task reaches a first time length, acquiring a first index value of a first target pressure measurement index; the first time length is less than the preset task time length.
S140: and checking whether a preset pressurizing condition is met according to the first index value and the expected value.
S150: and responding to the satisfaction of the preset pressurization condition, determining the number of second virtual users according to the number of the first virtual users, the expected value and the first index value, and performing pressure test on the first target pressure testing machine again according to the number of the second virtual users.
In this embodiment of the application, a user, such as a tester, may configure relevant configuration information of a pressure test task on a test platform, for example, the user may specify a target server that needs to perform pressure test, a preset task duration (for example, five minutes) of the pressure test task, a QPS expected value of the pressure test, a number of virtual users (hereinafter, referred to as a first virtual user number for convenience of distinction) that perform a first round of pressure test, and a number of machines (hereinafter, referred to as a first machine number for convenience of distinction). When the pressure measurement is performed, the platform selects the pressure measurement machines (agents) with the first machine number and performs pressure measurement on the target server according to the thread number of the first virtual user number, for example, if the first machine number is 1 and the first virtual user number is 3, 1 pressure measurement machine is called to perform pressure measurement, and 3 threads are started as 3 virtual users during the pressure measurement.
During the operation of the pressure measurement task, specifically, when the operation duration of the pressure measurement task reaches a first time duration, the platform acquires a current value (namely a first index value) of a target pressure measurement index, and checks whether a preset pressurization condition is met according to the first index value and an expected value. If the preset task duration is not met, the pressurization is not carried out, and the original configuration information (namely the number of the first virtual users) is kept to continue testing until the operation duration of the pressure measurement task reaches the preset task duration.
The first time length is less than the preset task time length, and for example, assuming that the preset task time length is 5 minutes, the first time length may be any time length less than 5 minutes, such as 3 minutes. The first duration may be a preset value configured by a tester before issuing a pressure testing task, or may be automatically acquired by the platform when detecting that the index value of the target pressure testing index reaches a stable state. The method for determining whether the index value reaches the steady state is not limited in this embodiment, and for example, the index value may be kept unchanged for a continuous preset time period (flexibly set by the user, such as 30 seconds, 1 minute, and the like).
Wherein, the platform checks whether the preset pressurizing condition is met according to the first index value and the expected value, and the method comprises the following steps: judging whether the first index value is smaller than a quotient of an expected value and a preset coefficient; if yes, judging that a preset pressurizing condition is met; if not, judging that the preset pressurizing condition is not met.
The preset coefficient is a proportional value, and the value range can be more than 0 and less than or equal to 100%. Taking the expected value as 100 and the preset coefficient as 90% as an example, if the first index value is 50, 50 is made of 100 × 90%, at this time, it is determined that the preset pressurization condition is satisfied, and the pressurization operation is automatically performed, and if the first index value is 95, 95> -100 × 90%, at this time, it is determined that the preset pressurization condition is not satisfied, and the pressurization operation is not performed. The platform can respond to the situation that the preset pressurizing condition is not met, obtain the pressure measurement result obtained by performing pressure test on the first target pressure measurement machine according to the number of the first virtual users, and display the pressure measurement result through the report page, so that the user can conveniently decompress the test condition of the test task.
When the pressurization operation is carried out, the platform automatically adjusts the number of virtual users during the pressurization process (the adjusted number of virtual users is called as the second number of virtual users), and the pressure measurement is carried out once again without the need that the user restarts a new pressure measurement task based on the adjusted number of virtual users after finishing the pressure measurement task.
In one embodiment, determining the second number of virtual users based on the first number of virtual users, the expected value, and the first indicator value comprises:
determining a second number of virtual users based on the following formula;
the second number of virtual users = the first number of virtual users + (expected value-first index value)/(first index value/first number of virtual users) × 2.
In the above embodiment, if it is found that the pressure measurement based on the thread number (i.e., the first virtual user number) and the machine number (the first machine number) set by the user at the beginning cannot reach the expected flow rate in the pressure measurement process of the platform, the pressure operation is automatically executed in a pressure measurement window period (i.e., the preset task duration), and the thread number or the pressure measurement machine is automatically increased to make the current value of the target pressure measurement index reach the expected value.
In some embodiments, the platform further supports a user to add a pressure testing machine for testing while running a pressure testing task. The following describes a process of testing by a user chasing a pressure tester, that is, as shown in fig. 3, the method further includes:
s210: receiving the number of third virtual users and the number of second machines configured by the pressure measurement additional inlet when the running time of the pressure measurement task does not reach the preset task time;
s220: and selecting the pressure measuring machines with the second machine number as second target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machine and the second target pressure measuring machine according to the first virtual user number and the third virtual user number.
In this embodiment, when the operating length of the pressure measurement task has not reached the preset task length, the user may set additional pressure measurement configuration information including a new number of virtual users (hereinafter, referred to as a third number of virtual users) and a new number of machines (hereinafter, referred to as a second number of machines) set by the user through the pressure measurement addition entry. In some scenarios, the second number of machines may be a default value (which may be flexibly set according to the particular scenario, e.g., default to 1).
And additionally selecting the pressure measuring machines with the second machine number as second target pressure measuring machines by the platform, then carrying out a pressure test on the first target pressure measuring machine and the second target pressure measuring machines according to the first virtual user number and the third virtual user number, namely, continuously carrying out the pressure test on the first target pressure measuring machine according to the first virtual user number, and simultaneously carrying out a pressure test on the second target pressure measuring machine according to the third virtual user number until the running time of the pressure measuring task reaches the preset task time. It should be noted that the operation duration of the pressure measurement task reaches the preset task duration, which may be that the operation duration of the pressure measurement task is consistent with the preset task duration, or is close to the preset task duration, for example, the operation duration exceeds the preset task duration for several seconds, or is less than the preset task duration for several seconds. The number of seconds can be flexibly set, and the embodiment is not limited.
In this embodiment, the user can manually add the pressure measurement machine to add the pressure measurement, so that the time, the labor and the hardware cost can be saved.
It should be noted that the step shown in fig. 3 may be performed before the step of checking whether the preset pressure condition is satisfied according to the first index value and the expected value, or may be performed after the step of performing a pressure test on the first target pressure measuring machine according to the second number of virtual users.
Further, the method further comprises: and when the preset machine adding condition is met, providing a pressure measurement adding inlet for a user. Wherein the preset machine adding condition is any one of the following conditions:
(1) The user submits a machine additional application, for example, when the user configures a pressure measurement task, a function option of 'additional pressure measurement' is selected;
(2) The number of the current available machines is larger than a preset threshold value;
(3) The user submits a machine addition application, and the number of the current available machines is larger than a preset threshold value.
Based on the above embodiments, in some embodiments, the method further includes: and after any pressure test of the pressure test task is completed, summarizing the pressure test results of all currently completed pressure tests of the pressure test task to obtain a summarized result, and displaying the summarized result through a report page.
For example, it is assumed that a pressure measurement result obtained by performing a pressure test on the first target pressure measurement machine according to the first number of virtual users is a first pressure measurement result, a pressure measurement result obtained by performing a pressure test on the first target pressure measurement machine according to the second number of virtual users is a second pressure measurement result, and a pressure measurement result obtained by performing a pressure test on the first target pressure measurement machine and the second target pressure measurement machine according to the first number of virtual users and the third number of virtual users is a third pressure measurement result. If the platform generates a second pressure measurement result, summarizing the first pressure measurement result and the second pressure measurement result, and displaying the summarized result of the first pressure measurement result and the second pressure measurement result through a report page; if the platform generates a third pressure measurement result after the step of performing the pressure test on the first target pressure measurement machine once according to the second number of virtual users, summarizing the first pressure measurement result, the second pressure measurement result and the third pressure measurement result, and displaying the summarized result of the first pressure measurement result, the second pressure measurement result and the third pressure measurement result through a report page.
In the embodiment, the multiple pressure measurement results are collected in the same report, so that the usability of the report can be increased, and a user can clearly know the test condition of the pressure measurement task.
The present application also provides a specific application example to explain the above embodiments.
In the present application, QPS is taken as an example, and both the pressure operation and the pressure tracking operation require a user to submit an application (e.g., select an option of a related function) when configuring a pressure measurement task, and a subsequent platform will be executed in the pressure measurement process.
In this application example, there are some cases as follows depending on different selections of the pressurizing operation and the additional pressure measuring operation by the user.
The first case is that the user selects the automatic pressurizing and pressure tracing measuring machine, and the flow is as follows:
1. before starting pressure measurement, a user selects an automatic pressurization function and fills in an expected value of QPS, information required to be configured by the user can be shown in FIG. 4, and the 'operation time' in the graph is the preset task duration;
2. when the platform calculates the current QPS < the QPS expected value × 90%, the required thread number is calculated, and the thread number increasing standard is as follows: (expected value-first index value)/(first index value/first virtual user number) × 2, and then automatically adjusting the number of threads in the pressure measurement configuration;
illustratively, when it is determined that the current QPS < QPS expected value 90%, auto-pressurization is turned on. Assuming that before pressurization, the number of virtual users is 1, and the QPS of the pressure measurement is 3; the platform automatically determines that the current QPS < QPS expected value 90% is satisfied by the preset pressurization condition; and then, automatically calculating the number of virtual users needing to be added to be 70, and finally completing the addition of the number of virtual users, wherein the number of virtual users is increased from 1 to 71, and the QPS of pressure measurement is increased from 3 to about 100, the expected value is successfully reached, and an effect graph of the result is shown by a report page as shown in FIG. 5.
3. After the platform reads the pressure measurement configuration, automatically starting a new test on the original pressure measurement machine;
4. if the user further feels that the current QPS does not meet the requirements, the pressure measurement machine can be newly added through the additional pressure measurement entry of the report page (see fig. 6), and at this time, the user is required to fill in the number of virtual users that need to be added, as shown in fig. 7.
The second case is that the user selects the automatic pressurization without tracing the pressurization testing machine, and the related flow is as follows:
1. before starting pressure measurement, a user selects an automatic pressurization function and fills in QPS restriction;
2. when the platform calculates the current QPS < the QPS expected value × 90%, the required thread number is calculated, and the thread number increasing standard is as follows: (expected value-first index value)/(first index value/first virtual user number) × 2, and then automatically adjusting the number of threads in the pressure measurement configuration;
3. and reading the adjusted pressure measurement configuration, automatically starting a new test on the original pressure measurement machine, and if the test is expected, the user can not add the pressure measurement machine for testing.
The third case is that the user only checks the auto pressurization, and if the current QPS has reached the expected value, the process flow is:
after the platform calculates the current QPS > QPS expected value × 90%, it is determined that the preset pressurization condition is not satisfied, i.e., pressurization is not required, and then the automatic pressurization operation will not be performed.
The fourth is that the user does not select the automatic pressurization, but has an additional pressure measuring machine, and the related flow is as follows:
1. the platform acquires pressure measurement configuration, and after finding that automatic pressurization is not started, automatic pressurization operation cannot be executed even if the current QPS does not reach an expected value;
2. the user may add a new pressure measuring machine through the report page, in which the user fills in the number of virtual users to be added, and then starts pressure measurement on the new pressure measuring machine, and the corresponding number of pressure measuring machines and the number of virtual users on the report page may change accordingly, as shown in fig. 8.
In the fifth case, the user does not check the automatic pressurization and does not chase the pressurization measuring machine, and the related flow is as follows:
1. the platform acquires pressure measurement configuration, and after finding that automatic pressurization is not started, automatic pressurization operation cannot be executed even if the current QPS does not reach an expected value;
2. the user does not actively trigger the pressure tracking and measuring machine, and the platform cannot track the pressure tracking and measuring machine for pressure measurement.
The application example can at least realize the following technical effects:
(1) The pressure measuring machine can be started for two times at the same time, and a large number of tests show that the expected value can be reached only by pressurizing once, so that the time of a user, the cost of hardware and the like are effectively saved, and the test efficiency is improved;
(2) Whether virtual users need to be added or not and the number of virtual users need to be added can be accurately calculated, and the phenomenon that the QPS cannot be expected due to the fact that the number set by the users is small is avoided;
(3) The results of multiple pressure measurements can be summarized in the same report, namely after automatic pressurization or additional pressure measurement, additional reports cannot be added, and the usability is improved.
Fig. 2-3 are schematic flow diagrams of a pressure testing method in one embodiment. It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
Based on the same inventive concept, the application also provides a pressure testing device. In the present embodiment, as shown in fig. 9, the pressure testing apparatus includes the following modules:
the first obtaining module 110 is configured to, in response to receiving a command for executing a pressure measurement task, obtain a preset task duration, an expected value of a first target pressure measurement index, a first number of virtual users, and a first number of machines corresponding to the pressure measurement task;
the first pressure measurement module 120 is configured to select pressure measurement machines of the first machine number as first target pressure measurement machines, and perform a pressure test on the first target pressure measurement machines according to the first virtual user number;
a second obtaining module 130, configured to obtain a first index value of the first target pressure measurement index when the operation duration of the pressure measurement task reaches a first time duration; the first time length is less than the preset task time length;
a checking module 140 for checking whether a preset pressurizing condition is satisfied according to the first index value and the expected value;
and the second pressure testing module 150 is configured to determine, in response to that the preset pressurization condition is met, the number of second virtual users according to the number of first virtual users, the expected value, and the first index value, and perform a pressure test on the first target pressure testing machine again according to the number of second virtual users.
In one embodiment, the verification module 140 is specifically configured to:
judging whether the first index value is smaller than the quotient of the expected value and a preset coefficient;
if yes, judging that a preset pressurizing condition is met;
if not, judging that the preset pressurizing condition is not met.
In an embodiment, when the second pressure measurement module 150 determines the second number of virtual users according to the first number of virtual users, the expected value, and the first index value, specifically, the second pressure measurement module is configured to:
determining a second number of virtual users based on the following formula;
the second number of virtual users = the first number of virtual users + (expected value-first index value)/(first index value/first number of virtual users) × 2.
In one embodiment, the apparatus further comprises a third pressure measurement module.
The third pressure testing module is used for receiving the third virtual user number and the second machine number which are configured by the pressure testing additional inlet when the running time of the pressure testing task does not reach the preset task time by the user before the first index value and the expected value are used for testing whether the preset pressure condition is met or not or after one pressure test is carried out on the first target pressure testing machine according to the second virtual user number; and selecting the pressure measuring machines with the second machine number as second target pressure measuring machines, and carrying out primary pressure test on the first target pressure measuring machines and the second target pressure measuring machines according to the first virtual user number and the third virtual user number.
In one embodiment, the apparatus further comprises an inlet providing module. And the entrance providing module is used for providing a pressure measurement adding entrance for a user when a preset machine adding condition is met.
The preset machine addition condition is any one of the following conditions: a user submits a machine addition application; the number of the current available machines is larger than a preset threshold value; the user submits a machine addition application, and the number of the current available machines is larger than a preset threshold value.
In one embodiment, the apparatus further comprises a report display module.
And the report display module is used for summarizing the pressure test results of all currently completed pressure tests of the pressure test task to obtain a summarized result and displaying the summarized result through a report page after any pressure test of the pressure test task is completed.
In an embodiment, the report display module is further configured to, in response to that the preset pressurization condition is not met, obtain a pressure measurement result obtained by performing a pressure test on the first target pressure measurement machine according to the first number of virtual users, and display the pressure measurement result through a report page.
For the specific definition of the pressure testing device, reference may be made to the definition of the pressure testing method above, and details are not repeated here. The various modules in the pressure testing apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data such as pressure measurement configuration information, and the specific stored data can also be referred to the limitations in the above method embodiments. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a stress testing method.
Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The present embodiment also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method provided in any of the above method embodiments.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method as provided in any of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the embodiments of the methods described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A method for stress testing a target server, the method comprising:
in response to receiving an instruction for executing a primary pressure measurement task, acquiring a preset task duration, an expected value of a first target pressure measurement index, a first virtual user number and a first machine number corresponding to the pressure measurement task;
selecting the pressure measuring machines with the first machine number as first target pressure measuring machines, and carrying out one-time pressure test on the first target pressure measuring machines according to the first virtual user number;
when the running time of the pressure measurement task reaches a first time length, acquiring a first index value of the first target pressure measurement index; the first time length is less than the preset task time length;
checking whether a preset pressurization condition is met according to the first index value and the expected value;
and responding to the satisfaction of the preset pressurization condition, determining a second virtual user number according to the first virtual user number, the expected value and the first index value, and performing a pressure test on the first target pressure testing machine again according to the second virtual user number.
2. The method of claim 1, wherein verifying that a preset pressurization condition is met based on the first indicator value and the expected value comprises:
judging whether the first index value is smaller than the quotient of the expected value and a preset coefficient;
if yes, judging that the preset pressurizing condition is met;
if not, judging that the preset pressurizing condition is not met.
3. The method of claim 1, wherein determining a second number of virtual users based on the first number of virtual users, the expected value, and the first index value comprises:
determining the second number of virtual users based on the following formula;
the second number of virtual users = the first number of virtual users + (the expected value-the first index value)/(the first index value/the first number of virtual users) × 2.
4. The method of claim 1, wherein before checking whether a preset pressurization condition is met based on the first indicator value and the expected value, or after performing a pressure test on the first target pressure test machine based on the second number of virtual users, the method further comprises:
receiving the third virtual user number and the second machine number configured by a pressure measurement additional inlet when the running time of the pressure measurement task does not reach the preset task time;
and selecting the pressure measuring machines with the second machine number as second target pressure measuring machines, and carrying out primary pressure test on the first target pressure measuring machine and the second target pressure measuring machines according to the first virtual user number and the third virtual user number.
5. The method of claim 4, wherein the method further comprises: providing the pressure measurement adding inlet for the user when a preset machine adding condition is met;
the preset machine addition condition is any one of the following conditions:
the user submits a machine addition application;
the number of the current available machines is larger than a preset threshold value;
the user submits a machine addition application, and the number of the current available machines is larger than a preset threshold value.
6. The method of claim 1 or 4, wherein the method further comprises:
and after any pressure test of the pressure test task is completed, summarizing the pressure test results of all currently completed pressure tests of the pressure test task to obtain a summarized result, and displaying the summarized result through a report page.
7. The method of claim 1, wherein the method further comprises:
and responding to the situation that the preset pressurizing condition is not met, acquiring a pressure measurement result obtained by performing pressure test on the first target pressure measurement machine according to the number of the first virtual users, and displaying the pressure measurement result through a report page.
8. An apparatus for stress testing a target server, the apparatus comprising:
the first acquisition module is used for responding to a received instruction for executing a primary pressure measurement task, and acquiring the preset task duration, the expected value of a first target pressure measurement index, the number of first virtual users and the number of first machines corresponding to the pressure measurement task;
the first pressure testing module is used for selecting the pressure testing machines with the first machine number as first target pressure testing machines and carrying out one-time pressure testing on the first target pressure testing machines according to the first virtual user number;
the second acquisition module is used for acquiring a first index value of the first target pressure measurement index when the running time of the pressure measurement task reaches a first time length; the first time length is less than the preset task time length;
the checking module is used for checking whether a preset pressurizing condition is met or not according to the first index value and the expected value;
and the second pressure testing module is used for responding to the satisfaction of the preset pressurization condition, determining the number of second virtual users according to the number of the first virtual users, the expected value and the first index value, and performing pressure testing on the first target pressure testing machine again according to the number of the second virtual users.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202211341992.5A 2022-10-31 2022-10-31 Pressure testing method and device, computer equipment and storage medium Active CN115408249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211341992.5A CN115408249B (en) 2022-10-31 2022-10-31 Pressure testing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211341992.5A CN115408249B (en) 2022-10-31 2022-10-31 Pressure testing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115408249A CN115408249A (en) 2022-11-29
CN115408249B true CN115408249B (en) 2023-03-24

Family

ID=84167677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211341992.5A Active CN115408249B (en) 2022-10-31 2022-10-31 Pressure testing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408249B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398272A (en) * 2022-01-06 2022-04-26 北京沃东天骏信息技术有限公司 Pressure measurement method and pressure measurement device for combination performance bottleneck positioning

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2990928A1 (en) * 2015-06-25 2016-12-29 Packers Plus Energy Services Inc. Pressure testable hydraulically activated wellbore tool
CN111414300A (en) * 2020-03-27 2020-07-14 北京字节跳动网络技术有限公司 Method and device for pressure test of server
CN111666194B (en) * 2020-05-21 2022-02-08 平安科技(深圳)有限公司 Pressurization parameter self-adaptive adjusting method and device, computer equipment and storage medium
CN113114504B (en) * 2021-04-13 2022-08-30 百度在线网络技术(北京)有限公司 Method, apparatus, device, medium and product for allocating resources
CN114416512A (en) * 2022-01-25 2022-04-29 中国工商银行股份有限公司 Test method, test device, electronic equipment and computer storage medium
CN114844814A (en) * 2022-03-30 2022-08-02 中国农业银行股份有限公司 Pressure testing method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398272A (en) * 2022-01-06 2022-04-26 北京沃东天骏信息技术有限公司 Pressure measurement method and pressure measurement device for combination performance bottleneck positioning

Also Published As

Publication number Publication date
CN115408249A (en) 2022-11-29

Similar Documents

Publication Publication Date Title
CN109542712B (en) Server pressure testing method and device, computer equipment and storage medium
CN109062788B (en) Test case generation method and device, computer equipment and storage medium
CN112115005B (en) Test data acquisition method and device, computer equipment and storage medium
CN111104273A (en) Batch task-based automatic distribution testing method and device and computer equipment
CN110912786B (en) Gateway pressure testing method and device, computer equipment and storage medium
CN109086545A (en) Engine pedestal demarcates test optimization method, computer equipment and system
CN110798376A (en) Interface testing method and device, computer equipment and storage medium
CN114385485A (en) Interface test method, device, equipment and storage medium
CN111257672A (en) Line loss point inspection method and device, computer equipment and storage medium
CN115048257A (en) System service function verification method and device, computer equipment and storage medium
CN115408249B (en) Pressure testing method and device, computer equipment and storage medium
WO2016188101A1 (en) Service system test method and device
CN108776642B (en) Test report generation method and device, computer equipment and storage medium
CN110309057B (en) Automatic script-based flow project testing method and related equipment
CN113377669A (en) Automatic testing method and device, computer equipment and storage medium
CN112363187A (en) Automatic testing method and system for communication module GNSS sensitivity
CN116342256A (en) Wind control strategy testing method and device, computer equipment and storage medium
CN115098349A (en) Full link voltage measurement method, device and equipment based on micro-service architecture
CN114579473A (en) Application testing method, device, equipment and storage medium
CN113778552A (en) Monitoring parameter modification method and device and computer equipment
CN109614307B (en) Online pressure testing method and device of service system and server
CN111985010A (en) Interception verification method and device for notebook hard disk, computer equipment and storage medium
CN112527606A (en) Data flow analysis method and device, computer equipment and storage medium
CN111538636B (en) Computer equipment determination method and device and storage medium
CN111090586B (en) Method and device for reporting code coverage rate data file and computer equipment

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