CN110865913A - Pressure testing method and device - Google Patents
Pressure testing method and device Download PDFInfo
- Publication number
- CN110865913A CN110865913A CN201911069384.1A CN201911069384A CN110865913A CN 110865913 A CN110865913 A CN 110865913A CN 201911069384 A CN201911069384 A CN 201911069384A CN 110865913 A CN110865913 A CN 110865913A
- Authority
- CN
- China
- Prior art keywords
- test
- testing
- service flow
- preset time
- tested
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 232
- 238000000034 method Methods 0.000 claims abstract description 21
- 238000012545 processing Methods 0.000 claims description 22
- 230000008859 change Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a pressure testing method and a pressure testing device, wherein the method comprises the following steps: the method comprises the steps of collecting first service flow actually generated by a device to be tested in a plurality of preset time periods, determining second service flow used for testing in each testing time period according to the first service flow in the plurality of preset time periods, starting a thread used for sending a testing task to the device to be tested according to the second service flow in each testing time period, and carrying out pressure testing on the device to be tested. The technical scheme can simulate the service flow borne by the device to be tested in a real scene, so that the performance of the device to be tested in the real scene can be accurately evaluated.
Description
Technical Field
The embodiment of the invention relates to the field of financial technology (Fintech), in particular to a method and a device for pressure testing.
Background
With the development of computer technology, more and more technologies are applied in the financial field, the traditional financial industry is gradually changing to financial technology, and the pressure testing technology (performance testing technology) is no exception, but due to the safety and real-time requirements of the financial and payment industries, higher requirements are also put forward on the pressure testing technology.
In the conventional pressure test, a fixed pressure test mode is mainly adopted, for example, a pressure test is performed on a device to be tested according to 100 user concurrency numbers or 500TPS (Transaction Per Second). However, the test result obtained by this test method often cannot make an accurate evaluation on the device under test.
Disclosure of Invention
The embodiment of the invention provides a pressure test method and a pressure test device, which are used for solving the problem that the existing pressure test can not simulate the service flow of a real scene, so that the device to be tested can not be accurately evaluated.
The pressure testing method provided by the embodiment of the invention comprises the following steps:
acquiring first service flow actually generated by a device to be tested in a plurality of preset time periods;
determining second service flow for testing in each testing time period according to the first service flow in the preset time periods;
and starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval, and carrying out pressure test on the device to be tested.
Optionally, the determining, according to the first service traffic of the multiple preset time periods, second service traffic for testing in each testing time period includes:
performing the following operations for any two adjacent preset time periods in the plurality of preset time periods:
if the two preset time periods are continuous, determining the first service flow of each preset time period as the second service flow of each preset time period corresponding to the test time period;
and if the two preset time periods are discontinuous, determining a plurality of test time periods according to the two preset time periods, and determining a second service flow of each test time period according to the first service flows of the two preset time periods.
Optionally, the determining the second service traffic of each test period according to the first service traffic of the two preset periods includes:
determining a trend rule of historical service flow in a time period between the two preset time periods in the historical data;
and determining the second service flow of each testing time period according to the trend rule and the first service flows of the two preset time periods.
Optionally, the trend rule is a linear change;
the second service flow of each test period is determined, and the second service flow accords with a formula (1);
the formula (1) is:
wherein, B1Is the first traffic flow of the previous one of two preset time periods, B2Is the first traffic flow of the latter one of two preset periods, A1For the preceding one of two predetermined time periods, A2For a later one of two predetermined time periods, A1+ K is the kth test period in the period between two preset periods,is A1And + K testing the second service flow in the time period.
Optionally, the second service traffic is a user concurrency number;
the starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval to perform a pressure test on the device to be tested comprises:
starting N threads; n is determined by the maximum user concurrency number in the user concurrency numbers of all the test periods;
for any testing time period, according to the user concurrency number of the testing time period, calling M threads corresponding to the user concurrency number of the testing time period, so that each thread in the M threads continuously sends a testing task to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
Optionally, the second service traffic is number of transactions per second TPS;
the starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval to perform a pressure test on the device to be tested comprises:
starting N threads; n is determined by the maximum TPS in the TPS of each test period;
calling M threads corresponding to TPS in the testing time period according to the TPS in the testing time period so as to enable each thread in the M threads to send a preset number of testing tasks to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
In the technical scheme, the service flow of the device to be tested in each testing time period is determined by acquiring the service flow actually generated by the device to be tested in a plurality of preset time periods, and the determined service flow in each testing time period is used for performing pressure testing on the device to be tested, so that the service flow borne by the device to be tested in a real scene can be simulated, and the performance of the device to be tested in the real scene can be accurately evaluated.
Correspondingly, the embodiment of the invention also provides a pressure testing device, which comprises:
the device comprises a collecting unit and a processing unit;
the acquisition unit is used for acquiring first service flow actually generated by the device to be tested in a plurality of preset time periods;
the processing unit is used for determining second service flow used for testing in each testing time interval according to the first service flow in the preset time intervals; and starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval, and carrying out pressure test on the device to be tested.
Optionally, the processing unit is specifically configured to:
performing the following operations for any two adjacent preset time periods in the plurality of preset time periods:
if the two preset time periods are continuous, determining the first service flow of each preset time period as the second service flow of each preset time period corresponding to the test time period;
and if the two preset time periods are discontinuous, determining a plurality of test time periods according to the two preset time periods, and determining a second service flow of each test time period according to the first service flows of the two preset time periods.
Optionally, the processing unit is specifically configured to:
determining a trend rule of historical service flow in a time period between the two preset time periods in the historical data;
and determining the second service flow of each testing time period according to the trend rule and the first service flows of the two preset time periods.
Optionally, the trend rule is a linear change;
the processing unit is specifically configured to:
determining a second traffic flow for each of the test periods according to formula (1);
the formula (1) is:
wherein, B1Is the first traffic flow of the previous one of two preset time periods, B2Is the first traffic flow of the latter one of two preset periods, A1For the preceding one of two predetermined time periods, A2For a later one of two predetermined time periods, A1+ K is the kth test period in the period between two preset periods,is A1And + K testing the second service flow in the time period.
Optionally, the second service traffic is a user concurrency number;
the processing unit is specifically configured to:
starting N threads; n is determined by the maximum user concurrency number in the user concurrency numbers of all the test periods;
for any testing time period, according to the user concurrency number of the testing time period, calling M threads corresponding to the user concurrency number of the testing time period, so that each thread in the M threads continuously sends a testing task to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
Optionally, the second service traffic is number of transactions per second TPS;
the processing unit is specifically configured to:
starting N threads; n is determined by the maximum TPS in the TPS of each test period;
calling M threads corresponding to TPS in the testing time period according to the TPS in the testing time period so as to enable each thread in the M threads to send a preset number of testing tasks to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
Correspondingly, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the pressure testing method according to the obtained program.
Accordingly, embodiments of the present invention also provide a computer-readable non-volatile storage medium, which includes computer-readable instructions, and when the computer-readable instructions are read and executed by a computer, the computer-readable instructions cause the computer to perform the above-mentioned method for pressure testing.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method for pressure testing according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a pressure testing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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 exemplarily shows a system architecture to which a method for pressure testing is applied, where the system architecture may include a testing device 101 and a device under test 102, and when the device under test 102 performs a business change or a software/hardware improvement, the testing device 101 is required to perform pressure testing on the device under test 102. Specifically, the testing device 101 sends a testing task to the device to be tested 102, the device to be tested 102 receives the testing task and processes the testing task, and the testing device 101 generates a performance result of the device to be tested 102 according to parameters such as response time of the device to be tested 102 for processing the testing task, the maximum user concurrency number, the maximum TPS and the like. The user concurrency number refers to the number of user requests/transactions processed by the system at the same time, and the TPS refers to the number of transaction requests processed by the system per second.
Based on the above description, fig. 2 exemplarily shows a flow of a method for pressure testing according to an embodiment of the present invention, where the flow may be performed by a device for pressure testing, which may be located in a testing device, and may be the testing device.
As shown in fig. 2, the process specifically includes:
the method includes the steps that a plurality of preset time periods of a device to be tested can be determined according to specific service conditions of the device to be tested, and then first service flow actually generated by the device to be tested is collected in each preset time period, wherein the preset time period is understood as a time period, the time period can be 1s, 2s or 1min, and the time period is determined according to actual experience.
For example, according to the historical data of the traffic flow of the device to be tested, it may be determined that the traffic flow of the device to be tested in the 1 st to 3 rd periods is in a small floating trend, the traffic flow of the 3 rd to 20 th periods is in a linear increase, the traffic flow of the 21 st period is suddenly decreased, and the traffic flow of the 21 st to 40 th periods is in an exponential increase, and then preset time periods may be set in the 1 st to 40 th periods, which are respectively the 1 st, 2 nd, 3 rd, 20 th, 21 st, and 40 th periods, so as to determine the traffic flow in the 1 st, 2 nd, 3 rd, 20 th, 21 st, and 40 th periods, as shown in table 1.
TABLE 1
determining second service traffic of each test time period according to the acquired first service traffic of a plurality of preset time periods, wherein two adjacent preset time periods in the plurality of preset time periods can be continuous or discontinuous, as shown in table 1, two preset time periods 1s and 2s are adjacent and continuous, and two preset time periods 3s and 20s are adjacent and discontinuous; two adjacent test periods of the plurality of test periods are both continuous.
In a specific implementation, whether two adjacent preset time periods in a plurality of preset time periods are continuous or not can be determined, for the two adjacent and continuous preset time periods, the two preset time periods can correspond to two test time periods, and the first service traffic of each preset time period is respectively determined as the second service traffic of each preset time period corresponding to the test time period; for two adjacent but discontinuous preset time periods, a plurality of test time periods are determined according to the two preset time periods, and the second service flow of each test time period in the plurality of test time periods is determined according to the first service flow of the two preset time periods.
As in table 1, if the 1 st and 2 nd preset periods are adjacent and consecutive, the 1 st and 2 nd preset periods may be determined as two test periods, respectively, and the first service traffic 50 and 51 corresponding to the 1 st and 2 nd (preset periods) may be determined as the second service traffic 50 and 51 corresponding to the 1 st and 2 nd (test periods), respectively. If the two preset time periods 3s and 20s are adjacent but not consecutive, the test time periods 3s, 4s, 5s, 6s … … th, 19s and 20s can be determined according to the time periods 3s and 20s, and the second traffic flows 3s, 4s, 5s, 6s … … th, 19s and 20s can be determined according to the first traffic flows 51 and 200 corresponding to the time periods 3s and 20s, respectively.
When the second service traffic of each testing period is determined according to the first service traffic of two preset periods, specifically, a trend rule of the historical service traffic of the period between the two preset periods in the historical data of the device to be tested may be determined, for example, the service traffic between the two preset periods is linearly increased, exponentially increased, linearly decreased, and the like, and then the second service traffic of each testing period is determined according to the trend rule and the first service traffic of the two preset periods.
When the trend rule of the historical service flow in the time period between two preset time periods is linear change, the second service flow in each test time period can be determined through the formula (1).
Wherein, formula (1) is:
wherein, B1Is the previous one of two preset time periodsFirst traffic flow of a time period, B2Is the first traffic flow of the latter one of two preset periods, A1For the preceding one of two predetermined time periods, A2For a later one of two predetermined time periods, A1+ K is the kth test period in the period between two preset periods,is A1+ K testing the second service flow in the time interval;
still by way of example, the second service traffic of the 3 rd service in the test period, that is, the first service traffic of the 3 rd service in the preset period, and the second service traffic of the 20 th service in the test period, that is, the first service traffic of the 20 th service in the preset period; determining a second service flow of a testing period between two preset periods according to the first service flow of the 3 rd service flow in the preset period and the first service flow of the 20 th service flow in the preset period, wherein the 4 th, 5 th and 6 th service … … th service flows are respectively the first, second, third, … … and 16 th testing periods of the 3 rd and 20 th service flows, for example, if the second service flow of the 4 th service flow in the testing period is calculated, thenSimilarly, second service flows corresponding to the 5 th, 6 th, … … th and 19 th test periods are obtained, which can be shown in table 2.
TABLE 2
In the above example, the 21 st, 22 nd, 23 st, 24 th, … … th, 39 th, and 40 th traffic flows may be further determined as the test periods according to the 21 st and 40 th traffic flows, respectively, and the 21 st, 22 nd, 23 st, 24 th, … … th, 39 th, and 40 th traffic flows may be determined according to the 21 st and 40 th traffic flows 105 and 300, respectively. For example, the finally generated service flows corresponding to the test periods are shown in table 3.
TABLE 3
In the embodiment of the invention, the performance of the device to be tested can be tested in two ways, one is to test the performance of the device to be tested by adopting the user concurrency index, and the other is to test the performance of the device to be tested by adopting the TPS index.
Specifically, when the performance of the device to be tested is tested by using the user concurrency index, the second service traffic is the user concurrency number, and the number N of the start threads can be determined according to the maximum user concurrency number in the user concurrency numbers of each test period, where N is a positive integer, and after the N threads are started, for any test period, according to the user concurrency number of the test period, M threads corresponding to the user concurrency number of the test period are called in the N started threads, so that each thread in the M threads continuously sends a test task to the device to be tested in the test period, where M is a positive integer and M is less than or equal to N. For example, if the maximum user concurrency number in the user concurrency numbers of each test period is 300, 300 threads can be determined to be started, each thread can be labeled with an index number, in the 1 st s, the actual service flow of the device to be tested is 50 user concurrency numbers, the second service flow for testing is 50 user concurrency numbers, the threads with the index numbers of 0 to 49 can be started, and each thread is used for continuously sending a test task to the device to be tested, so that the device to be tested is simulated to receive a task request sent by 50 users together in the 1 st s test period.
In the actual use process, after the testing device starts the threads, each started thread judges whether a testing task needs to be sent to the device to be tested every 10ms, if so, the testing task is sent to the device to be tested, otherwise, the judgment can be carried out again after 10ms delay.
When the performance of the device to be tested is tested by adopting the TPS index, the second service flow is TPS, the number N of the starting threads can be determined according to the maximum TPS in the TPS in each testing period, wherein N is a positive integer, after the N threads are started, M threads corresponding to the TPS in the testing period can be called in the started N threads according to the TPS in any testing period, so that each thread in the M threads sends a preset number of testing tasks to the device to be tested in the testing period, wherein M is a positive integer, and M is less than or equal to N. For example, it is determined that the maximum TPS in TPS of each test period is 1000, 200 threads may be determined to be started, each thread may be labeled with an index number, when 1s is reached, an actual TPS of a device to be tested is 250, a second traffic flow for testing is 250TPS, threads with index numbers of 0 to 49 may be started, each thread is used to send 5 test tasks to the device to be tested, the total 250 test tasks are sent, and after the test device determines to send 250 test tasks to the device to be tested, sending of the test tasks to the device to be tested may be stopped, thereby simulating that the device to be tested receives 250 test tasks in the 1s test period. Here, the number of test tasks sent by each of the M threads to the device to be tested may be the same or different, and is not limited herein.
In the embodiment, the service flow of the device to be tested in each testing period is determined by collecting the service flow actually generated by the device to be tested in a plurality of preset periods, and the determined service flow in each testing period is used for performing pressure testing on the device to be tested, so that the service flow borne by the device to be tested in a real scene can be simulated, and the performance of the device to be tested in the real scene can be accurately evaluated.
Based on the same inventive concept, fig. 3 exemplarily shows a structure of a pressure testing apparatus provided in an embodiment of the present invention, and the apparatus can perform a flow of a pressure testing method.
The device includes:
an acquisition unit 301 and a processing unit 302;
the acquisition unit 301 is configured to acquire a first service traffic actually occurring in a plurality of preset time periods by a device to be tested;
a processing unit 302, configured to determine, according to the first service flows in the multiple preset time periods, second service flows for testing in each testing time period; and starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval, and carrying out pressure test on the device to be tested.
Optionally, the processing unit 302 is specifically configured to:
performing the following operations for any two adjacent preset time periods in the plurality of preset time periods:
if the two preset time periods are continuous, determining the first service flow of each preset time period as the second service flow of each preset time period corresponding to the test time period;
and if the two preset time periods are discontinuous, determining a plurality of test time periods according to the two preset time periods, and determining a second service flow of each test time period according to the first service flows of the two preset time periods.
Optionally, the processing unit 302 is specifically configured to:
determining a trend rule of historical service flow in a time period between the two preset time periods in the historical data;
and determining the second service flow of each testing time period according to the trend rule and the first service flows of the two preset time periods.
Optionally, the trend rule is a linear change;
the processing unit 302 is specifically configured to:
determining a second traffic flow for each of the test periods according to formula (1);
the formula (1) is:
wherein, B1Is the first traffic flow of the previous one of two preset time periods, B2Is the first traffic flow of the latter one of two preset periods, A1For the preceding one of two predetermined time periods, A2For a later one of two predetermined time periods, A1+ K is the kth test period in the period between two preset periods,is A1+ K testing the second service flow in the time interval;
optionally, the second service traffic is a user concurrency number;
the processing unit 302 is specifically configured to:
starting N threads; n is determined by the maximum user concurrency number in the user concurrency numbers of all the test periods;
for any testing time period, according to the user concurrency number of the testing time period, calling M threads corresponding to the user concurrency number of the testing time period, so that each thread in the M threads continuously sends a testing task to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
Optionally, the second service traffic is number of transactions per second TPS;
the processing unit 302 is specifically configured to:
starting N threads; n is determined by the maximum TPS in the TPS of each test period;
calling M threads corresponding to TPS in the testing time period according to the TPS in the testing time period so as to enable each thread in the M threads to send a preset number of testing tasks to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
Based on the same inventive concept, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the pressure testing method according to the obtained program.
Based on the same inventive concept, the embodiment of the present invention also provides a computer-readable non-volatile storage medium, which includes computer-readable instructions, and when the computer-readable instructions are read and executed by a computer, the computer-readable instructions cause the computer to execute the above method for pressure testing.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A pressure testing method, comprising:
acquiring first service flow actually generated by a device to be tested in a plurality of preset time periods;
determining second service flow for testing in each testing time period according to the first service flow in the preset time periods;
and starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval, and carrying out pressure test on the device to be tested.
2. The method of claim 1, wherein the determining the second traffic flow for the test in each test period according to the first traffic flow in the plurality of preset periods comprises:
performing the following operations for any two adjacent preset time periods in the plurality of preset time periods:
if the two preset time periods are continuous, determining the first service flow of each preset time period as the second service flow of each preset time period corresponding to the test time period;
and if the two preset time periods are discontinuous, determining a plurality of test time periods according to the two preset time periods, and determining a second service flow of each test time period according to the first service flows of the two preset time periods.
3. The method of claim 2, wherein the determining the second traffic flow for each test period according to the first traffic flows for the two preset periods comprises:
determining a trend rule of historical service flow in a time period between the two preset time periods in the historical data;
and determining the second service flow of each testing time period according to the trend rule and the first service flows of the two preset time periods.
4. The method of claim 3, wherein the trend law is a linear change;
the second service flow of each test period is determined, and the second service flow accords with a formula (1);
the formula (1) is:
wherein, B1Is the first traffic flow of the previous one of two preset time periods, B2Is the first traffic flow of the latter one of two preset periods, A1For the preceding one of two predetermined time periods, A2For a later one of two predetermined time periods, A1+ K is the kth test period in the period between two preset periods,is A1And + K testing the second service flow in the time period.
5. The method of claim 1, wherein the second traffic flow is a user concurrency number;
the starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval to perform a pressure test on the device to be tested comprises:
starting N threads; n is determined by the maximum user concurrency number in the user concurrency numbers of all the test periods;
for any testing time period, according to the user concurrency number of the testing time period, calling M threads corresponding to the user concurrency number of the testing time period, so that each thread in the M threads continuously sends a testing task to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
6. The method of claim 1, wherein the second traffic flow is a number of transactions per second, TPS;
the starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval to perform a pressure test on the device to be tested comprises:
starting N threads; n is determined by the maximum TPS in the TPS of each test period;
calling M threads corresponding to TPS in the testing time period according to the TPS in the testing time period so as to enable each thread in the M threads to send a preset number of testing tasks to the device to be tested in the testing time period; n is a positive integer, M is a positive integer, and M is less than or equal to N.
7. An apparatus for pressure testing, comprising:
the device comprises a collecting unit and a processing unit;
the acquisition unit is used for acquiring first service flow actually generated by the device to be tested in a plurality of preset time periods;
the processing unit is used for determining second service flow used for testing in each testing time interval according to the first service flow in the preset time intervals; and starting a thread for sending a test task to the device to be tested according to the second service flow of each test time interval, and carrying out pressure test on the device to be tested.
8. The apparatus as claimed in claim 7, wherein said processing unit is specifically configured to:
performing the following operations for any two adjacent preset time periods in the plurality of preset time periods:
if the two preset time periods are continuous, determining the first service flow of each preset time period as the second service flow of each preset time period corresponding to the test time period;
and if the two preset time periods are discontinuous, determining a plurality of test time periods according to the two preset time periods, and determining a second service flow of each test time period according to the first service flows of the two preset time periods.
9. A computing device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to execute the method of any one of claims 1 to 6 in accordance with the obtained program.
10. A computer-readable non-transitory storage medium including computer-readable instructions which, when read and executed by a computer, cause the computer to perform the method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911069384.1A CN110865913B (en) | 2019-11-05 | 2019-11-05 | Pressure testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911069384.1A CN110865913B (en) | 2019-11-05 | 2019-11-05 | Pressure testing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110865913A true CN110865913A (en) | 2020-03-06 |
CN110865913B CN110865913B (en) | 2024-05-03 |
Family
ID=69654339
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911069384.1A Active CN110865913B (en) | 2019-11-05 | 2019-11-05 | Pressure testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110865913B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112968806A (en) * | 2021-01-27 | 2021-06-15 | 网易(杭州)网络有限公司 | Service scene testing method and device, storage medium and electronic equipment |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101211311A (en) * | 2006-12-25 | 2008-07-02 | 中国电信股份有限公司 | Performance prediction method for application software in manufacturing environment |
US20090083585A1 (en) * | 2007-09-21 | 2009-03-26 | Inventec Corporation | Method of pressure testing for peripheral component interconnect (pci) bus stage |
US20160191349A1 (en) * | 2014-12-30 | 2016-06-30 | Spirent Communications, Inc. | Stress testing and monitoring |
CN106067043A (en) * | 2016-06-01 | 2016-11-02 | 重庆中科云丛科技有限公司 | A kind of performance test methods and system |
CN106230651A (en) * | 2016-07-12 | 2016-12-14 | 众安在线财产保险股份有限公司 | The pressure testing system of a kind of internet system and method |
CN107220165A (en) * | 2016-03-21 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure test on a kind of artificial line |
CN107451048A (en) * | 2016-03-31 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure simulation test on a kind of line |
CN109309596A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | A kind of method for testing pressure, device and server |
CN110245089A (en) * | 2019-06-21 | 2019-09-17 | 深圳前海微众银行股份有限公司 | Method for testing pressure, device, equipment and computer readable storage medium |
-
2019
- 2019-11-05 CN CN201911069384.1A patent/CN110865913B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101211311A (en) * | 2006-12-25 | 2008-07-02 | 中国电信股份有限公司 | Performance prediction method for application software in manufacturing environment |
US20090083585A1 (en) * | 2007-09-21 | 2009-03-26 | Inventec Corporation | Method of pressure testing for peripheral component interconnect (pci) bus stage |
US20160191349A1 (en) * | 2014-12-30 | 2016-06-30 | Spirent Communications, Inc. | Stress testing and monitoring |
CN107220165A (en) * | 2016-03-21 | 2017-09-29 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure test on a kind of artificial line |
CN107451048A (en) * | 2016-03-31 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The method and apparatus of pressure simulation test on a kind of line |
CN106067043A (en) * | 2016-06-01 | 2016-11-02 | 重庆中科云丛科技有限公司 | A kind of performance test methods and system |
CN106230651A (en) * | 2016-07-12 | 2016-12-14 | 众安在线财产保险股份有限公司 | The pressure testing system of a kind of internet system and method |
CN109309596A (en) * | 2017-07-28 | 2019-02-05 | 阿里巴巴集团控股有限公司 | A kind of method for testing pressure, device and server |
CN110245089A (en) * | 2019-06-21 | 2019-09-17 | 深圳前海微众银行股份有限公司 | Method for testing pressure, device, equipment and computer readable storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112968806A (en) * | 2021-01-27 | 2021-06-15 | 网易(杭州)网络有限公司 | Service scene testing method and device, storage medium and electronic equipment |
CN112968806B (en) * | 2021-01-27 | 2022-09-02 | 杭州朗和科技有限公司 | Service scene testing method and device, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN110865913B (en) | 2024-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106383764B (en) | A kind of collecting method and equipment | |
US20210247987A1 (en) | Algorithm program loading method and related apparatus | |
CN106356077B (en) | A kind of laugh detection method and device | |
CN105094708A (en) | Method and apparatus for predicting disk capacity | |
CN108196995B (en) | Method and equipment for determining average duration of processing tasks | |
CN115576502B (en) | Data storage method and device, electronic equipment and storage medium | |
CN109240802B (en) | Request processing method and device | |
CN110991901A (en) | Task allocation method, computer storage medium and electronic device | |
CN108549592A (en) | A kind of monitoring method and monitoring device, application server of database connection pool | |
CN112104912A (en) | Method, device and equipment for detecting video watching completion degree and readable storage medium | |
CN116594757A (en) | Method and device for executing complex tasks by using large language model | |
CN105183585A (en) | Data backup method and device | |
CN107220165A (en) | The method and apparatus of pressure test on a kind of artificial line | |
CN110865913B (en) | Pressure testing method and device | |
CN105511959A (en) | Method and device for distributing virtual resource | |
CN111625358B (en) | Resource allocation method and device, electronic equipment and storage medium | |
CN107368351B (en) | Automatic upgrading and capacity expanding method and device for virtual machine configuration | |
EP2960796A1 (en) | System and method of non-intrusive measurement of memory access profiles of threads in a multi-core processor | |
CN117519973A (en) | Resource adjusting method, device and equipment | |
CN109858632B (en) | Method and device for determining threshold | |
CN115019150B (en) | Target detection fixed point model establishing method and device and readable storage medium | |
CN118037617A (en) | Workpiece detection method and edge operation equipment based on homogeneous multi-core architecture | |
CN111984624B (en) | Method and system for data migration through correction migration model | |
CN114817209A (en) | Monitoring rule processing method and device, processor and electronic equipment | |
CN108874657A (en) | The method, apparatus and computer storage medium that recognition of face host is tested |
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 |