Application performance testing methods, systems, storage media, and computing devices

By simultaneously launching pre-configured agents when the application starts, detecting the performance parameters of each execution method, the problems of high algorithm complexity and poor user experience in application development are solved, and more fine-grained performance detection and higher detection efficiency.

CN113282469BActive Publication Date: 2025-02-18PERFECT WORLD HLDG GRP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110481455.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-30
Publication Date
2025-02-18
Estimated Expiration
2041-04-30

AI Technical Summary

Technical Problem

During application development, developers may have omissions in coding, resulting in high algorithm complexity, increased response time, poor user experience, and inefficient manual efficiency when troubleshooting problems.

Method used

Provides an application performance detection method. By synchronously launching pre-configured agents when the application to be detected is started, the agent uses the agent to pass the agent content into the application process, scans and detects the performance parameters of each execution method. To each execution method, finer granular detection is achieved.

Benefits of technology

It avoids application startup or execution failures caused by errors in adding startup parameters, and realizes fine-grained detection of application performance parameters, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113282469B_ABST
    Figure CN113282469B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, storage medium and computing device for detecting the performance of an application program. The method comprises: in response to the startup operation of the application program to be detected, synchronously starting an agent program that is pre-configured in the application program in the form of parameters; using the started agent program to pass the proxied content into the application process of the application program in the form of parameters; scanning the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application program to run the process related to the proxied content based on the scanning result. The embodiment of the present invention can synchronously start the agent program when the application program to be detected is started, without adding startup parameters to the application again, thereby avoiding the problem of application startup failure or execution failure caused by errors in adding startup parameters. In addition, the detection of application performance parameters is specific to each execution method, so that the performance of the application can be detected in a more fine-grained manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data detection technology, and in particular to a performance detection method, system, storage medium and computing device for an application program. Background Art

[0002] During the application development process, as the number of algorithms and engineering departments involved in the application increases, many developers have to take on multiple roles, which makes it easy for mistakes to occur in coding, and even the algorithm complexity may exceed n^2. If the existing response time is not within the scope of attention, it will inevitably cause users to use the application unsmoothly and have a poor user experience. In the process of troubleshooting, constantly retrying the online log may not successfully find the problem, resulting in low manual efficiency. Summary of the invention

[0003] In view of the above problems, the present invention is proposed to provide a method, system, storage medium and computing device for detecting the performance of an application program that overcomes the above problems or at least partially solves the above problems, and can synchronously start the agent program when the application to be detected is started, without adding startup parameters to the application program again to start the agent program, thereby avoiding the failure of the application program to start or execute due to errors in adding startup parameters. By specificizing the detection of application performance parameters to each execution method, the performance of the application program can be detected in a more fine-grained manner.

[0004] According to one aspect of an embodiment of the present invention, a performance detection method for an application is provided, comprising:

[0005] In response to a startup operation of the application to be detected, synchronously starting an agent program pre-configured in the application in the form of parameters;

[0006] Using the started proxy program, the proxy content is passed into the application process of the application program in the form of parameters;

[0007] Scan the proxied content in the application process of the application, and detect the performance parameters of each execution method called by the application to run the process related to the proxied content based on the scanning result.

[0008] Optionally, the proxied content includes at least one of a proxied path, a project name, and a key code snippet.

[0009] Optionally, before scanning the proxied content in the application process of the application, the method further includes:

[0010] The proxied content is set as the scanned content, and a scanning program for scanning is respectively injected into the execution method of each scanned package class corresponding to the scanned content;

[0011] The scan content to be excluded is set, wherein the scan content to be excluded includes the content that does not appear for the first time in the repetitive content or the scan content to be excluded that is manually set.

[0012] Optionally, scanning the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application to run the process related to the proxied content based on the scanning result, includes:

[0013] Scanning the proxied content in the application process of the application program by injecting a scanning program into the execution method of the scanned package class;

[0014] Based on the scanning results, the performance parameters of each execution method called by the application program when running the proxy content-related process are counted and recorded.

[0015] Optionally, the performance parameters of the execution method include:

[0016] At least one of the following: the time consumed by the execution method, the name of the execution method, the name of the parent method of the execution method, the entity class to which the execution method belongs, and the input parameters.

[0017] Optionally, if the performance parameter of the execution method includes the time taken to execute the method, detecting the performance parameters of each execution method called by the proxy content-related process when the application runs the execution method based on the scanning result includes:

[0018] Detecting the time points at which each execution method called in the process related to the proxied content is started and completed when the application runs the proxied content;

[0019] The time difference between the execution completion time and the execution start time is calculated, and the time difference is used as the consumption time of the corresponding execution method.

[0020] Optionally, after detecting the performance parameters of each execution method called by the proxy content-related process when the application runs the performance parameters based on the scanning result, the method further includes:

[0021] Cache the performance parameters of each execution method to the specified code queue;

[0022] The performance parameters cached in the designated code queue are stored in a preset storage object at designated time intervals.

[0023] Optionally, storing the performance parameters cached in the designated code queue into a preset storage object at designated time intervals includes:

[0024] The performance parameters cached in the specified code queue are stored in a preset storage object in batches at specified time intervals; or

[0025] The performance parameters cached in the designated code queue are sequentially and regularly stored in a preset storage object at designated time intervals.

[0026] Optionally, after storing the performance parameters cached in the designated code queue into a preset storage object at designated time intervals, the method further includes:

[0027] Visually displaying the performance parameters of each execution method stored in the preset storage object in the form of a link;

[0028] The performance parameters of the execution method are used as the node information of the link.

[0029] According to another aspect of an embodiment of the present invention, a performance detection system for an application is provided, including:

[0030] A startup module, adapted to synchronously start an agent program pre-configured in the application program in the form of parameters in response to a startup operation of the application program to be detected;

[0031] An agent module, adapted to use the started agent program to pass the proxied content into the application process of the application program in the form of parameters;

[0032] The detection module is adapted to scan the proxied content in the application process of the application, and detect the performance parameters of each execution method called by the application to run the process related to the proxied content based on the scanning result.

[0033] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the computer storage medium stores computer program code, and when the computer program code runs on a computing device, the computing device executes the performance detection method of the application program in any of the above embodiments.

[0034] According to another aspect of an embodiment of the present invention, a computing device is provided, comprising: a processor; a memory storing computer program code; and a performance detection method for an application program of any of the above embodiments, which causes the computing device to execute the computer program code when the processor executes the computer program code.

[0035] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the computer storage medium stores a computer program code, and when the computer program code runs on a computing device, the computing device executes the performance detection method of the application program described in any of the above embodiments.

[0036] According to another aspect of an embodiment of the present invention, a computing device is provided, comprising: a processor; a memory storing computer program code; when the computer program code is executed by the processor, the computing device executes the performance detection method of the application described in any of the above embodiments.

[0037] In an embodiment of the present invention, when the application to be detected is started, the proxy program pre-configured in the application in the form of parameters can be started synchronously, and then the proxy content is passed into the application process of the application in the form of parameters through the started proxy program, and finally the proxied content in the application process of the application is scanned, and the performance parameters of each execution method called by the application running the proxy content related process are detected based on the scanning results. Therefore, the embodiment of the present invention configures the proxy program in the application in the form of parameters in advance, so that the proxy program can be started synchronously when the application to be detected is started, without adding startup parameters to the application again to start the proxy program, thereby avoiding the problem of application startup failure or execution failure caused by errors in adding startup parameters. In addition, the embodiment of the present invention can detect the performance parameters of each execution method in the process related to the proxied content, that is, the detection of the application performance parameters is specific to each execution method, so that the performance of the application can be detected in a more fine-grained manner.

[0038] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below.

[0039] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0041] Figure 1 A schematic diagram showing a flow chart of a method for detecting performance of an application program according to an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a performance detection process of an application according to an embodiment of the present invention is shown;

[0043] Figure 3 A schematic diagram of a visualization interface displayed during a performance detection process of an application according to an embodiment of the present invention is shown;

[0044] Figure 4 A link diagram corresponding to performance parameters of an execution method in an application according to an embodiment of the present invention is shown;

[0045] Figure 5 A schematic diagram showing the structure of a performance detection system for an application according to an embodiment of the present invention is shown;

[0046] Figure 6 A schematic diagram showing the structure of a performance detection system for an application according to another embodiment of the present invention is shown;

[0047] Figure 7 A schematic diagram showing the structure of a performance detection system for an application according to yet another embodiment of the present invention is shown;

[0048] Figure 8 A schematic diagram of the structure of a performance detection system for an application program according to yet another embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0051] In order to solve the above technical problems, an embodiment of the present invention provides a performance detection method for an application program. Figure 1 FIG. 4 is a flow chart showing a method for detecting the performance of an application program according to an embodiment of the present invention. Figure 1 , the performance detection method of the application includes steps S102 to S106.

[0052] Step S102, in response to the start operation of the application to be detected, synchronously start the agent program pre-configured in the application in the form of parameters.

[0053] In the embodiment of the present invention, the agent program (i.e., agent Agent) can be set in the application to be detected in the form of a plug-in. The agent Agent of this embodiment can be applied to multiple different applications to be detected. The application to be detected can be a web application and a microservice application. Such applications can reside in the memory of the terminal device, execute the code corresponding to the application by receiving an external trigger request (such as an http request), and return the data after execution. The application can also be other programs, which are not specifically limited in the implementation of the present invention.

[0054] Step S104, using the started proxy program to pass the proxied content into the application process of the application program in the form of parameters.

[0055] Step S106, scanning the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application running the process related to the proxied content based on the scanning result.

[0056] The embodiment of the present invention configures the proxy program in the application program in advance in the form of parameters, so that the proxy program can be started synchronously when the application to be detected is started, without adding startup parameters to the application program again to start the proxy program, thereby avoiding the problem of application startup failure or execution failure caused by errors in adding startup parameters. In addition, the embodiment of the present invention can detect the performance parameters of each execution method in the process related to the proxied content, that is, the detection of application performance parameters is specific to each execution method, so that the performance of the application can be detected in a more fine-grained manner.

[0057] In one embodiment of the present invention, the proxied content in step S104 above may include at least one of the proxied path, project name, key code snippet, etc. In addition, the proxied content can be pre-specified, and after the specification is completed, it can be used as the content of subsequent scanning. The proxied path can be the path of a class, or it can be the path of all classes under the same package. If the embodiment of the present invention is to achieve fine-grained link tracking, the pre-specified proxied path can be automatically loaded by the system where the application is located. The pre-specified proxied path here will be passed into the application process of the application in the form of a parameter.

[0058] The project name can be used to distinguish different projects later, for example, it can be used to distinguish different projects when the performance parameters are stored later or when the performance parameters are displayed later. In an embodiment of the present invention, the process of a project may include at least two features, namely, process naming and address naming, wherein the process naming will be named after the project name by default, and of course, custom naming can also be used, and the address naming can be named according to the address name of the computer where the application is located. For example, the "login account" process in an application contains process feature information such as process naming (such as login account process) and the address name of the computer where the application is located (such as IP address 172.17.9.17). In addition, since the Java path is composed of fully qualified class names, and there are multiple underlying classes, the code we usually focus on is the code written by the developer, so it is possible to specify which code paths to scan, that is, to specify key code snippets.

[0059] Since the proxied content is specified in advance, before executing step S106 to scan the proxied content in the application process of the application, the embodiment of the present invention can also set the specified proxied content as the content to be scanned, and can respectively inject a scanning program for scanning into the execution method of each scanned package class corresponding to the scanned content. The scanning program here is an executable program, and the executable program injected into the execution method of the scanned package class can scan the proxied content in the application process, such as scanning the proxied path.

[0060] In this embodiment, some entity classes are insignificant or belong to repetitive cyclic content. On the one hand, the content itself takes very little time, and on the other hand, the information provided by the repetitiveness is not of much value. It is not necessary to monitor all of them. Therefore, the embodiment of the present invention can exclude these contents by setting the scan content to be excluded. In this embodiment, the scan content to be excluded can be the content that does not appear for the first time in the repetitive content. If after scanning a scan content, the same content continues to appear repeatedly in a cycle, the same content is the scan content to be excluded, and there is no need to perform repeated scanning detection. Of course, the scan content to be excluded can also be manually set according to the actual situation, such as manually setting the insignificant content as the scan content to be excluded.

[0061] In one embodiment of the present invention, in the process of executing step S106 to scan the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application running the proxied content-related process based on the scanning results, the proxied content in the application process of the application can be scanned by a scanning program previously injected into the execution method of the scanned package class. Then, based on the scanning results, the performance parameters of each execution method called by the application running the proxied content-related process are counted and recorded. In this embodiment, the performance parameters of the execution method may include at least one of the execution method consumption time, the execution method method name, the execution method parent method name, the entity class to which the execution method belongs, the input parameters, etc.

[0062] The time consumed by the execution method of the embodiment of the present invention can reflect the time required for each execution method to be executed. The method name of the execution method and the parent method name of the execution method can conveniently and clearly reflect the calling relationship between the various execution methods. For example, if execution method a calls execution method b, then execution method a is the parent execution method and has the corresponding parent execution method name.

[0063] Passing in parameters can be used for unit testing to more quickly identify application performance issues. For example, when the parameter "1" is passed in, the application execution logic may be normal, but when another parameter value (such as "2") is passed in, the application may execute other codes due to judgment conditions in the process and fail to execute normal logic. Therefore, passing in parameters can help find application problems more quickly to a certain extent.

[0064] In the embodiment of the present invention, when detecting the time consumed by each execution method called by the proxy content-related process when the application runs based on the scanning result, the time point at which each execution method called by the proxy content-related process when the application runs starts and the time point at which the execution is completed can be detected first. Then, the time difference between the time point at which the execution is completed and the time point at which the execution starts is calculated, so that the time difference is used as the time consumed by the corresponding execution method.

[0065] In this embodiment, when the scanning program scans that the current path is consistent with the proxied path, the code for calculating the time can be inserted into the beginning and end of each execution method of the class, so as to detect the time point when the current execution method starts and the time point when the execution is completed, and then calculate the time difference between the time point when the execution is completed and the time point when the execution starts, so as to calculate the time when the current execution method runs, that is, the time consumed by the current execution method. The calculated time consumed by the execution method can determine whether the performance of the application is better. Generally, the shorter the time consumed by each execution method of the application, the higher the efficiency and the better the performance.

[0066] In an embodiment of the present invention, after detecting the performance parameters of each execution method called by the proxy content-related process when the application is running based on the scanning result, the detected performance parameters of each execution method may also be stored.

[0067] Specifically, the performance parameters of each execution method can be cached in a specified code queue first, and then the cached performance parameters in the specified code queue can be stored in a preset storage object at a specified time interval. The embodiment of the present invention can collect the performance parameters generated by the application calling each execution method, and then cache the collected performance parameters in the specified code queue.

[0068] In this embodiment, the timed storage at a specified time interval refers to the timed polling and storage of the performance parameters cached in the specified code queue. For example, the specified code queue is polled once every 1 minute. If there are cached performance parameters in the specified code queue, the cached performance parameters can be stored in the preset storage object. The specific value of the specified time interval can be set according to actual needs, and the embodiment of the present invention does not make specific limitations. The preset storage object used to store performance parameters in this embodiment can include local files, databases, remote indexes, etc., that is, a variety of storage methods can be used to periodically and regularly store data in the specified code queue.

[0069] The embodiment of the present invention can effectively prevent the performance parameter storage process from affecting the normal performance of the application program by storing the performance parameters cached in the designated code queue in a periodic manner rather than in real time.

[0070] The embodiment of the present invention may include two ways of storing the performance parameters cached in the specified code queue into the preset storage object at specified time intervals.

[0071] The first method is to store the performance parameters cached in the specified code queue in a batch manner in a preset storage object at a specified time interval. For example, all performance parameters cached in the specified code queue can be stored in a preset storage object in a batch and at a specified time. It is also possible to divide all performance parameters cached in the specified code queue into other batches, such as dividing all performance parameters into 2 batches for scheduled storage.

[0072] The second method is to store the performance parameters cached in the specified code queue into the preset storage object at specified time intervals. In this method, no matter how many performance parameters are cached in the specified code queue, the performance parameters in the specified code queue can be stored into the preset storage object in sequence, that is, one performance parameter is stored at a time. Of course, in the process of storing the performance parameters into the preset storage object in sequence, the performance parameters can be stored in sequence in the order in which they are detected.

[0073] The embodiment of the present invention can pre-specify a group of proxied contents for an application. When a group of proxy contents of the application are respectively transmitted to the process of the application in sequence and the performance detection of the application is respectively completed, an end marker can be added to the process, so that the performance detection process of the next application can be started.

[0074] For example, a set of proxied contents pre-set for application A includes A1, A2 and A3. After application A and the proxy program are started synchronously, the proxied content A1 is first passed into the application process of application A, so as to detect and obtain the corresponding performance parameters. Then, application A is restarted, and the proxied content A2 is passed into the application process of application A and the corresponding performance parameters are detected. Then, application A is restarted again, and the proxied content A3 is passed into the application process of application A and the corresponding performance parameters are detected. At this time, there is no proxied content that can be passed into application A, so an end mark is added to the application process. When the end mark is detected, the performance detection process of the next application (such as application B) can be started. By cyclically starting application A and passing in multiple proxy contents in sequence, multiple performance parameter values ​​of the same application can be obtained, so that the optimal performance parameter value can be selected from them.

[0075] To facilitate identification of performance parameters detected for the same application, the same application identifier can also be added to the performance parameters detected for the same application, so that after the detected performance parameters are subsequently cached in the designated code queue, the performance parameters with the same application identifier cached in the designated code queue can be stored in the preset storage object as the same batch. Of course, to facilitate searching for performance parameters of different applications from the storage object, the embodiment of the present invention can also store performance parameters corresponding to different application identifiers in different locations of the preset storage object.

[0076] After the embodiment of the present invention stores the performance parameters cached in the specified code queue in the preset storage object at specified time intervals, the performance parameters in the preset storage object can also be visualized to facilitate technical personnel to understand the performance of the application in a timely manner. The display of performance parameters will be introduced in detail later.

[0077] In order to more clearly embody the scheme of the present invention, now combined with the above embodiment content and Figure 2 , the overall process of application performance testing is introduced.

[0078] First, when the application to be detected is started, the agent Agent pre-configured in the application in the form of parameters is started synchronously.

[0079] Secondly, the agent is used to pass the proxy content into the application process of the application program in the form of parameters. In addition, the scanned content and the scanned content to be excluded are set in the environment variables of the application process, and the scanning program for scanning is injected into the execution method of each scanned package class corresponding to the scanned content.

[0080] The embodiment of the present invention can perform the operation of injecting a scanning program when the agent class agent-class is detected. Since the agent agent uses third-party open source dependencies in the agent process, the system loader can also be used in advance to load the additional jar files that need to be corrected into the application memory.

[0081] Then, after the injection operation is completed, the proxied content in the application process is scanned by a scanning program, and the performance parameters of each execution method called by the application program to run the proxied content-related process are detected based on the scanning results. For example, after the access request accesses the link it passes through, the information of each link node in the current link can be detected based on the scanning results, and the information of each link node corresponds to the performance parameters of each execution method.

[0082] Then, the performance parameters of each execution method are cached to the specified code queue (ie, memory queue) and wait for the scheduled storage task. The scheduled storage task can be triggered synchronously when the application is started, and the storage task is executed once every specified time interval.

[0083] Furthermore, when the scheduled storage task is executed, the performance parameters of each execution method in the designated code queue are stored in batches or sequentially into a preset storage object.

[0084] Finally, the performance parameters of the execution method stored in the preset storage object are displayed in the form of a link on the visual display interface.

[0085] By making the detection of application performance parameters specific to each execution method of the application, the performance of the application can be detected in a more fine-grained manner, thereby achieving fine-grained link tracking of the application performance parameters.

[0086] In one embodiment of the present invention, for a single request or access of an application, the time consumption of each execution method called during the single request or access process may be summed to obtain the time consumption of the single request or access, and the time consumption of different requests or accesses and the corresponding request or access time points may be displayed in the form of a line graph, such as Figure 3 As shown in the figure, each broken line node represents a single request or access node, the vertical axis represents the time taken for the request or access, and the horizontal axis represents the time point when the request or access occurs. By clicking on any node, you can enter the link diagram of the execution method corresponding to the corresponding node.

[0087] This embodiment can also display a filter box for the execution method on the visual display interface. By selecting the type of the execution method in the filter box, the corresponding execution method to be displayed can be filtered out. Figure 3 The "all" displayed in the filter box indicates that all execution methods are displayed. In addition, the address locations of different applications can be displayed in the blank space of the line chart display interface, such as the IP address of the computing device where the different applications are located (such as 172.17.9.17). In addition, different items of different applications can be displayed on the display interface to select the items to be monitored and detected, such as Figure 3 The project content is displayed on the left side of the line chart.

[0088] Furthermore, the embodiment of the present invention can also display the method name, execution time, and time-consuming time of the specific execution method currently called by the application on the visual display interface to clearly understand the relevant information of the current execution method.

[0089] In the link diagram of the execution method, the performance parameters of each execution method can be used as the node information of the link, that is, the performance parameters are used as the basic information of the link. Figure 4 , the link diagram of the embodiment of the present invention is presented in the form of a tree structure, and the lines between the nodes represent the mutual calling relationship between the nodes. The execution method named HomeSearchController has no parent execution method to be called, so the execution method HomeSearchController is an entry method and also an exit method. In addition, the execution method HomeSearchController is also the parent execution method of HomeSearchBussinesslmpl. Of course, a method of the HomeSearchBussinesslmpl class can also be used as a parent execution method to call different execution methods connected to it, such as the execution method Message. <init>0V, execute the method Message.push Message, and execute the method HomeSearchVoSHome, etc.

[0090] The link diagram of the embodiment of the present invention also shows the time consumed by each execution method, such as the execution time of the HomeSearchController method is 281ms, and the execution time of the Message method is 281ms. <init>The 0V consumption time is 1ms, etc. The performance parameters of each execution method are displayed visually in the form of links, achieving a more fine-grained link tracking effect on the performance of the application.

[0091] Based on the same inventive concept, an embodiment of the present invention further provides a performance detection system for an application program. Figure 5 FIG. 4 is a schematic diagram showing a structure of a performance detection system for an application according to an embodiment of the present invention. Figure 5 The application performance detection system includes a startup module 510, an agent module 520 and a detection module 530.

[0092] The start module 510 is adapted to synchronously start an agent program pre-configured in the application program in the form of parameters in response to a start operation of the application program to be detected.

[0093] The proxy module 520 is adapted to use the activated proxy program to transfer the proxied content into the application process of the application program in the form of parameters.

[0094] The detection module 530 is adapted to scan the proxied content in the application process of the application, and detect the performance parameters of each execution method called by the application to run the process related to the proxied content based on the scanning result.

[0095] The embodiment of the present invention configures the proxy program in the application program in advance in the form of parameters, so that the proxy program can be started synchronously when the application to be detected is started, without adding startup parameters to the application program again to start the proxy program, thereby avoiding the problem of application startup failure or execution failure caused by errors in adding startup parameters. In addition, the embodiment of the present invention can detect the performance parameters of each execution method in the process related to the proxied content, that is, the detection of application performance parameters is specific to each execution method, so that the performance of the application can be detected in a more fine-grained manner.

[0096] In one embodiment of the present invention, the proxied content includes at least one of a proxied path, a project name, and a key code snippet.

[0097] See also Figure 6 In one embodiment of the present invention, the application performance detection system includes not only the modules of the above embodiments, but also a setting module 540.

[0098] The setting module 540 is suitable for setting the proxied content as the scanned content before the detection module 530 scans the proxied content in the application process of the application program, and injecting the scanning program for scanning into the execution method of each scanned package class corresponding to the scanned content; setting the scanning content to be excluded, wherein the scanning content to be excluded includes the content that does not appear for the first time in the repetitive content or the scanning content to be excluded that is manually set.

[0099] In one embodiment of the present invention, the detection module 530 is also suitable for scanning the proxied content in the application process of the application by injecting a scanning program into the execution method of the scanned package class; based on the scanning results, the performance parameters of each execution method called by the application to run the process related to the proxied content are counted and recorded.

[0100] In one embodiment of the present invention, the performance parameters of the execution method include at least one of the time consumed by the execution method, the method name of the execution method, the parent method name of the execution method, the entity class to which the execution method belongs, and the input parameters.

[0101] In one embodiment of the present invention, the detection module 530 is also suitable for, if the performance parameters of the execution method include the time consumed by the execution method, detecting the time points at which each execution method called in the process related to the proxy content runs and the time points at which the execution starts and ends; calculating the time difference between the time point at which the execution ends and the time point at which the execution starts, and using the time difference as the consumed time of the corresponding execution method.

[0102] See also Figure 7 In one embodiment of the present invention, the application performance detection system includes not only the modules of the above embodiments, but also a storage module 550.

[0103] The storage module 550 is suitable for caching the performance parameters of each execution method into a designated code queue after the detection module 530 detects the performance parameters of each execution method called by the proxy content-related process when the application is running based on the scanning results; and storing the cached performance parameters in the designated code queue into a preset storage object at specified time intervals.

[0104] In one embodiment of the present invention, the storage module 550 is suitable for storing the performance parameters cached in the specified code queue in a preset storage object in batches at specified time intervals; or storing the performance parameters cached in the specified code queue in sequence at specified time intervals in a preset storage object.

[0105] See also Figure 8 In one embodiment of the present invention, the application performance detection system includes not only the modules of the above embodiments, but also a display module 560.

[0106] The display module 560 is suitable for visually displaying the performance parameters of each execution method stored in a preset storage object in the form of a link after the detection module 530 detects the performance parameters of each execution method called by the proxy content-related process when the application is running based on the scanning results; wherein the performance parameters of the execution method serve as the node information of the link.

[0107] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium storing computer program code. When the computer program code runs on a computing device, the computing device executes the performance detection method of the application program of any of the above embodiments.

[0108] Based on the same inventive concept, an embodiment of the present invention further provides a computing device, comprising: a processor; a memory storing computer program code; and a performance detection method for an application program of any of the above embodiments, which causes the computing device to execute the computer program code when the processor executes the computer program code.

[0109] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.

[0110] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.

[0111] Those skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions to enable a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.

[0112] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the methods described in the embodiments of the present invention.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.< / init> < / init>

Claims

1. A performance detection method for an application, characterized in that: include: In response to a startup operation of the application to be detected, synchronously starting an agent program pre-configured in the application in the form of parameters; Using the started proxy program to pass the proxied content into the application process of the application program in the form of parameters, the proxied content including at least one of a proxied path, a project name, and a key code snippet; Scan the proxied content in the application process of the application, and detect the performance parameters of each execution method called by the application when running the process related to the proxied content based on the scanning result; wherein, before scanning the proxied content in the application process of the application, it also includes: setting the proxied content as the scanned content, and injecting a scanning program for scanning in the execution method of each scanned package class corresponding to the scanned content; setting the scan content to be excluded, wherein the scan content to be excluded includes the content that does not appear for the first time in the repetitive content or the scan content to be excluded that is manually set; wherein, scanning the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application when running the process related to the proxied content based on the scanning result, includes: scanning the proxied content in the application process of the application by injecting the scanning program in the execution method of the scanned package class; and counting and recording the performance parameters of each execution method called by the application when running the process related to the proxied content based on the scanning result.

2. The method according to claim 1, characterized in that The performance parameters of the execution method include: At least one of the following: the time consumed by the execution method, the name of the execution method, the name of the parent method of the execution method, the entity class to which the execution method belongs, and the input parameters.

3. The method according to claim 2, characterized in that If the performance parameter of the execution method includes the time taken to execute the method, detecting the performance parameters of each execution method called by the proxy content-related process when the application runs the proxy content-related process based on the scanning result includes: Detecting the time points at which each execution method called in the process related to the proxied content is started and completed when the application runs the proxied content; The time difference between the execution completion time and the execution start time is calculated, and the time difference is used as the consumption time of the corresponding execution method.

4. The method according to claim 1, characterized in that After detecting the performance parameters of each execution method called by the proxy content-related process when the application runs the application based on the scanning result, the method further includes: Cache the performance parameters of each execution method to the specified code queue; The performance parameters cached in the designated code queue are stored in a preset storage object at designated time intervals.

5. The method according to claim 4, characterized in that The performance parameters cached in the specified code queue are stored in a preset storage object at specified time intervals, including: The performance parameters cached in the specified code queue are stored in a preset storage object in batches at specified time intervals; or The performance parameters cached in the designated code queue are sequentially and regularly stored in a preset storage object at designated time intervals.

6. The method according to claim 4 or 5, characterized in that: After the performance parameters cached in the designated code queue are stored in a preset storage object at designated time intervals, the method further includes: Visually displaying the performance parameters of each execution method stored in the preset storage object in the form of a link; The performance parameters of the execution method are used as the node information of the link.

7. A performance detection system for an application, characterized in that: include: A startup module, adapted to synchronously start an agent program pre-configured in the application program in the form of parameters in response to a startup operation of the application program to be detected; A proxy module, adapted to use a started proxy program to pass the proxied content into the application process of the application program in the form of parameters, wherein the proxied content includes at least one of a proxied path, a project name, and a key code snippet; A detection module is suitable for scanning the proxied content in the application process of the application, and detecting the performance parameters of each execution method called by the application to run the process related to the proxied content based on the scanning results; wherein the performance detection system also includes: a setting module, suitable for setting the proxied content as the scanned content, and injecting a scanning program for scanning into the execution method of each scanned package class corresponding to the scanned content; setting the scan content to be excluded, wherein the scan content to be excluded includes the content that does not appear for the first time in the repetitive content or the scan content to be excluded that is manually set; wherein the detection module is also suitable for scanning the proxied content in the application process of the application by injecting the scanning program into the execution method of the scanned package class; and based on the scanning results, respectively counting and recording the performance parameters of each execution method called by the application to run the process related to the proxied content.

8. A computer storage medium storing a computer program code, which, when executed on a computing device, causes the computing device to execute the performance detection method for an application program according to any one of claims 1 to 6.

9. A computing device comprising: processor; a memory storing computer program code; When the computer program code is executed by the processor, the computing device is caused to execute the performance detection method of the application program according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Software system performance problem locating method and device

    CN107656849A