A method for expanding the capacity of a pressure generator during pressure testing
By real-time detection of the system resource indicators of the press and dynamically increasing the number of presses, the problem of the performance bottleneck of the press during the press measurement process is solved, the continuity and efficiency of the press measurement are achieved, and the collaboration cost and data loss are reduced.
Patent Information
- Application Number
- CN202210066255.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-01-20
AI Technical Summary
During the pressure measurement process, the generator is prone to reach performance bottlenecks, resulting in the pressure measurement needs to be stopped and restarted, which increases the number of pressure measurements, the reduction in data collection efficiency, the increase in collaboration costs and the loss of one-time test data.
By detecting the system resource indicators of the press in real time during the pressure measurement process, an alarm is issued and the number of presses is increased when the bottleneck threshold is reached, the unit concurrency number of each press is reconfigured, and the self-pressure measurement task is updated to avoid stopping the pressure measurement.
The dynamic capacity expansion press is achieved during the pressure measurement process, which avoids pressure measurement interruption, reduces the misjudgment rate, keeps the total concurrency number and pressure measurement end time unchanged, and reduces the collaboration cost and the loss of one-time data.
Smart Images

Figure CN114416509B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pressure testing, and in particular to a method for expanding the capacity of a pressure generator during pressure testing. Background Art
[0002] Software applications need to undergo performance testing before they can be officially put online. Performance testing is to test applications by simulating a large number of user access requests through a stress tester. However, stress testers can also carry resource performance bottlenecks, such as excessive CPU usage or insufficient memory availability. If a stress tester reaches a performance bottleneck, it is necessary to stop the stress test and add a certain number of stress testers to continue the stress test next time.
[0003] However, stopping the stress test during the stress test will cause the following problems:
[0004] 1. The number of stress tests increased, and the stress test data needed to be collected again before each stress test, resulting in a decrease in stress test efficiency;
[0005] 2. Online promotion stress testing is often performed by multiple departments at the same time. When businesses in different channels are performing stress testing at the same time, if the stress testing of one business has to be stopped due to a bottleneck in the stress generator, the total stress output of this stress testing task will not meet expectations.
[0006] 3. Performing stress testing throughout the entire production environment also involves collaboration between multiple departments. To restart stress testing, the R&D of other applications must first clear data, which increases collaboration costs.
[0007] 4. In many transaction-related stress tests, one-time data such as order numbers are often used. If the stress test is interrupted, all the data prepared before the test will be discarded. Some one-time test data is difficult to prepare. Stopping the stress test will lead to an increase in initial costs or even the failure of the stress test task. Summary of the invention
[0008] In order to solve the technical problem of expanding the capacity of a generator and compressor, the present application provides a method for expanding the capacity of a generator and compressor during a stress test.
[0009] A method for expanding the capacity of a pressure generator during a pressure test process, comprising:
[0010] During the stress test, the generator performs the stress test task according to the first stress test script. When the alarm condition is triggered, an alarm is issued. The number of generators is increased according to the alarm. The number of increased generators and the number of original generators form the total number of generators.
[0011] A second stress testing script is obtained, and the unit concurrency of each transmitter is reconfigured according to the first stress testing script, the second stress testing script, and the total number of transmitters. Each transmitter updates its own stress testing task according to the unit concurrency and performs stress testing.
[0012] Furthermore, the first stress testing script includes a first concurrency number and a first stress testing duration, and the second stress testing script includes a second concurrency number and a second stress testing duration, the second concurrency number is zero, and the second stress testing duration is the difference between the first stress testing duration and the executed stress testing duration.
[0013] Furthermore, increasing the number of compressors according to the alarm also includes: when the test data is a one-time test data, re-uploading new one-time test data.
[0014] Furthermore, each stress test machine updates its own stress test task according to the unit concurrency number, and further includes: splitting the new one-time test data according to the total number of stress test machines.
[0015] Furthermore, when an alarm condition is triggered, an alarm is issued, specifically including: interval detection of the system resource indicator value of the generator and compressor, when it is detected that the system resource indicator value of the generator and compressor reaches the bottleneck threshold, querying the historical data within the most recent preset time, and calculating whether the average value of the historical data reaches the bottleneck threshold, and if so, issuing an alarm.
[0016] Furthermore, the system resource indicators include CPU usage and memory usage.
[0017] Furthermore, the alarm includes alarm content, and the alarm content includes the IP address of the pressure transmitter, the system resource indicator value of the pressure transmitter when the alarm condition is triggered, and the stress test task ID.
[0018] Furthermore, it also includes: if each stress test machine fails to update its own stress testing task according to the unit concurrency number, re-triggering the update in the stress test machine management list.
[0019] The present invention also discloses a system for expanding the capacity of a compressor, comprising:
[0020] The stress test management end is used to set alarm conditions and formulate the first stress test script, and re-formulate the second stress test script after receiving the alarm;
[0021] The stress test execution end is used to execute the stress test task according to the first stress test script and issue an abnormal alarm according to the alarm condition, and update its own stress test task according to the second stress test script;
[0022] The gateway server is used to cache information and forward information between the stress test management end and the stress test execution end.
[0023] The beneficial effects of the present invention are:
[0024] This method uses alarm conditions to determine in real time whether the generator during execution is overloaded. If it is overloaded, the generator is dynamically expanded. Multiple detections and the use of averages to make judgments can reduce the false positive rate. During the expansion process, the total number of concurrent users and the end time of the stress test remain unchanged, and the number of generators is increased while the generator test task is not affected, so that the total test task can be carried out smoothly. The present invention can expand the generator during the stress test process without stopping the stress test, avoiding the loss of one-time data in certain tasks caused by the interruption of the stress test, and also reducing the collaboration cost of performing the stress test task again after stopping the stress test. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a schematic diagram of the process flow of this application method;
[0027] Figure 2 It is a schematic diagram of the system structure of this application. DETAILED DESCRIPTION
[0028] In order to make the purpose, features, and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the embodiments described below are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0029] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. Example 1
[0030] This embodiment provides a method for expanding the capacity of a pressure generator during a pressure test. Figure 1 As shown, the following steps are included:
[0031] During the stress test, the generator executes the stress test task according to the first stress test script. When the alarm condition is triggered, an alarm is issued. The number of generators is increased according to the alarm. The increased number of generators and the original number of generators form the total number of generators.
[0032] The alarm includes alarm content, which includes the IP address of the transmitter, the system resource indicator value of the transmitter when the alarm condition is triggered, and the stress test task ID.
[0033] When the alarm condition is triggered, an alarm is issued for caching information and forwarding information between the stress test management end and the generator execution end, specifically including: interval detection of the system resource index value of the generator, when it is detected that the system resource index value of the generator reaches the bottleneck threshold, query the historical data within the most recent preset time, and calculate whether the average value of the historical data reaches the bottleneck threshold, if so, issue an alarm. For example, collect and detect the system resource index value of the generator every second, and compare it with the bottleneck threshold. When the system resource index value is greater than the bottleneck threshold, query the historical system resource index value data within the last 10 seconds, calculate the average value of these historical data, and trigger an alarm if the average value exceeds the bottleneck threshold.
[0034] The system resource indicators include CPU usage and memory usage. Reaching the bottleneck threshold means that the CPU usage reaches 90% and the memory usage reaches 80%.
[0035] It should be noted here that when the system resource indicator value of the compressor is detected to reach the bottleneck threshold for the first time, an alarm is not issued directly, because this may be just an accidental peak. When the system resource indicator value is detected to reach the bottleneck threshold multiple times, the average value of the historical data will also reach the bottleneck threshold. At this time, an alarm is issued, which reduces the false positive rate and the workload of frequently processing alarm reports.
[0036] Increase the number of compressors according to the alarm, specifically:
[0037] After the alarm content is reported, the alarm information is displayed on the stress test execution page according to the stress test task ID in the alarm content. The stress test task executor or the stress test management end determines the number of stress test machines to be added according to the set rules for adding stress test machines and the CPU usage and memory usage in the alarm content, and adds them.
[0038] When executing the above alarm conditions, it is necessary to pay attention to the fact that the compressor process does not trigger fullgc. When fullgc is triggered, it means that the memory of the compressor process itself has been exhausted. At this time, it needs to be reported as soon as possible without measuring the average value.
[0039] After increasing the number of transmitters, rewrite the stress testing script to obtain a second stress testing script. Reconfigure the unit concurrency of each transmitter according to the first stress testing script, the second stress testing script, and the total number of transmitters. Each transmitter updates its own stress testing task according to the unit concurrency and performs stress testing.
[0040] The first stress testing script includes a first concurrency number and a first stress testing duration, and the second stress testing script includes a second concurrency number and a second stress testing duration, the second concurrency number is zero, and the second stress testing duration is the difference between the first stress testing duration and the executed stress testing duration.
[0041] When adding a new generator, you need to lock the generator to prevent it from being occupied by other stress testing tasks.
[0042] After adding a new generator, the stress test duration is reset to ensure that the stop time of the new generator is consistent with that of the original generator; the second concurrency in the second stress test script is set to zero. When it is added to the first concurrency, the original total concurrency is still maintained. Then, the unit concurrency of each generator is reconfigured according to the total concurrency and the total number of generators. Each generator updates its own stress test task and performs stress testing by adding or stopping the concurrency to the new unit concurrency.
[0043] After the stress test task is updated, the generator reports the update result. If each generator fails to update its own stress test task according to the unit concurrency number, the update is triggered again in the generator management list of the stress test management end. Example 2
[0044] This embodiment provides a method for expanding the capacity of a pressure generator during a stress test. The data tested by the pressure generator in the method is one-time test data. The method for expanding the capacity of the pressure generator includes the following steps:
[0045] During the stress test, the generator executes the stress test task according to the first stress test script. When the alarm condition is triggered, an alarm is issued. The number of generators is increased according to the alarm. The increased number of generators and the original number of generators form the total number of generators.
[0046] The alarm includes alarm content, which includes the IP address of the transmitter, the system resource indicator value of the transmitter when the alarm condition is triggered, and the stress test task ID.
[0047] When the alarm condition is triggered, an alarm is issued, specifically including: interval detection of the system resource index value of the compressor, when it is detected that the system resource index value of the compressor reaches the bottleneck threshold, query the historical data within the recent preset time, and calculate whether the average value of the historical data reaches the bottleneck threshold, if so, an alarm is issued. For example, the system resource index value of the compressor is collected and detected every second, and compared with the bottleneck threshold. When the system resource index value is greater than the bottleneck threshold, the historical system resource index value data within the last 10 seconds is queried, and the average value of these historical data is calculated. If the average value exceeds the bottleneck threshold, an alarm is triggered.
[0048] The system resource indicators include CPU usage and memory usage. Reaching the bottleneck threshold means that the CPU usage reaches 90% and the memory usage reaches 80%.
[0049] It should be noted here that when the system resource indicator value of the compressor is detected to reach the bottleneck threshold for the first time, an alarm is not issued directly, because this may be just an accidental peak. When the system resource indicator value is detected to reach the bottleneck threshold multiple times, the average value of the historical data will also reach the bottleneck threshold. At this time, an alarm is issued, which reduces the false positive rate and the workload of frequently processing alarm reports.
[0050] Increase the number of compressors according to the alarm, specifically:
[0051] After the alarm content is reported, the alarm information is displayed on the stress test execution page according to the stress test task ID in the alarm content. The stress test task executor or the stress test management end determines the number of stress test machines to be added according to the set rules for adding stress test machines and the CPU usage and memory usage in the alarm content, and adds them.
[0052] Because in this embodiment, the test data of the press machine pressure test task is one-time test data, it is necessary to re-upload new one-time test data. The one-time test data may refer to non-repeated data such as order numbers.
[0053] When executing the above alarm conditions, it is necessary to pay attention to the fact that the compressor process does not trigger fullgc. When fullgc is triggered, it means that the memory of the compressor process itself has been exhausted. At this time, it needs to be reported as soon as possible without measuring the average value.
[0054] After increasing the number of transmitters, rewrite the stress testing script to obtain a second stress testing script. Reconfigure the unit concurrency of each transmitter according to the first stress testing script, the second stress testing script, and the total number of transmitters. Each transmitter updates its own stress testing task according to the unit concurrency and performs stress testing.
[0055] The first stress testing script includes a first concurrency number and a first stress testing duration, and the second stress testing script includes a second concurrency number and a second stress testing duration, the second concurrency number is zero, and the second stress testing duration is the difference between the first stress testing duration and the executed stress testing duration.
[0056] When adding a new generator, you need to lock the generator to prevent it from being occupied by other stress testing tasks.
[0057] After adding a new generator, the stress test duration is reset to ensure that the stop time of the new generator is consistent with that of the original generator; the second concurrency in the second stress test script is set to zero. When added to the first concurrency, the original total concurrency is still maintained. Then, the unit concurrency of each generator is reconfigured according to the total concurrency and the total number of generators. Each generator updates its own stress test task and performs stress testing by adding or stopping the concurrency to the new unit concurrency.
[0058] At this time, it is also necessary to note that the new one-time test data is split according to the total number of generators and compressors, and the one-time test data is split into multiple data files and sent to each generator and compressor.
[0059] After the stress test task is updated, the generator reports the update result. If each generator fails to update its own stress test task according to the unit concurrency number, the update is triggered again in the generator management list of the stress test management end. Example 3
[0060] This embodiment provides a system for expanding the capacity of a generator and compressor, such as Figure 2 As shown, including:
[0061] The stress test management end is used to set alarm conditions and formulate the first stress test script, and re-formulate the second stress test script after receiving the alarm;
[0062] The stress test execution end is used to execute the stress test task according to the first stress test script and issue an abnormal alarm according to the alarm condition, and update its own stress test task according to the second stress test script;
[0063] The gateway server is used to cache information and forward information between the stress test management end and the stress test execution end.
[0064] The stress test management end sets alarm conditions and formulates stress test scripts, and sends stress test commands to the stress test execution end through the gateway service. The stress test commands include alarm conditions and stress test scripts.
[0065] When executing the stress testing task, the execution end of the stress tester starts the monitoring task according to the alarm condition. When an alarm event occurs, the alarm content is sent to the stress testing management end through the gateway server. The stress testing management end parses the alarm content, displays the alarm content, and rewrites the stress testing script to obtain the second stress testing script, which includes the stress testing duration and concurrency number.
[0066] The stress test management end sends the second stress test script to the transmitter execution end through the gateway server. The transmitter execution end receives and downloads the second stress test script, which includes the recalculated unit concurrency and the recalculated stress test time. If there is new test data, new test data needs to be downloaded. The transmitter execution end updates its own unit concurrency through the second stress test script, and uploads the update result to the stress test management end through the gateway server. If the update fails, the update task can be retriggered in the transmitter list of the stress test management end. Example
[0067] This embodiment provides a computer storage medium storing a computer program, which is used to implement the method for expanding the capacity of the generator and compressor in Embodiment 1 or Embodiment 2 when executed.
[0068] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative.
[0069] Each functional terminal in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional unit.
[0070] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU), the above-mentioned functions defined in the method of the present application are executed. It should be noted that the above-mentioned computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of an electrical, magnetic, optical, electromagnetic, infrared segment, or semiconductor, or any combination of the above.
[0071] More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductor segments, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk-read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0072] In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless segments, wire segments, optical cables, RF, etc., or any suitable combination of the above.
[0073] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
Claims
1. A method for expanding the capacity of a pressure transmitter during pressure testing. It is characterized in that The following steps are involved: During the stress test, the generator performs the stress test task according to the first stress test script. When the alarm condition is triggered, an alarm is issued. The number of generators is increased according to the alarm. The number of increased generators and the number of original generators form the total number of generators. Obtain a second stress testing script, reconfigure the unit concurrency of each transmitter according to the first stress testing script, the second stress testing script, and the total number of transmitters, and each transmitter updates its own stress testing task according to the unit concurrency and performs stress testing; When an alarm condition is triggered, an alarm is issued, specifically including: interval detection of the system resource index value of the compressor, when it is detected that the system resource index value of the compressor reaches the bottleneck threshold, querying the historical data within the most recent preset time, and calculating whether the average value of the historical data reaches the bottleneck threshold, if so, issuing an alarm; Increase the number of stress test machines according to the alarm. Specifically, after the alarm content is reported, the alarm information is displayed on the stress test execution page according to the stress test task ID in the alarm content. The stress test task executor or the stress test management end determines the number of stress test machines to be added according to the set rules for adding stress test machines and the CPU usage and memory usage in the alarm content, and increases the number of stress test machines. After receiving the alarm, the second stress testing script is re-formulated, and the own stress testing task is updated according to the second stress testing script; the gateway server is used to cache information and forward information between the stress testing management end and the stress transmitter execution end.
2. The method for expanding the capacity of a pressure generator during pressure testing according to claim 1, It is characterized in that The first stress testing script includes a first concurrency number and a first stress testing duration, and the second stress testing script includes a second concurrency number and a second stress testing duration, the second concurrency number is zero, and the second stress testing duration is the difference between the first stress testing duration and the executed stress testing duration.
3. The method for expanding the capacity of a pressure generator during pressure testing according to claim 1, It is characterized in that Increasing the number of compressors according to the alarm also includes: when the test data is a one-time test data, re-uploading new one-time test data.
4. The method for expanding the capacity of a pressure generator during pressure testing according to claim 3, It is characterized in that Each stress tester updates its own stress test task according to the unit concurrency number, and the following tasks are also included: The new one-time test data is split according to the total number of compressors.
5. The method for expanding the capacity of a pressure generator during pressure testing according to claim 4, It is characterized in that The system resource indicators include CPU usage and memory usage.
6. The method for expanding the capacity of a pressure generator during pressure testing according to claim 1, It is characterized in that The alarm includes alarm content, which includes the IP address of the pressure transmitter, the system resource indicator value of the pressure transmitter when the alarm condition is triggered, and the stress test task ID.
7. The method for expanding the capacity of a pressure generator during pressure testing according to claim 1, It is characterized in that Also includes: If each stress test machine fails to update its own stress test task according to the unit concurrency number, the update is re-triggered in the stress test machine management list.
8. A capacity expansion compressor system using the method of claim 1, It is characterized in that include: The stress test management end is used to set alarm conditions and formulate the first stress test script, and re-formulate the second stress test script after receiving the alarm; The stress test execution end is used to execute the stress test task according to the first stress test script and issue an abnormal alarm according to the alarm condition, and update its own stress test task according to the second stress test script; The gateway server is used to cache information and forward information between the stress test management end and the stress test execution end.
9. A computer storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Performance test method, device and system and storage medium
CN109684228A
Performance test management platform
CN112148616A