A system testing method and device
By determining the target server for stack acquisition through the server resource utilization analysis, the problems of low system performance testing efficiency and untimely fault location are solved, and rapid fault location and efficient analysis are achieved.
Patent Information
- Application Number
- CN201911244071.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-06
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2039-12-06
AI Technical Summary
The existing system performance testing efficiency is low and the system fault location is not timely.
By analyzing the operating parameters of the server, the target server with the highest resource utilization rate is determined, and stacked to collect and analyze it to generate performance test results and problem analysis results.
Improve the efficiency of performance problem analysis and realize the rapid location of system failures.
Smart Images

Figure CN111124791B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular, to a system testing method and device. Background Art
[0002] With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and performance testing technology is no exception. Due to the security and real-time requirements of the financial industry, users have higher and higher requirements for financial systems, and higher requirements are also put forward for system performance testing technology. Currently, after obtaining the performance test results by performing performance testing on the system, a third-party analysis device is mainly used to re-analyze the performance problems of the system, so there are problems of low test efficiency and untimely system fault location.
[0003] Therefore, there is an urgent need for a system testing method and device that can overcome the above problems. Summary of the Invention
[0004] Embodiments of the present invention provide a system testing method and device to solve the problems of low test efficiency of the existing system and untimely system fault location.
[0005] In a first aspect, embodiments of the present invention provide a system testing method, which includes:
[0006] Perform performance testing on at least one server where the system under test is located. Then, during the performance testing process, obtain the operating parameters of the at least one server. Further, according to the operating parameters, determine a target server from the at least one server. Further, perform stack collection on the system under test on the target server, and perform performance problem analysis according to the stack collection result to generate the performance test result and performance problem analysis result of the system under test.
[0007] In embodiments of the present invention, first start the systems corresponding to the above servers for performance testing, then determine the server with the highest resource utilization rate as the target server through the operating parameters of each server, and then perform stack collection and analysis on the corresponding system under test on the target server, which not only overcomes the problems existing in the prior art, improves the efficiency of analyzing performance problems of the system under test, but also can quickly locate the fault location of the system under test.
[0008] In a possible design, determining a target server from at least one server according to the operating parameters includes: for any server, calculate the resource utilization rate of the server according to the operating parameters of the server, and then screen out the servers whose resource utilization rates meet the preset criteria from the at least one server as the target server.
[0009] In an embodiment of the present invention, the target server is selected according to the resource utilization rate of each server, ensuring that the selected target server is the most representative server.
[0010] In a possible design, the operating parameter includes at least one of the system load, CPU utilization rate, memory utilization rate, or network utilization rate per unit time; further, according to the operating parameters of the server, the resource utilization rate of the server is calculated through a preset resource utilization rate formula, and the preset resource utilization rate formula is:
[0011] R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net_U × K4
[0012] Wherein, R_U represents the resource utilization rate of the server, L_ONE represents the system load of the server per unit time, K1 represents the weight of the system load per unit time, CPU_U represents the CPU utilization rate of the server, K2 represents the weight of the CPU utilization rate, M_U represents the memory utilization rate of the server, K3 represents the weight of the memory utilization rate, NET_U represents the network utilization rate of the server, and K4 represents the weight of the network utilization rate.
[0013] In an embodiment of the present invention, the resource utilization rates of the above-mentioned servers are calculated according to the formula respectively, and then the server with the highest resource utilization rate is used as the target server. This can ensure that a representative server is selected as the target server, so the performance test results and performance problem analysis results obtained after the performance test of the system under test on the target server are the most reliable and valuable for reference.
[0014] In a possible design, the preset metrics include: the resource utilization rate of the target server is the maximum among the resource utilization rates of all the servers where the system under test is performing the performance test, or the resource utilization rate of the target server is greater than a set threshold.
[0015] In an embodiment of the present invention, by selecting the server with the highest resource utilization rate as the target server, or selecting the server whose resource utilization rate reaches the set threshold as the target server, the purpose of screening out the most representative server is achieved. In this way, the stack collection data of the performance test of the system under test on the target server in the subsequent steps is the most representative and reliable.
[0016] In a possible design, stack collection is performed on the system under test on the target server, and performance problem analysis is performed according to the stack collection result, including: stack collection is performed on the system under test on the target server at multiple randomly selected time points. Further, the stack collection results at the multiple time points are compared and analyzed to generate a performance problem analysis result.
[0017] In the embodiments of the present invention, by selecting multiple random time points, stack collection is performed on the system under test on the target server, and then the stack collection results are compared and analyzed to generate a performance analysis result, achieving fairness and randomness in each stack data collection and making the obtained performance analysis result more reliable.
[0018] In the embodiments of the present invention, the stack analysis result includes at least one of deadlock information, thread running state statistical results, and high-frequency function call statistical results of business logic functions, where a high-frequency function is a running function whose function call count meets a set condition.
[0019] In a second aspect, the embodiments of the present invention provide a system testing device. The technical effects of this device can refer to the above method embodiments. The device includes:
[0020] A processing unit for performing performance testing on at least one server where the system under test is located;
[0021] An acquisition unit for obtaining the running parameters of the at least one server during the performance testing process;
[0022] The processing unit is further configured to determine a target server from the at least one server according to the running parameters; perform stack collection on the system under test on the target server, and perform performance problem analysis according to the stack collection results; generate a performance test result and a performance problem analysis result of the system under test.
[0023] In a possible design, according to the running parameters, the processing unit is specifically configured to: for any server, calculate the resource utilization rate of the server according to the running parameters of the server;
[0024] Screen out the servers whose resource utilization rates meet the preset criteria from the at least one server as the target servers.
[0025] In a possible design, the running parameters include at least one of the system load per unit time, CPU utilization rate, memory utilization rate, or network utilization rate;
[0026] The processing unit is further configured to: calculate the resource utilization rate of the server according to the running parameters of the server through a preset resource utilization rate formula; the preset resource utilization rate formula is:
[0027] R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net_U × K4;
[0028] Among them, R_U represents the resource utilization rate of the server, L_ONE represents the system load of the server per unit time, K1 represents the weight of the system load per unit time, CPU_U represents the CPU utilization rate of the server, K2 represents the weight of the CPU utilization rate, M_U represents the memory utilization rate of the server, K3 represents the weight of the memory utilization rate, NET_U represents the network utilization rate of the server, and K4 represents the weight of the network utilization rate.
[0029] Further, the processing unit is specifically configured to: determine a target server from the at least one server according to the resource utilization rate of the server, where the resource utilization rate of the target server meets a preset index.
[0030] In a possible design, the preset index includes: the resource utilization rate of the target server is the maximum value of the resource utilization rates of all the servers in the system under performance test, or the resource utilization rate of the target server is greater than a set threshold.
[0031] In a possible design, the processing unit is further configured to: collect stacks of the system under test on the target server at multiple randomly selected time points. Then, compare and analyze the stack collection results at these multiple time points to generate a performance problem analysis result.
[0032] In a possible design, the stack analysis result includes at least one of: deadlock information, thread running state statistical results, and high-frequency function call statistical results of business logic functions. Among them, a high-frequency function is a running function whose number of function calls meets a set condition;
[0033] In a third aspect, a computing device provided by an embodiment of the present invention includes at least one processing unit and at least one storage unit, where the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit is caused to execute the system test method as described in any of the above first aspects.
[0034] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present invention stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device is caused to execute the system test method as described in any of the above first aspects.
[0035] These aspects or other aspects of the present invention will be more clearly understood in the following description of the embodiments. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0037] Figure 1 A schematic diagram of a device architecture provided for an embodiment of the present invention;
[0038] Figure 2 A schematic flowchart of a system testing method provided for an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of a partial stack acquisition result provided for an embodiment of the present invention;
[0040] Figure 4 A schematic flowchart of a system testing method provided for an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of an architecture of a system testing provided for an embodiment of the present invention;
[0042] Figure 6 A schematic diagram of a device structure of a system testing provided for an embodiment of the present invention;
[0043] Figure 7 A schematic diagram of a computing device for a system testing provided for an embodiment of the present invention. Detailed implementation manners
[0044] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0045] Figure 1Exemplarily shown is a system architecture applicable to a system testing method provided by an embodiment of the present invention. The system architecture may include a test device 101 and a device under test 102. When the device under test 102 undergoes system updates or software and hardware improvements, etc., the test device 101 needs to perform system testing on the device under test 102. Specifically, the test device 101 sends a test task to the device under test 102, the device under test 102 receives the test task and processes the test task, and the test device 101 generates a performance test result of the device under test 102 based on parameters such as the response time, maximum user concurrency, and maximum TPS of the device under test 102 processing the test task. Among them, the user concurrency refers to the number of user requests / transactions processed by the system simultaneously, and TPS refers to the number of transaction requests processed by the system per second.
[0046] Based on the above description, Figure 2 Exemplarily shown is a flow of a system testing method provided by an embodiment of the present invention. This method can be executed by the test device 101, and the test device 101 can be set in at least one server where the system is located. As Figure 2 shown, the method specifically includes the following steps.
[0047] Step 201, perform performance testing on at least one server where the system under test is located.
[0048] In a possible embodiment, a manager triggers and starts performance testing on the system under test by operating the test device 101 on the server where the system is located.
[0049] Exemplarily, as Figure 5 shown, a clearing system can be set on multiple servers (such as Figure 5 Server 1, Server 2, and Server 3 in), and it is default that the clearing systems running on each server are the same, that is, Server 1, Server 2, and Server 3 run the same clearing system. A manager can operate the test device 101 on the management platform to send a test instruction to Server 1, Server 2, and Server 3, and this test instruction is used to indicate starting performance testing on the clearing system. Among them, the management platform can be set on Server 1, Server 2, or Server 3.
[0050] Step 202, during the performance testing process, obtain the running parameters of at least one server.
[0051] Among them, the running parameters may include at least one of the system load per unit time, CPU usage rate, memory usage rate, or network usage rate.
[0052] Specifically, in a possible implementation, to ensure the accuracy of the collected data, one minute after the start of the performance test, a list of servers where the system under test is located can be obtained, and then based on this list of servers, the operating parameters of each server within the current minute can be calculated, such as the system load per unit time, CPU usage rate, memory usage rate, or network usage rate.
[0053] Step 203: Determine the target server from at least one server according to the operating parameters.
[0054] Specifically, for any server, after the test device 101 obtains the operating parameters, it can calculate the resource usage rate of the server according to the operating parameters. Further, the servers whose resource usage rates meet the preset criteria are screened out from all the servers as the target servers. Optionally, the server with the highest resource usage rate is selected as the target server from at least one server, or the servers with resource usage rates greater than the set threshold are selected as the target servers. Among them, the number of target servers can be one or more, and the embodiments of the present application do not limit this.
[0055] Calculate the resource usage rate of the server through a preset resource usage rate formula; the preset resource usage rate formula is:
[0056] In a possible implementation, for the first server, where the first server is any one of at least one server, calculate the resource usage rate of the first server according to the operating parameters of the first server, and the resource usage rate satisfies the preset resource usage rate formula;
[0057] R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net-U × K4;
[0058] Among them, R_U represents the resource usage rate of the first server, L_ONE represents the system load of the first server per unit time, K1 represents the weight of the system load per unit time, CPU_U represents the CPU usage rate of the first server, K2 represents the weight of the CPU usage rate, M_U represents the memory usage rate of the first server, K3 represents the weight of the memory usage rate, NET_U represents the network usage rate of the first server, and K4 represents the weight of the network usage rate. Among them, the specific values of the weights can be set according to actual needs.
[0059] Step 204: Perform stack collection on the system under test on the target server and analyze the performance problems according to the stack collection results.
[0060] Specifically, in a possible implementation, stack collection can be performed on the system under test on the target server at multiple randomly selected time points; then the stack collection results at the multiple time points are compared and analyzed to generate performance problem analysis results. For example, after the target server is determined, a script can be used to perform Java stack collection on the system under test on the target server, wherein the stack collection command mainly uses the jstack command provided by JDK to perform process stack collection.
[0061] Step 205: Generate performance test results and performance problem analysis results of the system under test.
[0062] Specifically, the stack analysis results may include at least one of: deadlock information, thread running status statistics, and high-frequency function call statistics of business logic functions. Among them, high-frequency functions are running functions whose function call times meet set conditions. Furthermore, when the stack analysis results are obtained, the performance test results can also be obtained, and then the stack analysis results are saved in the database. When the administrator triggers the performance test result display, the stack analysis results can be displayed together with the performance test results to guide testers to find application performance problems.
[0063] In a possible implementation, in step 204, for example, a script is run to collect Java stacks for the system under test on the target server. The collection command in the script mainly uses the jstack command provided by JDK (Java Development Kit, a software development kit for Java language) to collect stacks. Optionally, the collection logic of the script is as follows:
[0064] 1: Use the command ssh$ip "ps–ef|grep$name|grep-v grep|awk'{print$2}'" to log in to the target server and obtain the process ID through the service name; IP is the target server IP, and name is the target service name;
[0065] 2: Use the command ssh ip "ps–ef|grep$name|grep-v grep|awk'{print$8}'" to log in to the target server and start the java directory through the tested system;
[0066] 3: Use the command ssh ip "$home / bin / jstack–l$pid> / data / pid_1.stack" to obtain the stack of the system under test; Home is the java directory obtained in step 2, and pid is the process IP obtained in step 1;
[0067] 4: Use the command "scp ip: / data / pid_1.stack / data / " to copy the stack of the system under test obtained to the local, and then analyze it.
[0068] The stack collection of the system under test is implemented by the above script.
[0069] In a possible embodiment, in order to more truly reflect the running situation of the system under test during the performance test, a random and discrete method is adopted to randomly obtain at least one time point at the second set time after calculating the target server, and data collection is performed. Exemplarily, a random and discrete method is adopted to select 3 time points within 3 minutes after the start of the performance test;
[0070] Exemplarily, the calculation method of the three discrete collection time points is as follows:
[0071] The first collection time point: Use a random function to calculate a random number between 20 and 40 as the first collection time point. When the time arrives, use the above collection method to collect the stack; for example, if the random calculation results in "30", then when 30 seconds have passed after calculating the target server, collect the stack of the system under test where the target server is located.
[0072] The second collection time point: Use a random function to calculate a random number between 80 and 100 as the second collection time point; for example, if the random calculation results in "89", then when 89 seconds have passed after calculating the target server, collect the stack of the system under test.
[0073] The third collection time point: Use a random function to calculate a random number between 140 and 160 as the third collection time point; for example, if the random calculation results in "155", then when 155 seconds have passed after calculating the target server, collect the stack of the system under test.
[0074] In a possible implementation manner, for step 205 above, after the stack collection, save the stack collection result, and at the same time perform comparative analysis to generate a stack analysis result, obtain the performance test result and the performance problem analysis result, and then save them in the database corresponding to the management platform. Among them, the stack collection result includes at least one of the following contents:
[0075] 1. Thread name, thread ID and quantity;
[0076] 2. Thread running status, lock status;
[0077] 3. Thread function call stack;
[0078] In a possible embodiment, analyze and compare the stack collection result, and mainly extract the following information:
[0079] 1. Deadlock information: Check whether there is the keyword "deadlock" in the search stack information; if so, it indicates that there is a thread deadlock situation, and store the relevant deadlock status and thread information in the database.
[0080] 2. Thread running status information: Analyze the running status of each thread according to the stack collection result, and count the status of the thread, such as WAITING (waiting), RUNNABLE (ready), etc.; Exemplarily, count the threads in the RUNNABLE state. If the count of this state in all stack collection results is relatively small, it is judged that the thread configuration is unreasonable or there is a hint of thread competition, and store the thread status, the statistical count, and the judgment result in the database.
[0081] 3. High-frequency function call statistics of business logic functions: Obtain the thread stack with the thread status of Running (running), parse the function information in each stack, and save the function name, function call count, etc. as records.
[0082] For functions with the same function name in multiple threads, the function call count gradually increases. In this way, the call count of each function in the thread stack is obtained. Further, sort these function statistics. Among them, the running functions whose function call count meets the set conditions are high-frequency functions. These high-frequency functions may have performance problems. After storing the above information in the corresponding database of the management platform, analyze it. Exemplarily, the functions with the function call count of TOP10 meet the set conditions. In other words, the functions with the top 10 function call counts are high-frequency functions. It should be noted that in practical applications, the extracted information is not limited to the above three.
[0083] In a possible embodiment, the performance test is performed on the system under test, and partial stack collection results are obtained after stack collection according to the above method. As Figure 3 shown, the stack collection results include Figure 3 the two threads shown. Specifically, the above two threads are both in the WAITING (waiting) state and have no "deadlock" keyword, that is, neither of the two threads has a deadlock situation.
[0084] To describe the above system test method more systematically, the embodiment of the present invention also schematically provides a system test method flow, as Figure 4 shown, including:
[0085] Step 401, the test device 101 starts a performance test on at least one server where the system under test is located.
[0086] In a possible embodiment, the management personnel start the performance testing of each system under test through the management platform; wherein, the system under test corresponds to at least one server.
[0087] Step 402, the testing device 101 selects the target server with the highest resource occupancy in the servers where the system under test is located.
[0088] In a possible embodiment, after the first set time after the start of the performance testing, the testing device 101 collects the running parameters of each server, processes the running parameters, and determines the server whose running parameters meet the preset indicators as the target server. Among them, as shown in Figure 5 After the testing device 101 obtains the running parameters such as the system load, CPU usage rate, memory usage rate, and network usage rate of the clearing system on Service 1, Server 2, and Server 3, and performs calculations according to the above resource usage rate formula, for example, if the R_U of Server 3 is the highest, then Server 3 is the target server.
[0089] Step 403, the testing device 101 connects to the target server.
[0090] In a possible embodiment, the testing device 101 logs in to the target server according to the IP of the target server. Among them, as shown in Figure 5 The testing device 101 logs in to Server 3.
[0091] Step 404, the testing device 101 performs stack collection on the system under test on the target server.
[0092] In a possible embodiment, after logging in to the target server, stack collection is performed on the system under test on the target server. Among them, a script is run to perform stack collection on the system under test on the target server. Specifically, after using the script command to enter the directory of the system under test, the corresponding command is used to perform stack collection on the system under test. Among them, as shown in Figure 5 After logging in to the target server 3, the method in Step 204 above is used to run the script on the clearing system on Server 3 for stack collection.
[0093] In a possible embodiment, in order to more truly reflect the running situation of the system under test during the performance testing, a random and discrete method is adopted in the script to randomly obtain at least one time point at the second set time after calculating the target server for data collection, where the specific method is as in Step 204 above.
[0094] Step 405, the testing device 101 saves the stack collection result of the system under test on the target service.
[0095] In a possible embodiment, after the test device 101 completes stack collection on the system under test on the target server in step 404 above, the stack collection result is saved to the database corresponding to the management platform.
[0096] Among them, as shown in Figure 5 After the test device 101 performs stack collection on the clearing system on server 3, the stack collection result is saved to the server corresponding to the management platform.
[0097] Step 406, the test device 101 performs comparative analysis on the stack collection result.
[0098] In a possible embodiment, the test device 101 performs comparative analysis on the saved stack collection result to generate a stack analysis result, that is, a performance problem analysis result.
[0099] Step 407, display the stack analysis result.
[0100] In a possible embodiment, the management platform simultaneously displays the stack analysis result and the performance test result. Optionally, the management platform outputs the stack analysis result and the performance test result in text or voice.
[0101] Among them, as shown in Figure 5 The management platform displays the stack analysis result and the performance test result of the test device 101 on the clearing system on server 3 to the management personnel by means of output through a display.
[0102] Based on the same technical concept, an embodiment of the present invention further provides a performance test device, and this device can execute the embodiments of the above method. The device provided by the embodiment of the present invention is as shown in Figure 6 shown, including:
[0103] A processing unit 601, configured to perform a performance test on at least one server where the system under test is located;
[0104] An acquisition unit 602, configured to obtain the operating parameters of the at least one server during the performance test;
[0105] The processing unit 601 is further configured to determine a target server from the at least one server according to the operating parameters; perform stack collection on the system under test on the target server, and perform performance problem analysis according to the stack collection result; generate a performance test result and a performance problem analysis result of the system under test.
[0106] In a possible design, the processing unit 601 is specifically configured to: for any one of the servers, calculate the resource utilization rate of the server according to the operating parameters of the server; and screen out the target servers from the at least one server whose resource utilization rates meet the preset criteria.
[0107] In a possible design, the operating parameters include at least one of the system load within a unit time, CPU utilization rate, memory utilization rate, or network utilization rate;
[0108] Among them, the processing unit 601 is further configured to: calculate the resource utilization rate of the server through a preset resource utilization rate formula according to the operating parameters of the server;
[0109] The preset resource utilization rate formula is:
[0110] R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net_U × K4
[0111] Among them, R_U represents the resource utilization rate of the server, L_ONE represents the system load of the server within a unit time, K1 represents the weight of the system load within a unit time, CPU_U represents the CPU utilization rate of the server, K2 represents the weight of the CPU utilization rate, M_U represents the memory utilization rate of the server, K3 represents the weight of the memory utilization rate, NET_U represents the network utilization rate of the server, and K4 represents the weight of the network utilization rate;
[0112] Furthermore, the processing unit 601 is specifically configured to: determine the target server from the at least one server according to the resource utilization rate of the server, where the resource utilization rate of the target server meets the preset criteria.
[0113] In a possible design, that the resource utilization rate of the target server meets the preset criteria includes: the resource utilization rate of the target server is the maximum value of the resource utilization rates of all the servers where the system under test for performance testing is located, or the resource utilization rate of the target server is greater than the set threshold.
[0114] In a possible design, the processing unit 601 is further configured to: collect the stack on the target server for the system under test at multiple randomly selected time points. Then, compare and analyze the stack collection results at these multiple time points to generate a performance problem analysis result.
[0115] In a possible design, the stack analysis result includes at least one of deadlock information, thread running state statistical results, and high-frequency function call statistical results of business logic functions. The high-frequency function is a running function whose function call times meet the set conditions;
[0116] Based on the same inventive concept, an embodiment of the present invention provides a computing device, such as Figure 7 shown, which includes at least one processor 701 and a memory 702 connected to the at least one processor. In the embodiment of the present invention, the specific connection medium between the processor 701 and the memory 702 is not limited, Figure 7 taking the connection between the processor 701 and the memory 702 through a bus as an example. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0117] In the embodiment of the present invention, the memory 702 stores instructions executable by the at least one processor 701. By executing the instructions stored in the memory 702, the at least one processor 701 can execute the steps included in the foregoing settlement method.
[0118] Among them, the processor 701 is the control center of the terminal device. It can connect various parts of the terminal device through various interfaces and lines, and process data by running or executing the instructions stored in the memory 702 and calling the data stored in the memory 702. Optionally, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be separately implemented on independent chips.
[0119] The processor 701 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0120] The memory 702 serves as a non-volatile computer-readable storage medium and can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 702 can include at least one type of storage medium. For example, it can include flash memory, hard disks, multimedia cards, card-type memories, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memories, magnetic disks, optical disks, and so on. The memory 702 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiments of the present invention can also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0121] Based on the same technical concept, embodiments of the present invention provide a computer-readable medium that stores a computer program executable by a terminal device. When the program runs on the terminal device, the terminal device is caused to execute the steps of the settlement method.
[0122] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) that contain computer-usable program code.
[0123] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to produce a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing in the process Figure 1 one process or multiple processes and / or blocksFigure 1 means for the functions specified in one or more boxes.
[0124] 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 operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 or more boxes.
[0125] 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, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one Figure 1 one or more processes and / or boxes Figure 1 or more boxes.
[0126] Although the preferred embodiments of the present invention have been described, additional changes and modifications can be made by those skilled in the art once they learn of the basic inventive concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the present invention.
[0127] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A system testing method, characterized in that, Including: Performing a performance test on at least one server where the system under test is located; After a first set time after the start of the performance test, obtaining the operating parameters of the at least one server; According to the operating parameters, taking the server with the highest resource utilization rate among the at least one server as the target server; Randomly obtaining at least one time point at a second set time, performing stack collection on the system under test on the target server at the at least one time point, comparing and analyzing the stack collection results at the at least one time point to obtain a stack analysis result, where the stack analysis result includes at least one of deadlock information, thread running state statistical results, and high-frequency function call statistical results of business logic functions, and where the high-frequency function is a running function whose function call count meets the set conditions; Generating a performance test result of the system under test; Saving the stack analysis result to a database, and if the display of the performance test result is triggered, simultaneously displaying the stack analysis result in the database.
2. The method according to claim 1, wherein The determining the target server from the at least one server according to the operating parameters includes: For any one of the servers, calculating the resource utilization rate of the server according to the operating parameters of the server; Filtering out the target server whose resource utilization rate meets the preset metrics from the at least one server.
3. The method according to claim 2, wherein The operating parameters include at least one of the system load per unit time, CPU utilization rate, memory utilization rate, or network utilization rate; The calculating the resource utilization rate of the server according to the operating parameters of the server includes: Calculating the resource utilization rate of the server according to the operating parameters of the server through a preset resource utilization rate formula; The preset resource utilization rate formula is: R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net_U × K4; Wherein, R_U represents the resource utilization rate of the server, L_ONE represents the system load per unit time of the server, K1 represents the weight of the system load per unit time, CPU_U represents the CPU utilization rate of the server, K2 represents the weight of the CPU utilization rate, M_U represents the memory utilization rate of the server, K3 represents the weight of the memory utilization rate, NET_U represents the network utilization rate of the server, and K4 represents the weight of the network utilization rate.
4. The method according to claim 2, characterized in that, The preset metrics include: The resource utilization rate of the target server is the maximum of the resource utilization rates of all the servers where the system under test being performance-tested is located, or the resource utilization rate of the target server is greater than the set threshold.
5. A system testing device, characterized in that, The device includes: a collection unit, a processing unit; The processing unit is used to perform a performance test on at least one server where the system under test is located; The collection unit is used to obtain the operating parameters of the at least one server after a first set time after the start of the performance test; The processing unit is further configured to, according to the operation parameters, use the server with the highest resource utilization rate among the at least one server as the target server; randomly obtain at least one time point within a second set time, perform stack collection on the system under test on the target server at the at least one time point, compare and analyze the stack collection results at the at least one time point to obtain a stack analysis result, where the stack analysis result includes at least one of deadlock information, thread running state statistical results, and high-frequency function call statistical results of business logic functions, and where the high-frequency function is a running function whose function call count meets a set condition; generate a performance test result of the system under test; save the stack analysis result to a database, and if the display of the performance test result is triggered, display the stack analysis result in the database at the same time.
6. The device according to claim 5, characterized in that, Specifically, the processing unit is configured to: For any one of the servers, calculate the resource utilization rate of the server according to the operation parameters of the server; Screen out the target server from the at least one server whose resource utilization rate meets a preset index.
7. The device according to claim 6, characterized in that The operation parameters include at least one of system load within a unit time, CPU utilization rate, memory utilization rate, or network utilization rate; The processing unit is further configured to: calculate the resource utilization rate of the server according to the operation parameters of the server through a preset resource utilization rate formula; The preset resource utilization rate formula is: R_U = L_ONE × K1 + CPU_U × K2 + M_U × K3 + Net_U × K4; wherein, R_U represents the resource utilization rate of the server, L_ONE represents the system load of the server within the unit time, K1 represents the weight of the system load within the unit time, CPU_U represents the CPU utilization rate of the server, K2 represents the weight of the CPU utilization rate, M_U represents the memory utilization rate of the server, K3 represents the weight of the memory utilization rate, NET_U represents the network utilization rate of the server, and K4 represents the weight of the network utilization rate.
8. The device according to claim 6, characterized in that, The preset index includes: The resource utilization rate of the target server is the maximum value of the resource utilization rates of all the servers where the system under test for performance testing is located, or the resource utilization rate of the target server is greater than a set threshold.
9. A computing device, characterized in that, It includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the processing unit executes the method according to any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes the method according to any one of claims 1-4.
Citation Information
Patent Citations
Method, device and system for regulating operating state of server
CN105791033A
Method and device for locating Java application program performance problem and equipment
CN107861878A