Performance analysis method, device, storage medium and program product of an application program
By receiving parameter information to determine the target application and function, using a delay strategy to inject delays, and collecting performance data, this solves the problem of performance analysis that requires modification of source code in existing technologies, and achieves efficient performance analysis without code modification.
Patent Information
- Application Number
- CN202511213089.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-08-28
AI Technical Summary
Existing technologies require modifying the application's source code and recompiling and deploying it for performance analysis, which cannot efficiently identify performance bottlenecks in a real production environment.
By receiving parameter information, the target application and function are identified, and delay is injected into the target function using fixed, proportional, or gradient delay strategies. Performance data is collected and the impact of the function on performance is analyzed.
Quickly pinpoint application performance bottlenecks without modifying code or recompiling, and flexibly analyze the performance impact of any function.
Smart Images

Figure CN120723617B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software analysis, and in particular to a performance analysis method, device, storage medium and program product of an application program. BACKGROUND
[0002] Analyzing the performance of an application program and determining the influence degree of different functions of an application program on the performance of the application program are beneficial to identifying the bottleneck of the application program and providing a basis for optimizing the application program. For performance analysis of an application program, related technologies need to modify the source code of the application program and recompile and deploy after each modification, which is not suitable for actual production environments. Therefore, how to solve the above technical defects has become a technical problem to be solved by the person skilled in the art. SUMMARY
[0003] The present application provides a performance analysis method, device, storage medium and program product of an application program to at least solve the problem that the source code of the application program needs to be modified and recompiled and deployed after each modification in related technologies.
[0004] The present application provides a performance analysis method of an application program, comprising:
[0005] receiving parameter information input by an operation object;
[0006] determining a target application program, a target function in the target application program, a delay strategy and a delay parameter corresponding to the delay strategy according to the parameter information;
[0007] injecting delay into the target function according to the delay strategy and the delay parameter;
[0008] collecting performance data of the target application program when the target function is running after the delay is injected;
[0009] determining the influence degree of the target function on the performance of the target application program according to the performance data.
[0010] The present application also provides a performance analysis device of an application program, comprising:
[0011] a receiving module configured to receive parameter information input by an operation object;
[0012] a first determining module configured to determine a target application program, a target function in the target application program, a delay strategy and a delay parameter corresponding to the delay strategy according to the parameter information;
[0013] an injecting module configured to inject delay into the target function according to the delay strategy and the delay parameter;
[0014] The collecting module is configured to collect performance data of the target application program at runtime after the target function is injected with the delay.
[0015] The second determining module is configured to determine the influence degree of the target function on the performance of the target application program according to the performance data.
[0016] The present application further provides an electronic device, comprising a memory configured to store a computer program, and a processor configured to execute the computer program to implement the steps of the performance analysis method of the application program.
[0017] The present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the performance analysis method of the application program.
[0018] The present application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of the performance analysis method of the application program.
[0019] The application program performance analysis method provided by the present application can specify the application program and the specific function of the application program to be analyzed through the parameter information, inject the delay into the specific function, collect and analyze the performance data of the application program after the specific function is injected with the delay, and determine the influence degree of the specific function on the performance of the application program, so that the influence degree of any function of the application program on the application program can be tested at any time on demand during the runtime of the application program, and the bottleneck can be quickly located without pausing the application program, modifying the code of the application program, and recompiling. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0021] Figure 1 A flowchart of the application program performance analysis method provided by the embodiments of the present application;
[0022] Figure 2 A flowchart of the insertion of the monitoring probe provided by the embodiments of the present application;
[0023] Figure 3 A schematic diagram of the application program performance analysis system provided by the embodiments of the present application;
[0024] Figure 4A schematic diagram of an electronic device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, any other embodiments obtained by those skilled in the art without creative efforts belong to the protection scope of the present application.
[0026] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0027] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0028] Embodiments of the present application provide a performance analysis method of an application program, which will be described in detail below in combination with the execution flow of the method.
[0029] Reference Figure 1 As shown in the figure, the performance analysis method of the application program provided by the embodiments of the present application comprises:
[0030] S101: receiving parameter information input by an operation object.
[0031] The operation object can be a user. The parameter information can include an identifier of the application program (for example, a number of the application program), a function identifier (for example, a function name), a delay policy and a corresponding delay parameter. The operation object can specify the application program to be analyzed, i.e., a target application program described below, specify the function to be injected with delay, i.e., a target function described below, and specify the delay policy and the corresponding delay parameter by inputting the parameter information. The delay policy refers to the policy adopted for injecting delay into the target function. The delay parameter refers to the parameter on which the delay amount, i.e., the delay duration, in the delay policy is determined.
[0032] In some embodiments, the method further comprises:
[0033] verifying the parameter information;
[0034] If the parameter information is verified, the target application, the target function, the delay strategy and the delay parameter are determined according to the parameter information.
[0035] After receiving the parameter information input by the operation object, the legality of the parameter information is verified first. If the verification is passed, the subsequent steps are executed. If the verification is not passed, the operation object can be prompted that the parameter information is incorrect, so that the operation object re-enters the parameter information.
[0036] S102: The target application, the target function in the target application, the delay strategy and the delay parameter corresponding to the delay strategy are determined according to the parameter information.
[0037] In some embodiments, determining the delay strategy and the delay parameter according to the parameter information includes: determining a fixed delay strategy and a delay constant corresponding to the fixed delay strategy, or a proportional delay strategy and a proportional coefficient corresponding to the proportional delay strategy, or a gradient delay strategy and an initial delay time, a fixed interval and a size of a delay queue corresponding to the gradient delay strategy according to the parameter information.
[0038] In the embodiment, the delay strategy includes a fixed delay strategy, a proportional delay strategy and a gradient delay strategy. The fixed delay strategy means injecting a fixed time delay into the target function, which can be represented as delay=C. delay represents the delay amount, i.e. the time length of the delay, and C is the delay constant. The proportional delay strategy means injecting a delay that is a multiple of the default running time of the target function into the target function, which can be represented as delay=k×T_exec. Wherein, T_exec is the default running time of the target function, and k is the proportional coefficient. The gradient delay strategy means injecting a delay specified in a delay queue into the target function in turn, which can be represented as delay={D0,D0+t,D0+2t,...D0+nt}. D0 is the initial delay, t is the fixed interval, and n is the size of the delay queue. According to the initial delay D0, the fixed interval t and the size of the delay queue n, the delay queue can be generated.
[0039] It should be noted that the gradient delay strategy is to inject delays into the target function in sequence, and each time the target application is running, the delay of the target function is one in the delay queue. For example, D0=10us, t=5us, n=4, then the gradient delay strategy delay={10us, 15us, 20us, 25us, 30us}. Assuming that the target function is the func1 function, then 10us is injected at the func1 function when the target application runs for the first time, the delay injected at the func1 function is modified to 15us when the target application runs for the second time, the delay injected at the func1 function is modified to 20us when the target application runs for the third time, and so on, until the last delay injected at the func1 function is modified to 30us.
[0040] The operation object can specify the delay strategy as the fixed delay strategy by inputting the identifier corresponding to the fixed delay strategy and the delay constant C, and the delay duration is equal to the delay constant C. The operation object can specify the delay strategy as the proportional delay strategy by inputting the identifier corresponding to the proportional delay strategy and the proportional coefficient k, and the delay duration is equal to the proportional coefficient k x T_exec. The operation object can specify the delay strategy as the gradient delay strategy by inputting the identifier of the gradient delay strategy and the initial delay D0, the fixed interval t, and the size n of the delay queue, and the delay duration is D0, D0+t, D0+2t,... D0+nt, respectively.
[0041] The embodiment provides multiple delay strategies, and different delay strategies can be used to inject delays as needed, so that the diversity and flexibility of delay injection can be improved.
[0042] In some embodiments, determining the target function in the target application according to the parameter information includes:
[0043] determining whether the parameter information includes a function identifier;
[0044] if the parameter information includes the function identifier, the function corresponding to the function identifier is the target function;
[0045] if the parameter information does not include the function identifier, the function provided by the symbol table corresponding to the target application is the target function.
[0046] If the parameter information input by the operation object includes a function identifier, i.e., the operation object specifies a specific function, the function specified by the operation object is the target function. If the parameter information input by the operation object does not include a function identifier, i.e., the operation object does not specify a specific function, a symbol table corresponding to the target application program is parsed, and all the functions provided by the symbol table are target functions. The symbol table is a kind of data structure corresponding to an application program, and contains some information in the original code of the application program, such as symbol names, variables, function names, scopes, storage locations, and the like.
[0047] In this embodiment, the function to be injected with the delay can be specified through the parameter information, so that the delay is injected into the specific function, and the influence degree of the specific function on the performance of the application program is analyzed. In addition, the delay can also be injected into all the functions of the application program, so that the influence degree of each function on the performance of the application program is analyzed one by one.
[0048] S103: According to the delay strategy and the delay parameter, a delay is injected into the target function.
[0049] If the delay strategy is the fixed delay strategy, the delay amount of the delay injected into the target function is equal to the delay constant C. If the delay strategy is the proportional delay strategy, the delay amount of the delay injected into the target function is equal to the proportional coefficient k x T exec. If the delay strategy is the gradient delay strategy, the delay is sequentially injected into the target function, and the delay amount of the delay injected each time is equal to one of the delay time lengths in the delay queue.
[0050] In some embodiments, according to the delay strategy and the delay parameter, the delay is injected into the target function, including:
[0051] The monitoring probe is inserted into the target function;
[0052] According to the delay strategy and the delay parameter, the delay is injected at the position where the monitoring probe is inserted.
[0053] First, the monitoring probe is inserted into the target function, and then the delay is injected at the position where the monitoring probe is inserted according to the delay strategy and the delay parameter.
[0054] In some embodiments, the monitoring probe is inserted into the target function, including:
[0055] The monitoring probe is inserted into the target function, and it is judged whether the insertion of the monitoring probe is successful;
[0056] If the insertion of the monitoring probe is successful, the position where the monitoring probe is inserted is displayed;
[0057] If the insertion of the monitoring probe fails, insertion exception information is displayed.
[0058] ReferenceFigure 2 As shown, the mode of inserting the probe includes a full function mode and a specified function mode. If it is the full function mode, i.e. the mode in which the operating object does not specify a specific function, the monitoring probe is inserted at all identified positions. The all identified positions refer to the positions of all functions provided by the symbol table corresponding to the target application program. If it is not the full function mode, i.e. the specified function mode (the mode in which the operating object specifies a specific function), the monitoring probe is inserted at the specified position, i.e. the position of the target function. It is determined whether the insertion of the monitoring probe is successful. If the insertion of the monitoring probe is successful, the position at which the monitoring probe is inserted is sent to the display output module for display. If the insertion of the monitoring probe fails, insertion exception information is sent to the display output module for display. Through the displayed information, the operating object can timely learn the insertion of the monitoring probe.
[0059] In some embodiments, according to the delay strategy and the delay parameter, injecting delay into the target function comprises:
[0060] If the target function is a function corresponding to a function identifier, delay is injected into the function corresponding to the function identifier according to the delay strategy and the delay parameter.
[0061] If the target function is a function provided by a symbol table corresponding to the target application program, delay is injected into the functions provided by the symbol table according to the delay strategy and the delay parameter; wherein delay is injected into one function provided by the symbol table at a time and the performance data of the target application program at runtime after the injection of the delay into the function is collected.
[0062] If the target function is a function specified by the operating object, i.e. a function corresponding to a function identifier in the parameter information input by the operating object, delay is injected into the function corresponding to the function identifier according to the delay strategy and the delay parameter. If the target function is a function provided by a symbol table corresponding to the target application program, delay is injected into the functions provided by the symbol table according to the delay strategy and the delay parameter; wherein delay is injected into one function provided by the symbol table at a time and the performance data of the target application program at runtime after the injection of the delay into the function is collected. That is, delay is injected into one function among all the functions provided by the symbol table at a time, and the influence degree of the function on the performance of the target application program is analyzed.
[0063] S104: Collecting the performance data of the target application program at runtime after the injection of the delay into the target function.
[0064] S105: Determining the influence degree of the target function on the performance of the target application program according to the performance data.
[0065] In some embodiments, collecting the performance data of the target application program at runtime comprises:
[0066] collecting an interface response time, an error rate, and a throughput of the target application program when the target function is running.
[0067] In some embodiments, determining the degree of influence of the target function on the performance of the target application program according to the performance data comprises:
[0068] determining a target performance indicator according to the parameter information;
[0069] calculating a change value of the target performance indicator of the target application program relative to a baseline after the target function injects the delay;
[0070] calculating a hotspot influence factor according to the change value and the delay amount;
[0071] determining the degree of influence of the target function on the performance of the target application program according to the hotspot influence factor; wherein the degree of influence of the target function on the performance of the target application program is positively correlated with the hotspot influence factor.
[0072] In the embodiment, the parameter information input by the operation object can further include a performance indicator type, so that the operation object can specify the performance indicator of the target application program by inputting the parameter information. According to the parameter information input by the operation object, the performance indicator specified by the operation object, i.e., the target performance indicator, is determined. The change value AT of the target performance indicator of the target application program relative to the baseline (the target performance indicator of the target application program when the target function does not inject the delay) is calculated after the target function injects the delay. The hotspot influence factor is calculated according to the change value AT and the delay amount, and the calculation method can be HIF = AT / delay amount. HIF represents the hotspot influence factor. The degree of influence of the target function on the performance of the target application program is determined according to the hotspot influence factor. The degree of influence of the target function on the performance of the target application program is positively correlated with the hotspot influence factor. The greater the hotspot influence factor is, the greater the influence of the target function on the overall performance of the target application program is.
[0073] For example, the target performance indicator is the interface response time, and the change value AT of the interface response time of the target application program relative to the baseline is calculated after the target function injects the delay. The hotspot influence factor is calculated according to the change value AT and the delay amount.
[0074] When the performance indicator type is not included in the parameter information, i.e., the performance indicator type is not specified by the operation object, the change value of the default performance indicator relative to the baseline can be calculated, and then the hotspot influence factor is calculated. The default performance indicator can be any one of the interface response time, the error rate, and the throughput.
[0075] Or, when the performance indicator type is not included in the parameter information, the change value of each performance indicator relative to the baseline can be calculated respectively, and the hotspot influence factor can be calculated respectively. For multiple hotspot influence factors corresponding to the same target function, the multiple hotspot influence factors corresponding to the same target function can be summed by weighted summation, and the sum value is taken as the basis for determining the influence degree of the target function on the performance of the target application program.
[0076] For example, when the performance indicator type is not included in the parameter information, the change value ΔT1 of the interface response time relative to the baseline is calculated, and the hotspot influence factor 1 is calculated according to the change value ΔT1 and the delay amount. The change value ΔT2 of the error rate relative to the baseline is calculated, and the hotspot influence factor 2 is calculated according to the change value ΔT2 and the delay amount. The change value ΔT3 of the throughput relative to the baseline is calculated, and the hotspot influence factor 3 is calculated according to the change value ΔT3 and the delay amount. The hotspot influence factor 1, the hotspot influence factor 2, and the hotspot influence factor 3 are weighted and summed, and the influence degree of the target function on the performance of the target application program is determined according to the sum value. The greater the sum value, the greater the influence of the target function on the overall performance of the target application program.
[0077] In combination with multiple performance indicators, the influence degree of the target function on the performance of the target application program can be more accurately and comprehensively determined.
[0078] In some embodiments, further comprising:
[0079] determining whether the delay injection is successful;
[0080] if the delay injection is successful, displaying delay injection success information;
[0081] if the delay injection fails, displaying delay injection failure information.
[0082] After injecting the delay into the target function, it is first determined whether the delay injection is successful. If successful, delay injection success information is output to the display output module for display, and performance data of the target application program is collected during the period when the target function is injected with the delay. If it fails, delay injection failure information is output to the display output module for display, and subsequent steps such as collecting performance data of the target application program are not performed.
[0083] In some embodiments, further comprising:
[0084] According to the influence degree of the target function on the performance of the target application program, the target function is sorted, and in combination with the collected performance data of the target application program, a hotspot report is generated.
[0085] On the basis of calculating the hotspot influence factors of each target function, the target functions are sorted according to the sizes of the hotspot influence factors, and a hotspot report is generated in combination with the collected performance data of the target application program. The hotspot report can further include the names of the target functions to which the delay is injected, the absolute time points at which the target functions are injected with the delay, the delay amount, the execution time of the target functions when the delay is not injected, and the utilization rates of resources such as CPUs, memories, IOs, and networks.
[0086] In some embodiments, further comprising:
[0087] determining the location where the hotspot report is stored according to the parameter information;
[0088] displaying the location where the hotspot report is stored.
[0089] In the embodiment, the operation object can also specify the location where the hotspot report is stored by inputting parameter information, and therefore the parameter information input by the operation object can further include the location where the hotspot report is stored. The location where the hotspot report is stored is output to the display output module for display, so as to facilitate reading of the hotspot report.
[0090] The application program performance analysis method provided in the above embodiments can be implemented by an application program performance analysis system, as shown in Figure 3 The application program performance analysis system includes a user interface, a dynamic probe mounting module, a multi-delay strategy library, a delay injection module, a performance index monitoring module, a hotspot report generation module, and a display output module.
[0091] The user interface receives parameter information input by a user. The parameter information input by the user can include an application program number, a function identifier, a delay strategy, a delay parameter, a performance index type, and a hotspot report storage location. After receiving the parameter information input by the user, the user interface verifies the legality of the parameter information, and when the parameter information passes the verification, the parameter information is transmitted to corresponding modules.
[0092] The dynamic probe mounting module can use uprobe (user space function entry) and uretprobe (user space function return) as the main dynamic insertion mechanism. After determining the target application program according to the application program number, the dynamic probe mounting module can run in two modes, a specified function mode and a global function mode. The specified function mode refers to a mode in which the user specifies the function to be inserted with the delay by inputting parameter information. The global function mode refers to a mode in which the user does not specify the function to be inserted with the delay by inputting parameter information.
[0093] When being the specified function mode, the dynamic probe mounting module inserts the monitoring probe in the function specified by the user, and judges whether the monitoring probe is successfully inserted. If the monitoring probe is successfully inserted, the position of the inserted monitoring probe is sent to the display output module, which displays the position to the user. If the monitoring probe fails to be inserted, the insertion exception information is returned to the display output module, which displays the insertion exception information to the user.
[0094] When being the global function mode, the dynamic probe mounting module parses the symbol table corresponding to the target application, inserts the monitoring probe in all functions provided by the symbol table, and sends the position of the inserted monitoring probe to the display output module, which displays the position to the user.
[0095] The multiple delay strategy library is a set of delay strategies provided by default by the system, and contains multiple delay strategies for the user to select. The user can also customize the delay strategy and add it to the multiple delay strategy library. The default delay strategy library includes the fixed delay strategy, the proportional delay strategy and the gradient delay strategy. The user can specify the delay strategy and the specific delay parameter through the user interface. The delay parameter in the fixed delay strategy includes the delay constant, the delay parameter in the proportional delay strategy includes the proportional coefficient, and the delay parameter in the gradient delay strategy includes the initial delay time, the fixed interval and the size of the delay queue.
[0096] The delay injection module injects the delay in the position of the inserted monitoring probe according to the delay strategy specified by the user in the busy waiting mode. If it is the specified function mode, the delay is injected in the function specified by the user, and it is judged whether the delay injection is successful. If the delay injection is successful, the delay injection success information is sent to the display output module, which displays the information to the user, and the function of the injected delay and the injected delay amount are sent to the performance index monitoring module. If the delay injection fails, the subsequent process is stopped and the delay injection failure information is sent to the display output module, which displays the information to the user. If it is the global function mode, the delay injection is performed on all functions with the inserted monitoring probe one by one, and only one function is injected with the delay each time. The performance index is collected, and after all the functions are injected with the delay and the performance index is collected, the hotspot report is generated.
[0097] The performance index monitoring module monitors and collects internal data and external data. The internal data includes the name of the function to which the delay is injected, the absolute time point when the function delay is injected, the amount of delay injected, the execution time when the function is not injected with delay, and the like. The external data refers to the API response time, error rate, throughput, and the like of the target service collected through a monitoring system, log or special Agent, and the utilization rate of resources such as CPU, memory, IO, network, and the like collected by using tools such as vmstat, mpstat, iostat, and the like. The performance index monitoring module sends the monitoring results of the internal data and the external data to the hotspot report generation module.
[0098] The hotspot report generation module calculates the change value ΔT of the performance index (such as the average API response time, throughput, and the like) of the application after the function delay is injected relative to the baseline, and calculates the hotspot influence factor according to the change value ΔT and the delay amount. The greater the value of the hotspot influence factor, the greater the influence of the function injected with delay on the overall performance of the application. On the basis of calculating the value of the hotspot influence factor of each function injected with delay, the hotspot report generation module judges the influence degree of each function on the performance of the application according to the size of the hotspot influence factor, sorts and outputs according to the size of the influence degree, and outputs the monitoring results obtained by the performance index monitoring module to the hotspot report.
[0099] The display output module returns the state of each stage information to the user in real time, including information such as whether the monitoring probe is inserted successfully, whether the delay injection is successful, and the position of the hotspot report generation.
[0100] In summary, the performance analysis method of the application provided by the application can specify the application and the specific function of the application to be analyzed through the parameter information, inject delay into the specific function, collect and analyze the performance data of the application after the specific function is injected with delay, and determine the influence degree of the specific function on the performance of the application. Thus, the influence degree of any function of the application on the application can be tested at any time on demand when the application is running, and the bottleneck can be quickly located without pausing the application, modifying the code of the application, and recompiling.
[0101] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware, but in many cases the former is a better embodiment.
[0102] The embodiments of the application further provide an application performance analysis device, which comprises:
[0103] The receiving module is configured to receive the parameter information input by the operation object.
[0104] The first determining module is configured to determine, according to the parameter information, a target application program, a target function in the target application program, a delay strategy, and a delay parameter corresponding to the delay strategy.
[0105] The injecting module is configured to inject delay into the target function according to the delay strategy and the delay parameter.
[0106] The collecting module is configured to collect performance data of the target application program when the target function is running after the delay is injected.
[0107] The second determining module is configured to determine, according to the performance data, an influence degree of the target function on the performance of the target application program.
[0108] In the above embodiment, as a specific implementation, the first determining module is configured to:
[0109] determine, according to the parameter information, a fixed delay strategy and a delay constant corresponding to the fixed delay strategy, or a proportional delay strategy and a proportional coefficient corresponding to the proportional delay strategy, or a gradient delay strategy and an initial delay time length, a fixed interval, and a size of a delay queue corresponding to the gradient delay strategy.
[0110] In the above embodiment, as a specific implementation, the first determining module includes:
[0111] The function identifier judging unit is configured to judge whether the parameter information includes a function identifier.
[0112] The first target function determining unit is configured to, if the parameter information includes the function identifier, a function corresponding to the function identifier is the target function.
[0113] The second target function determining unit is configured to, if the parameter information does not include the function identifier, a function provided by a symbol table corresponding to the target application program is the target function.
[0114] In the above embodiment, as a specific implementation, the second determining module includes:
[0115] The performance index determining unit is configured to determine, according to the parameter information, a target performance index.
[0116] The change value calculating unit is configured to calculate a change value of the target performance index of the target application program relative to a baseline after the delay is injected into the target function.
[0117] The hotspot influence factor calculating unit is configured to calculate a hotspot influence factor according to the change value and a delay amount.
[0118] An influence degree determination unit is configured to determine an influence degree of the target function on the performance of the target application according to the hotspot influence factor, wherein the influence degree of the target function on the performance of the target application is positively correlated with the hotspot influence factor.
[0119] In the above embodiment, as a specific implementation, the injection module comprises:
[0120] A probe insertion unit is configured to insert a monitoring probe into the target function.
[0121] A delay injection unit is configured to inject a delay at the position of the inserted monitoring probe according to the delay strategy and the delay parameter.
[0122] In the above embodiment, as a specific implementation, the probe insertion unit comprises:
[0123] A judgment subunit is configured to insert a monitoring probe into the target function and judge whether the inserted monitoring probe is successful.
[0124] A first display subunit is configured to display the position of the inserted monitoring probe if the inserted monitoring probe is successful.
[0125] A second display subunit is configured to display an insertion exception information if the inserted monitoring probe is unsuccessful.
[0126] In the above embodiment, as a specific implementation, the injection module is configured to:
[0127] If the target function is a function corresponding to a function identifier, a delay is injected into the function corresponding to the function identifier according to the delay strategy and the delay parameter.
[0128] If the target function is a function provided by a symbol table corresponding to the target application, a delay is injected into the functions provided by the symbol table according to the delay strategy and the delay parameter; wherein a delay is injected into one function provided by the symbol table at a time and the performance data of the target application during the function injection delay is collected.
[0129] In the above embodiment, as a specific implementation, the injection module further comprises:
[0130] A judgment module is configured to judge whether the delay injection is successful.
[0131] A first display module is configured to display a delay injection success information if the delay injection is successful.
[0132] A second display module is configured to display a delay injection failure information if the delay injection is unsuccessful.
[0133] On the basis of the above-mentioned embodiments, as a specific implementation, the collecting module is configured to:
[0134] collect the interface response time, error rate and throughput of the target application program during running.
[0135] On the basis of the above-mentioned embodiments, as a specific implementation, the application further comprises:
[0136] a hotspot report generation module configured to sort the target functions according to the degree of influence of the target functions on the performance of the target application program, and generate a hotspot report in combination with the collected performance data of the target application program.
[0137] On the basis of the above-mentioned embodiments, as a specific implementation, the application further comprises:
[0138] a storage location determination module configured to determine the storage location of the hotspot report according to the parameter information.
[0139] a storage location display module configured to display the storage location of the hotspot report.
[0140] On the basis of the above-mentioned embodiments, as a specific implementation, the application further comprises:
[0141] a verification module configured to verify the parameter information.
[0142] If the parameter information is verified, the first determination module determines the target application program, the target function, the delay strategy and the delay parameter according to the parameter information.
[0143] The application program performance analysis device provided by the application can specify the application program and the specific function of the application program to be analyzed through the parameter information, inject delay into the specific function, collect and analyze the performance data of the application program after the specific function is injected with delay, and determine the degree of influence of the function on the performance of the application program according to the performance data. Thus, the influence of any function of the application program on the application program can be tested at any time on demand during the running of the application program, and the bottleneck can be quickly located without the need to pause the application program, modify the code of the application program and recompile.
[0144] The features of the embodiments of the application program performance analysis device can be referred to the related descriptions of the embodiments of the application program performance analysis method, which will not be repeated here.
[0145] The embodiments of the application further provide an electronic device, which can refer to the above-mentioned embodiments of the application program performance analysis device. Figure 4As shown, the electronic device comprises a memory 1 and a processor 2, the memory 1 stores a computer program, and the processor 2 is configured to run the computer program to perform the steps in the performance analysis method embodiments of any of the above-mentioned application programs.
[0146] The electronic device provided by the application can specify the application program to be analyzed and the specific function of the application program through the parameter information, inject delay into the specific function, collect and analyze the performance data of the application program after the specific function is injected with delay, and determine the influence degree of the function on the performance of the application program according to the performance data. Thus, the influence degree of any function of the application program on the application program can be tested at any time on demand when the application program is running, and the bottleneck can be quickly located without pausing the application program, modifying the code of the application program, and recompiling.
[0147] The embodiment of the application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to perform the steps in the performance analysis method embodiments of any of the above-mentioned application programs when running.
[0148] In an exemplary embodiment, the above-mentioned computer readable storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0149] The embodiment of the application further provides a computer program product, which comprises a computer program, and the computer program is configured to perform the steps in the performance analysis method embodiments of any of the above-mentioned application programs when executed by a processor.
[0150] The embodiment of the application further provides another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is configured to perform the steps in the performance analysis method embodiments of any of the above-mentioned application programs when executed by a processor.
[0151] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.
[0152] The application provides an application performance analysis method, device, storage medium and program product. The principles and implementation manners of the application are described by using specific examples in the present application. The above description of the embodiments is only applicable to help understand the method of the application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the application, the application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the application.
Claims
1. A method for performance analysis of an application, characterized in that, include: Receive parameter information input from the operation object; Based on the parameter information, determine the target application, the target function in the target application, the delay strategy, and the delay parameters corresponding to the delay strategy; According to the delay strategy and the delay parameters, a delay is injected into the objective function; Collect performance data of the target application after the delay of the target function injection; Determine the degree of impact of the objective function on the performance of the target application based on the performance data; Determining the target function in the target application based on the parameter information includes: Determine whether the parameter information includes a function identifier; If the parameter information includes a function identifier, then the function corresponding to the function identifier is the target function; If the parameter information does not include a function identifier, then the function provided by the symbol table corresponding to the target application is the target function; Injecting delay into the objective function according to the delay strategy and the delay parameters includes: Insert a monitoring probe into the objective function; According to the delay strategy and the delay parameters, a delay is injected at the location where the monitoring probe is inserted; Injecting delay into the objective function according to the delay strategy and the delay parameters includes: If the target function is the function corresponding to the function identifier, then a delay is injected into the function corresponding to the function identifier according to the delay strategy and the delay parameters; If the target function is a function provided by the symbol table corresponding to the target application, then according to the delay strategy and the delay parameters, delays are injected into the functions provided by the symbol table in sequence; wherein, delays are injected into one function provided by the symbol table at a time and the performance data of the target application is collected after the function injection delay.
2. The application performance analysis method according to claim 1, characterized in that, Determining the delay strategy and delay parameters based on the aforementioned parameter information includes: Based on the parameter information, determine the delay constant corresponding to the fixed delay strategy, or the proportional coefficient corresponding to the proportional delay strategy, or the initial delay duration, fixed interval, and delay queue size corresponding to the gradient delay strategy.
3. The application performance analysis method according to claim 1, characterized in that, Determining the impact of the objective function on the performance of the target application based on the performance data includes: Determine the target performance indicators based on the parameter information; After calculating the target function injection delay, the change in the target application's target performance metric relative to the baseline; Calculate the hotspot impact factor based on the changes and delays. The degree of influence of the objective function on the performance of the target application is determined based on the hotspot influence factor; wherein the degree of influence of the objective function on the performance of the target application is positively correlated with the hotspot influence factor.
4. The application performance analysis method according to claim 1, characterized in that, Inserting monitoring probes into the objective function includes: Insert a monitoring probe into the objective function and determine whether the monitoring probe was successfully inserted. If the monitoring probe is successfully inserted, the location of the inserted monitoring probe will be displayed; If the monitoring probe fails to be inserted, an insertion error message will be displayed.
5. The application performance analysis method according to claim 1, characterized in that, Also includes: Determine if the delayed injection was successful; If the delayed injection is successful, a message indicating successful delayed injection will be displayed. If delayed injection fails, a delayed injection failure message will be displayed.
6. The application performance analysis method according to claim 1, characterized in that, The performance data collected during the runtime of the target application includes: Collect the interface response time, error rate, and throughput of the target application during runtime.
7. The application performance analysis method according to claim 1, characterized in that, Also includes: The objective functions are ranked according to their impact on the performance of the target application, and a hotspot report is generated by combining the collected performance data of the target application.
8. The application performance analysis method according to claim 7, characterized in that, Also includes: The location where the hotspot report is stored is determined based on the parameter information; This indicates the location where the hotspot report is stored.
9. The application performance analysis method according to claim 1, characterized in that, Also includes: The parameter information is verified; If the parameter information is verified, the target application, the target function, the delay strategy, and the delay parameters are determined based on the parameter information.
10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the performance analysis method for an application as described in any one of claims 1 to 9 when executing the computer program.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the performance analysis method for the application as described in any one of claims 1 to 9.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the performance analysis method for the application as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Performance analysis method and device, server and readable storage medium
CN108549600A
Performance analysis method and device for storage server and electronic equipment
CN111756575A