A stress testing method and device based on Jmeter threads
By using multiple threads and cache databases in the Jmeter tool, simulating the communication between complex direct-connected devices and servers, the problem that a single thread in the prior art cannot simulate communication between sub-device and servers is solved, and the feasibility of complex business performance testing is realized.
Patent Information
- Application Number
- CN202110815693.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-19
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-07-19
AI Technical Summary
In the existing Jmeter tools, a single thread can only handle one fixed-classified device and cannot simulate sub-device communication with the server, resulting in greater limitations.
Through multiple Jmeter threads, the attribute information of each direct-connected device and the operation information of the sub-device are determined, and the server is transmitted for statistical processing. The identification and operation information of the sub-device are stored by the cache database, and the number of sub-device is updated cycle until the total number is reached.
It simulates the communication between complex direct-connected devices and server-side, breaks through the limitations of the classification of a type of equipment by a single thread, and ensures the feasibility of complex business performance testing, especially in the Internet of Things industry.
Smart Images

Figure CN113419966B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pressure testing, and in particular, to a pressure testing method and device based on Jmeter threads. Background Art
[0002] Software pressure testing is a part of software testing work. Its basic idea is to continuously apply pressure to the system to obtain the maximum service level that the system can provide by determining a bottleneck or unacceptable performance point of the system. Currently, open-source pressure testing tools such as Jmeter are usually used. For example, by installing the mqtt-jmeter plugin of Jmeter and opening the number of threads to simulate user load to complete the performance testing work.
[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems: A single thread in Jmeter can only process a fixed category of devices, that is, it can only simulate a type of directly connected device to communicate with the server. Since the device classification of the sub-devices is usually different from that of the directly connected devices they are associated with, it is impossible to simulate the communication between the sub-devices they mount and the server, and the limitations are relatively large. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a pressure testing method and device based on Jmeter threads, which can at least solve the problem that the threads of existing Jmeter cannot simulate the communication between sub-devices and the server.
[0005] To achieve the above object, according to one aspect of the embodiments of the present invention, a pressure testing method based on Jmeter threads is provided, including:
[0006] Determine the directly connected devices to be simulated by each Jmeter thread, and obtain the attribute information of each directly connected device and the running information of the sub-devices mounted under each directly connected device;
[0007] Through multiple Jmeter threads, transmit the running information of each directly connected device and the running information of each sub-device to the server for statistical processing;
[0008] Repeat multiple rounds of loops to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
[0009] Optionally, the device classifications of the directly connected devices and the sub-devices are different;
[0010] Before determining the directly connected devices to be simulated by each Jmeter thread, it further includes:
[0011] Store the identifiers and running information of each directly connected device into a parameter file; and
[0012] Store the identifiers and running information of each sub-device mounted under each directly connected device in the cache database.
[0013] Optionally, the cache database also stores the total number of sub-devices mounted under each directly connected device;
[0014] The method includes:
[0015] For any Jmeter thread, obtain the total number of sub-devices mounted under the directly connected device from the cache database, and set the number of sub-devices for which the running information has been transmitted currently to the initial value;
[0016] After starting to transmit the running information of the sub-devices mounted under the directly connected device in this round, update the number of sub-devices cyclically until the total number of sub-devices is reached.
[0017] Optionally, it further includes:
[0018] Use a preset string to separate the identifiers of each sub-device mounted under the directly connected device to generate a sub-device identifier sequence;
[0019] Number the identifiers of each sub-device in the sub-device identifier sequence, and then transmit the running information of each sub-device to the server one by one according to the numbers.
[0020] Optionally, the cache database also caches the connection relationship between the directly connected device and the server;
[0021] The method further includes:
[0022] Judge whether there is a connection relationship between each directly connected device and the server. If not, establish a connection relationship and store it in the cache database.
[0023] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a stress testing device based on Jmeter threads, including:
[0024] An acquisition module, configured to determine the directly connected devices to be simulated by each Jmeter thread, and acquire the attribute information of each directly connected device and the running information of the sub-devices mounted under each directly connected device;
[0025] A transmission module, configured to transmit the running information of each directly connected device and the running information of each sub-device to the server for statistical processing through multiple Jmeter threads;
[0026] A loop module, configured to repeat multiple rounds of loops to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
[0027] Optionally, the device classifications to which the direct-connected device and the sub-device belong are different;
[0028] It further includes a storage module, which is used for:
[0029] Storing the identifier and operation information of each direct-connected device into a parameter file; and
[0030] Storing the identifier and operation information of each sub-device mounted under each direct-connected device into a cache database.
[0031] Optionally, the cache database also stores the total number of sub-devices mounted under each direct-connected device;
[0032] The transmission module is used for:
[0033] For any Jmeter thread, obtaining the total number of sub-devices mounted under the direct-connected device from the cache database, and setting the number of sub-devices for which the operation information has been transmitted currently to an initial value;
[0034] After starting to transmit the operation information of the sub-devices mounted under the direct-connected device in this round, cyclically update the number of sub-devices until the total number of sub-devices is reached.
[0035] Optionally, the transmission module is further used for:
[0036] Using a preset string to separate the identifiers of each sub-device mounted under the direct-connected device to generate a sub-device identifier sequence;
[0037] Numbering the identifiers of each sub-device in the sub-device identifier sequence, and then transmitting the operation information of each sub-device to the server one by one according to the numbers.
[0038] Optionally, the cache database also caches the connection relationship between the direct-connected device and the server;
[0039] The device further includes a connection module, which is used for:
[0040] Judging whether there is a connection relationship between each direct-connected device and the server. If not, establishing a connection relationship and storing it in the cache database.
[0041] To achieve the above object, according to another aspect of the embodiments of the present invention, a stress testing electronic device based on Jmeter threads is provided.
[0042] The electronic device according to the embodiments of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the stress testing method based on Jmeter threads described in any one of the above.
[0043] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, it implements any one of the above-described stress testing methods based on Jmeter threads.
[0044] According to the solution provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: improving and breaking through the original jmeter-mqtt plug-in, upgrading the simulation of a single thread as an ordinary device to the simulation of complex direct-connected devices, ensuring the feasibility of complex business performance testing, such as in the Internet of Things industry, which plays a promoting role in the development of the Internet of Things industry.
[0045] The further effects of the above non-conventional optional methods will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:
[0047] Figure 1 is a schematic diagram of the main process of a stress testing method based on Jmeter threads according to an embodiment of the present invention;
[0048] Figure 2 is a schematic diagram of the process of an optional stress testing method based on Jmeter threads according to an embodiment of the present invention;
[0049] Figure 3 is a schematic diagram of the main modules of a stress testing device based on Jmeter threads according to an embodiment of the present invention;
[0050] Figure 4 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0051] Figure 5 is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description below omits the description of well-known functions and structures.
[0053] For the terms involved in this solution, the following explanations are made:
[0054] Direct-connected device: A device that provides an entry point to the core network of an enterprise or service provider.
[0055] Direct-connected device for simple services: It directly connects and communicates with the server without passing through any direct-connected device, and only reports the operating information of the device itself.
[0056] Direct-connected device for complex services: Refers to edge proxy devices, gateway devices, etc. That is, in addition to reporting the operating information of the device itself, a device also needs to report the relevant information of its sub-devices after integration.
[0057] The data format of the direct-connected device for complex services is relatively complex. Even one device can correspond to one message body, and the message body is relatively large (500 Bytes), resulting in the inability of the existing jmeter solution to simulate the communication between the direct-connected device for complex services and the server. The detailed reasons are as follows:
[0058] 1. There are various types of devices. A system approximately manages hundreds of device classifications, and each classification corresponds to a physical model. Among them, the physical model is a digital description of the product, which defines the functions of the product. The physical model abstracts and summarizes the functions of products of different brands and categories to form a "standard physical model" to facilitate all parties to describe, control, and understand the product functions in a unified language.
[0059] 2. Each direct-connected device manages multiple sub-devices, and the device classifications of these sub-devices are usually different from those of the direct-connected device. The sub-devices can also report messages, such as the fields corresponding to the physical model.
[0060] See Figure 1 , which shows the main flowchart of a stress testing method based on Jmeter threads provided by an embodiment of the present invention, including the following steps:
[0061] S101: Determine the direct-connected device to be simulated by each Jmeter thread, and obtain the attribute information of each direct-connected device and the operating information of the sub-devices mounted under each direct-connected device;
[0062] S102: Through multiple Jmeter threads, transmit the operating information of each direct-connected device and the operating information of each sub-device to the server for statistical processing;
[0063] S103: Repeat multiple rounds of loops to determine the maximum number of direct-connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of operating information that the server can statistically process.
[0064] In the above embodiments, for step S101, in the actual business scenario, the number of directly connected devices for complex services is relatively large. Therefore, in this solution, multiple JMeter threads are used to simulate multiple directly connected devices for complex services, and one JMeter thread simulates one directly connected device for a complex service to perform communication stress testing with the server.
[0065] It should be noted that since a directly connected device may mount multiple sub-devices, and the services that each sub-device may handle are different, the service is relatively complex, and it is called a directly connected device for complex services. For example, a directly connected device mounts 10 sub-devices, and its execution scenario is as follows: the directly connected device establishes a connection relationship with the server, reports the running information of the directly connected device itself, and cyclically reports the running information of these 10 sub-devices.
[0066] Considering that the directly connected device and the sub-devices belong to different device classifications, the identification - running information of the sub-devices cannot be stored in the JMeter parameter file. For this situation, this solution pre-establishes a cache database to store the identification subdeviceid and running information of each sub-device mounted under each directly connected device, such as storing it in the form of key-value in Redis. The identification and running information of each directly connected device, as in the prior art, are still stored in the JMeter parameter file.
[0067] Modify the execution logic of the JMeter thread. By establishing a cache database, the subsequent JMeter thread does not need to consider the device classification when obtaining the running information of the sub-devices. Therefore, the JMeter thread in this solution can obtain the running information of the directly connected device from the parameter file, or obtain the running information of each sub-device mounted under the directly connected device from the cache database, breaking through the limitation that the existing JMeter thread can only handle one type of device classification.
[0068] For step S102, before transmitting the running information of the directly connected device to the server, it can also be judged whether there is a connection relationship. If not, it means that this round is the first iteration. For the first iteration, the directly connected device first needs to establish a connection relationship with the server, and then report the running information of the directly connected device and the sub-devices to the server.
[0069] Since a directly connected device for a complex service usually mounts multiple sub-devices, and only the running information of one sub-device is transmitted each time, it is necessary to transmit cyclically for multiple times. Specifically:
[0070] 1) The total number of sub-devices mounted under each directly connected device is stored in the cache database. For any Jmeter thread, the total number of sub-devices mounted under the directly connected device it simulates is obtained from the cache database. Initially, the number of sub-devices for which the operation information has been transmitted is set to 0, and it is continuously updated as the number of sub-devices for which the operation information has been transmitted increases, until the total number of sub-devices is reached. For details, see Figure 2 as shown.
[0071] For example, if there are 3 sub-devices mounted under the directly connected device 1, that is, the total number of sub-devices = 3. Initially, the number of sub-devices = 0. After transmitting the operation information of each sub-device to the server, the number of sub-devices +1, until it reaches 3.
[0072] 2) As an optimization of the previous embodiment, based on the sub-device identifiers under the directly connected device, a sub-device identifier sequence list is established, and each sub-device identifier in the list is numbered, usually starting from 0 (i.e., initialized to 0), to record the number of devices for which the operation information has been transmitted to the server. Whenever the operation information of a sub-device is transmitted, the identifier of this sub-device moves to the next round of the sub-device identifier sequence list or moves to the end of the list, so as to achieve the cyclic transmission of the sub-device operation information. The sub-device identifier sequence list can also be stored in the cache database.
[0073] For step S103, each jmeter thread will continuously iterate the "single-thread simulation" process until the execution times or execution time designed for the scenario are reached, so as to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate respectively according to the number of operation information that the server can process.
[0074] The method provided by the embodiments of the present invention improves and breaks through the original jmeter-mqtt plug-in, upgrades the simulation of a single thread from an ordinary device to a complex directly connected device, ensures the feasibility of complex business performance testing, such as in the Internet of Things industry, and plays a promoting role in the development of the Internet of Things industry.
[0075] See Figure 3 , which shows a schematic diagram of the main modules of a pressure testing device 300 based on Jmeter threads provided by the embodiments of the present invention, including:
[0076] An acquisition module 301, configured to determine the directly connected devices to be simulated by each Jmeter thread, and acquire the attribute information of each directly connected device and the operation information of the sub-devices mounted under each directly connected device;
[0077] A transmission module 302, configured to transmit the operation information of each directly connected device and the operation information of each sub-device to the server for statistical processing through multiple Jmeter threads;
[0078] A loop module 303 is used to repeat multiple rounds of loops to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
[0079] In the implementation device of the present invention, the directly connected devices and the sub-devices belong to different device classifications;
[0080] The device further includes a storage module for:
[0081] Storing the identifier and running information of each directly connected device into a parameter file; and
[0082] Storing the identifier and running information of each sub-device mounted under each directly connected device into a cache database.
[0083] In the implementation device of the present invention, the cache database also stores the total number of sub-devices mounted under each directly connected device;
[0084] The transmission module 302 is used for:
[0085] For any Jmeter thread, obtaining the total number of sub-devices mounted under a directly connected device from the cache database, and setting the number of sub-devices whose running information has been transmitted currently to an initial value;
[0086] After starting to transmit the running information of the sub-devices mounted under the directly connected device in this round, continuously update the number of sub-devices until the total number of sub-devices is reached.
[0087] In the implementation device of the present invention, the transmission module 302 is further used for:
[0088] Using a preset string to separate the identifiers of each sub-device mounted under a directly connected device to generate a sub-device identifier sequence;
[0089] Numbering the identifiers of each sub-device in the sub-device identifier sequence, and then transmitting the running information of each sub-device to the server one by one according to the numbers.
[0090] In the implementation device of the present invention, the cache database also caches the connection relationship between the directly connected device and the server;
[0091] The device further includes a connection module for:
[0092] Judging whether there is a connection relationship between each directly connected device and the server. If not, establishing a connection relationship and storing it in the cache database.
[0093] In addition, the specific implementation details of the device in the embodiments of the present invention have been described in detail in the above-described method, so the repeated content will not be elaborated herein.
[0094] Figure 4 FIG. 400 shows an exemplary system architecture to which embodiments of the present invention can be applied, including terminal devices 401, 402, 403, a network 404, and a server 405 (merely an example).
[0095] The terminal devices 401, 402, 403 can be various electronic devices with a display screen and supporting web browsing, installed with various communication client applications. Users can use the terminal devices 401, 402, 403 to interact with the server 405 through the network 404 to receive or send messages, etc.
[0096] The network 404 is a medium for providing a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0097] The server 405 can be a server providing various services, used to execute usage threads, simulate the operation of obtaining the running information of direct-connected devices and sub-devices and loop transmission.
[0098] It should be noted that the method provided by the embodiments of the present invention is generally executed by the server 405. Correspondingly, the device is generally disposed in the server 405.
[0099] It should be understood that Figure 4 the numbers of terminal devices, networks, and servers in
[0100] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 5 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention. Figure 5 The terminal device shown
[0101] As Figure 5 shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage section 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0102] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0103] Specifically, according to an embodiment disclosed by the present invention, the processes described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment disclosed by the present invention includes a computer program product which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, the above-described functions defined in the system of the present invention are executed.
[0104] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, 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), an 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 above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0106] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes an acquisition module, a transmission module, and a loop module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the loop module can also be described as the "loop for pressure measurement module".
[0107] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes:
[0108] Determine the direct-connected devices to be simulated by each Jmeter thread, and obtain the attribute information of each direct-connected device and the running information of the sub-devices mounted under each direct-connected device;
[0109] Through multiple Jmeter threads, transmit the running information of each direct-connected device and the running information of each sub-device to the server for statistical processing;
[0110] Repeat multiple rounds of loops to determine the maximum number of direct-connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
[0111] According to the technical solution of the embodiments of the present invention, the original jmeter-mqtt plug-in is improved and broken through. Upgrading the simulation of an ordinary device by one thread to the simulation of a complex direct-connected device ensures the feasibility of complex business performance testing. For example, in the Internet of Things industry, it plays a promoting role in the development of the Internet of Things industry.
[0112] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A stress testing method based on Jmeter threads, characterized in that, Including: Storing the identifier and running information of each directly connected device into a parameter file; And storing the identifier and running information of each sub-device mounted under each directly connected device into a cache database; wherein, the device classifications to which the directly connected device and the sub-device belong are different; Determining the directly connected devices to be simulated by each Jmeter thread, and obtaining the attribute information of each directly connected device and the running information of the sub-devices mounted under each directly connected device; wherein, obtaining the running information of the directly connected device from the parameter file, and obtaining the running information of each sub-device mounted under the directly connected device from the cache database; Transmitting the running information of each directly connected device and the running information of each sub-device to the server for statistical processing through multiple Jmeter threads; Repeating multiple rounds of loops to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
2. The method according to claim 1, characterized in that, The cache database also stores the total number of sub-devices mounted under each directly connected device; The method includes: For any Jmeter thread, obtaining the total number of sub-devices mounted under the directly connected device from the cache database, and setting the number of sub-devices whose running information has been transmitted currently to an initial value; After starting to transmit the running information of the sub-devices mounted under the directly connected device in this round, cyclically updating the number of sub-devices until the total number of sub-devices is reached.
3. The method according to claim 2, characterized in that, It also includes: Using a preset string to separate the identifiers of each sub-device mounted under the directly connected device to generate a sub-device identifier sequence; Numbering the identifiers of each sub-device in the sub-device identifier sequence, and then transmitting the running information of each sub-device to the server one by one according to the numbers.
4. The method according to claim 1, characterized in that, The cache database also caches the connection relationship between the directly connected device and the server; The method further includes: Judging whether there is a connection relationship between each directly connected device and the server, and if not, establishing a connection relationship and storing it in the cache database.
5. A stress testing device based on Jmeter threads, characterized in that, Including: A storage module for storing the identifier and running information of each directly connected device into a parameter file; And storing the identifier and running information of each sub-device mounted under each directly connected device into a cache database; wherein, the device classifications to which the directly connected device and the sub-device belong are different; An obtaining module for determining the directly connected devices to be simulated by each Jmeter thread, and obtaining the attribute information of each directly connected device and the running information of the sub-devices mounted under each directly connected device; wherein, obtaining the running information of the directly connected device from the parameter file, and obtaining the running information of each sub-device mounted under the directly connected device from the cache database; A transmission module for transmitting the running information of each directly connected device and the running information of each sub-device to the server for statistical processing through multiple Jmeter threads; A loop module for repeating multiple rounds of loops to determine the maximum number of directly connected devices and the maximum number of sub-devices that the server can accommodate according to the maximum number of running information that the server can statistically process.
6. The device according to claim 5, characterized in that, The cache database also stores the total number of sub-devices mounted under each directly connected device; The said transmission module is used for: For any Jmeter thread, obtain the total number of sub-devices mounted under the direct-connected device from the cache database, and set the number of sub-devices that have transmitted the running information currently as the initial value; After starting to transmit the running information of the sub-devices mounted under the direct-connected device in this round, update the number of the sub-devices cyclically until the total number of the sub-devices is reached.
7. An electronic device, characterized in that, Including: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-4.
8. A computer-readable medium, on which a computer program is stored, characterized in that, When the program is executed by the processor, the method according to any one of claims 1-4 is implemented.
Citation Information
Patent Citations
Pressure testing method and device
CN112131095A
Database task processing method and apparatus, electronic device, and readable medium
WO2020238737A1