Method, device, equipment and program product for performance monitoring of an application
Through bytecode enhancement technology and monitoring field classification, the problems of low efficiency and high risk of application performance monitoring in the existing technology are solved, and efficient performance information collection at the business level is achieved.
Patent Information
- Application Number
- CN202210070678.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-01-21
AI Technical Summary
In the prior art, application performance monitoring methods are inefficient and risky, and cannot achieve business-level monitoring. Points need to be buried in the code and re-only launched to adapt to business changes.
Through bytecode enhancement technology, the performance information of the application's monitoring method is obtained, and the performance information is classified according to the monitoring field to achieve business-level performance monitoring.
It realizes the collection of business-level performance information of the application, improves monitoring efficiency, and reduces the risk of code transformation and errors.
Smart Images

Figure CN114416486B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, apparatus, device, and program product for monitoring the performance of an application program. Background Art
[0002] During the running of an application program, it is necessary to monitor the performance issues of different execution methods in the application program, such as average execution time, failure rate, access volume, and so on.
[0003] In the prior art, the bytecode enhancement technology is usually used to monitor each method in the application program.
[0004] This method can only monitor a certain method or a certain interface in the application program. This monitoring method is a pure technical monitoring. If business-level monitoring is required, code instrumentation needs to be performed in the code, and the instrumented data needs to be collected, statistically analyzed separately. Once the business changes, the code needs to be modified and redeployed to take effect. Therefore, this monitoring method has the problems of low efficiency and high risk. Summary of the Invention
[0005] Embodiments of the present disclosure provide a method, apparatus, device, and program product for monitoring the performance of an application program, so as to solve the problems of low efficiency and high risk in the prior art for monitoring an application program.
[0006] In a first aspect, embodiments of the present disclosure provide a method for monitoring the performance of an application program, including:
[0007] Obtaining preset monitoring information, and performing bytecode enhancement processing on the monitoring methods in the application program according to the monitoring information, wherein the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method;
[0008] Obtaining the performance information of the monitoring method according to the enhanced monitoring method, and determining monitoring fields in the enhanced monitoring method according to the monitoring information;
[0009] Classifying the performance information according to the monitoring fields to obtain the classified performance information of the monitoring method.
[0010] In a second aspect, embodiments of the present disclosure provide an apparatus for monitoring the performance of an application program, including:
[0011] A method determination unit, configured to obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring methods in the application program according to the monitoring information, wherein the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method;
[0012] A monitoring unit, configured to obtain performance information of the monitoring method according to the enhanced monitoring method;
[0013] A field determination unit, configured to determine monitoring fields in the enhanced monitoring method according to the monitoring information;
[0014] A classification unit, configured to classify the performance information according to the monitoring fields to obtain classified performance information of the monitoring method.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a memory;
[0016] A processor; and
[0017] A computer program;
[0018] wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect.
[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the performance monitoring method of the application program as described in the first aspect.
[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the performance monitoring method of the application program as described in the first aspect.
[0021] The performance monitoring method, device, equipment, and program product of the application program provided by the present disclosure can classify the obtained performance information according to the monitoring fields, and the monitoring fields are related to the business. Therefore, in this way, the performance information at the business level of the application program can be collected. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.
[0023] Figure 1 It is a schematic flowchart of the performance monitoring method of the application program shown in an exemplary embodiment of the present disclosure;
[0024] Figure 2 It is a schematic flowchart of the performance monitoring method of the application program shown in an exemplary embodiment of the present disclosure;
[0025] Figure 3 It is a schematic diagram of the performance monitoring process of the application program shown in an exemplary embodiment of the present disclosure;
[0026] Figure 4 Schematic diagram of the structure of a performance monitoring device for an application shown in an exemplary embodiment of the present disclosure;
[0027] Figure 5 Schematic diagram of the structure of a performance monitoring device for an application shown in another exemplary embodiment of the present disclosure;
[0028] Figure 6 It is a block diagram of an electronic device shown according to an exemplary embodiment.
[0029] Through the above-mentioned drawings, specific embodiments of the present disclosure have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0030] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0031] During the running of an application, the performance of the application can be monitored, and then the data for optimizing the application can be provided. For example, bytecode enhancement technology can be adopted to monitor each method in the application to determine the average time consumption, failure rate, access volume, etc. of each method.
[0032] However, this solution is only a technical-level monitoring and cannot obtain business-level monitoring data. For example, multiple services will call the same interface. By means of bytecode enhancement, only the performance data of the interface at the technical level can be determined, and the performance data when different services call the interface cannot be obtained.
[0033] In the prior art, if it is desired to obtain the performance data of an application at the business level, it is necessary to insert code snippets and separately collect and count the data of the code snippets. However, in this implementation manner, once the business changes, the code needs to be modified and then redeployed in order to continue collecting the performance data at the business level.
[0034] This monitoring method requires inserting code snippets in the code, and when the business changes, it is necessary to re-insert code snippets and redeploy, which is less efficient, and inserting code snippets in the code will increase the risk of code errors.
[0035] To solve the above technical problems, the solution provided by the present disclosure classifies the performance information of the method collected through the fields in each method. The services corresponding to different fields may be different. Therefore, the performance information collected can be classified through the fields belonging to the same service, so as to obtain the classified performance information associated with the service.
[0036] Figure 1 It is a schematic flowchart of a method for monitoring the performance of an application program shown in an exemplary embodiment of the present disclosure.
[0037] The method for monitoring the performance of an application program provided by the present disclosure includes:
[0038] Step 101, obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring methods in the application program according to the monitoring information. Among them, the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method.
[0039] The method provided by the present disclosure can be executed by an electronic device with computing capabilities, such as a server. An application program is set in the server, and the performance of the application program can be monitored through the method provided by the present disclosure.
[0040] In an alternative implementation, the application program can be written in the Java language, and bytecode enhancement processing can be performed on the application program, and then the performance of the application program can be monitored based on bytecode addition technology.
[0041] Bytecode enhancement technology refers to using Java agents and ASM bytecode technology. When the JVM loads the class binary file of the application program, the loaded class file is dynamically modified by ASM, and monitors are added before and after the monitored method to monitor the time consumption, internal calls, etc. of the monitored method.
[0042] In the method provided by the present disclosure, monitoring information can be preset, and the monitoring information includes information about the methods to be monitored. For example, the first application program includes methods A, B, and C, and the user can preset the monitoring information according to needs, such as setting that methods A and C need to be monitored.
[0043] In an alternative implementation, a monitoring platform can be set up, and the user can set the monitoring information in the monitoring platform.
[0044] When the application program is running, the monitoring information of the application program can be obtained, so as to determine the monitoring methods in the application program, that is, which methods in the application program need to be monitored. For example, when the first application program is running, the monitoring information of the first application program can be obtained, and then it can be determined that the monitoring methods of the first application program are methods A and C.
[0045] Among them, when the application program is running, bytecode enhancement processing can be performed on the monitoring methods in the application program, and then the performance information of the monitoring methods can be obtained through the enhanced bytecode. Specifically, the bytecode enhancement processing of the monitoring methods can be carried out in the manner of the existing technology.
[0046] Step 102: Obtain the performance information of the monitoring method according to the enhanced monitoring method, and determine the monitoring fields in the enhanced monitoring method according to the monitoring information.
[0047] Specifically, the performance information of the monitoring method can be obtained by using the enhanced monitoring method. For example, after method A is enhanced, the enhanced method A can be used to obtain the performance information of method A. After method B is enhanced, the enhanced method B can be used to obtain the performance information of method B.
[0048] Furthermore, the obtained performance information may include the call count of the monitoring method, and may also include information such as the time consumption of the monitoring method. For example, the time consumption when method A is called this time, and for another example, the call count of method A.
[0049] In actual application, the monitoring information may also include monitoring fields, and the monitoring fields can be configured by the user according to needs. After the user sets the monitoring method, the monitoring fields corresponding to the monitoring method can be set, specifically referring to which fields in the monitoring method need to be monitored. For example, the user can set that method A needs to be monitored, and can also set that the monitoring fields a1 and a2 in method A need to be monitored.
[0050] Among them, when monitoring the application program, the monitoring methods of the application program and the monitoring fields corresponding to each monitoring method can be obtained, and then the performance information of the application program can be classified based on the monitoring fields.
[0051] Step 103: Classify the performance information according to the monitoring fields to obtain the classified performance information of the monitoring method.
[0052] Specifically, obtaining the performance information of the monitoring method according to the enhanced monitoring method is the overall performance information of the monitoring method. For example, the time consumption each time the method is called, and for another example, the specific information when the method is called. The performance information obtained in this way is technical data and cannot be associated with the business.
[0053] Furthermore, in the method provided by the present disclosure, the performance information of the monitoring method can be classified according to the monitoring fields of the monitoring method, and then the classified performance information can be obtained. Since the monitoring fields are related to the business, the classified performance information at the business level of the application program can be obtained in this way.
[0054] In actual application, the performance information corresponding to each monitoring field can be extracted from the obtained performance information, and then the performance information can be classified. For example, the monitoring fields of monitoring method A include a1 and a2, where a1 is the input parameter of method A and a2 is the output parameter of method A. Then, the performance information of method A called when the input parameter is a1 can be used as the classified performance information corresponding to a1. The performance information of method A called when the output parameter is a2 can be used as the classified performance information corresponding to a2. For example, when the output parameter is a2, the time taken to execute the monitoring method, or the number of calls, etc.
[0055] For example, there is a monitoring method, and the fields that can call this monitoring method include name and age. Then, the classified performance information of the monitoring method called by the field name and the classified performance information of the monitoring method called by the field age can be obtained through the method provided in this disclosure.
[0056] Among them, the server can also send the classified performance information to the user terminal for the user to analyze the performance of the application. For example, the user terminal can send a request to obtain monitoring data to the server, and this request can include monitoring fields. The server can send the classified performance information corresponding to this monitoring field to the user terminal. In another way, the request sent by the user terminal can include service information. The server can determine the corresponding monitoring fields according to the service information and send the classified performance information corresponding to each monitoring field to the user terminal.
[0057] The performance monitoring method of the application provided in this disclosure includes: obtaining preset monitoring information, performing bytecode enhancement processing on the monitoring methods in the application according to the monitoring information, where the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method; obtaining the performance information of the monitoring method according to the enhanced monitoring method, and determining the monitoring fields in the enhanced monitoring method according to the monitoring information; classifying the performance information according to the monitoring fields to obtain the classified performance information of the monitoring method. The method provided in this disclosure can classify the obtained performance information according to the monitoring fields, and the monitoring fields are associated with the business. Therefore, in this way, the performance information at the business level of the application can be collected.
[0058] Figure 2 It is a schematic flowchart of the performance monitoring method of the application shown in an exemplary embodiment of this disclosure.
[0059] As Figure 2 shown, the performance monitoring method of the application provided in this disclosure includes:
[0060] Step 201, receiving a method configuration instruction for configuring the method to be monitored, where the method configuration instruction includes information about the monitoring method, and storing the information about the monitoring method.
[0061] Among them, the server can also receive method configuration instructions. For example, a performance monitoring platform can be set up, and users can set the monitoring methods of application programs in the performance monitoring platform.
[0062] Specifically, a performance monitoring platform can be set up in both the user terminal and the server. Users can configure monitoring methods in the performance monitoring platform of the user terminal. For example, they can input the names of Method A and Method C of the first application program. The server can receive this information through the performance monitoring platform and then determine the methods to be monitored.
[0063] Users can input information about the monitoring method in the user terminal, and the user terminal can send a method configuration instruction to the server, so that the server can receive the information about the monitoring method.
[0064] Furthermore, the server can also store information about the monitoring method, such as information about the application program to which the monitoring method belongs, and information about the monitoring method, such as the name of the monitoring method.
[0065] Step 202: Receive a field configuration instruction for configuring the monitoring fields in the monitoring method, and store the information about the monitoring fields.
[0066] In actual application, after the user configures the monitoring method through the user terminal, they can also configure specific monitoring fields. For example, after the user inputs the information of Monitoring Method A, they can also input which fields in Monitoring Method A need to be monitored, such as fields a1, a2, etc.
[0067] Among them, the user terminal can send a field configuration instruction to the server, so that the server can receive the field configuration instruction and thus determine which fields need to be monitored.
[0068] Specifically, the user can also set the information about the monitoring fields in the performance monitoring platform of the user terminal, so that the server can obtain the field configuration instruction through the performance monitoring platform.
[0069] Furthermore, the server can also store the information about the monitoring fields, such as storing the information about fields a1 and a2 that need to be monitored in Monitoring Method A.
[0070] Step 203: Obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring methods in the application program according to the monitoring information. Among them, the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method.
[0071] The implementation method of Step 203 is similar to that of Step 101 and will not be elaborated here.
[0072] Step 204: Obtain the performance information of the monitoring method according to the enhanced monitoring method.
[0073] The method of obtaining performance information in step 204 and step 102 will not be elaborated here.
[0074] Step 205: Obtain the field monitoring information included in the monitoring information, and determine the monitoring field type according to the type identifier in the field monitoring information.
[0075] Among them, the monitoring information may further include field monitoring information, which is used to characterize which fields in the monitoring method need to be monitored. For example, field a1 in method A needs to be monitored.
[0076] Specifically, the field monitoring information can be characterized by an identifier. For example, a type identifier can be set to indicate the type of the field to be monitored. The field type can specifically include the input parameter type and the output parameter type. The input parameter refers to the parameter input to the monitoring method, and the output parameter refers to the parameter output after the monitoring method processes the input parameter.
[0077] Furthermore, if the type of the monitoring field is the input parameter type, the electronic device can determine the parameter to be monitored in the input parameter of the monitoring method. If the type of the monitoring field is the output parameter type, the electronic device can determine the parameter to be monitored in the output parameter of the monitoring method.
[0078] Among them, the field monitoring information can be in the structure of "type identifier / specified information", then the electronic device can obtain the type identifier therein, and further determine whether the field to be monitored is an input parameter or an output parameter.
[0079] In practical applications, the field monitoring information may include a type identifier. If the type identifier is the first identifier, it is determined that the type of the monitoring field is an input parameter; if the type identifier is the second identifier, it is determined that the type of the monitoring field is an output parameter.
[0080] In an alternative implementation manner, for example, the first identifier can be a number, and the second identifier can be @.
[0081] Among them, the specified information may include multiple specific pieces of information, such as xxx / yyy, which is used to characterize that the field to be monitored is the yyy parameter in the object xxx. The hierarchy where the monitoring field is located can be characterized by / . In this implementation manner, even if the field to be monitored is nested in other parameters, the performance information of the monitoring method can be classified through this field.
[0082] Step 206: Obtain the specified information in the field monitoring information, and determine the monitoring field according to the specified information and the monitoring field type.
[0083] In practical applications, the monitoring information may further include specified information, which is used to specify the field to be monitored in the output parameter or the input parameter.
[0084] Among them, if the monitoring field type is the output parameter type, the electronic device can determine the monitoring field in the output parameter according to the specified information. If the monitoring field type is the input parameter type, the electronic device can determine the monitoring field in the input parameter according to the specified information.
[0085] Specifically, if the monitoring field type is an input parameter, the electronic device can determine the monitoring field in the input parameter field according to the specified information; if the monitoring field type is an output parameter, the electronic device can determine the monitoring field in the output parameter field according to the specified information; among them, the specified information includes one or more of the following information: field sequence number, field type, and field name.
[0086] Further, for example, if the type of the monitoring field is an input parameter and the specified information is 1, it indicates that the monitoring field is the first field of the input parameter. For another example, if the type of the monitoring field is an output parameter and the specified information is the field name name, it indicates that the monitoring field is the name field in the output parameter. For another example, if the type of the monitoring field is an input parameter and the specified information is the field type string, it indicates that the monitoring field is the field of type string in the input parameter.
[0087] Through this implementation method, the monitoring field can be set from multiple perspectives such as field order, field name, and field type, and the needs of users to obtain monitoring information at the service level from multiple perspectives can be met.
[0088] Step 207, determine the target performance information corresponding to the monitoring field in the performance information of the monitoring method.
[0089] In actual application, after determining the monitoring method and the monitoring field of the monitoring method, the performance information of the monitoring method can be classified according to the monitoring field.
[0090] Among them, the target performance information corresponding to the monitoring field can be determined in the performance information. For example, if the monitoring field includes the field a1, the target performance information associated with a1 can be determined in the performance information.
[0091] Specifically, if the monitoring field is an input parameter field, obtain the performance information when the monitoring field is used as an input parameter to execute the monitoring method.
[0092] If the monitoring field is an output parameter field, obtain the performance information when the monitoring method outputs the monitoring field.
[0093] For example, if the monitoring field is the input parameter a1, the performance information collected when the input parameter is a1 can be determined in the performance information and determined as the target performance information corresponding to the input parameter a1. For another example, if the monitoring field is the output parameter a2, the performance information collected when the output parameter is a2 can be determined in the performance information and determined as the target performance information corresponding to the output parameter a2.
[0094] In this way, the target performance information corresponding to each monitoring field can be collected.
[0095] Step 208: Determine the classification performance information corresponding to the monitoring field according to the target performance information.
[0096] Specifically, for each monitoring field, multiple pieces of target performance information corresponding thereto can be determined. Therefore, the classification performance information corresponding to the monitoring field can be determined according to each piece of target performance information corresponding to the monitoring field.
[0097] The call count of the monitoring method corresponding to the monitoring field can be determined according to the collected target performance information corresponding to the monitoring field. For example, the call count of monitoring method A when the input parameter is a1. Additionally, for example, the average execution time of monitoring method A when the input parameter is a1 can be determined according to the execution time of monitoring method A each time when the input parameter is a1.
[0098] In this way, the classification performance information corresponding to the monitoring field can be determined, and then, based on the relationship between the monitoring field and the service, the performance information at the service level can be determined.
[0099] Step 209: Receive a request for obtaining classification performance information, where the request includes a monitoring method and a monitoring field.
[0100] Among them, the user can also operate the user terminal, so as to send a request for obtaining classification performance information to the server through the user terminal. For example, the user can select a monitoring method and a monitoring field on the user terminal, so that the user terminal sends a request including the monitoring method and the monitoring field to the server.
[0101] Step 210: Obtain and feedback the classification performance information corresponding to the monitoring method and the monitoring field according to the monitoring method and the monitoring field in the request.
[0102] Specifically, after the server receives a request including a monitoring method and a monitoring field, it can determine the corresponding classification performance information according to the monitoring method and the monitoring field in the request. For example, if the monitoring method is A and the monitoring field is a1, the server can obtain the classification performance information of field a1 of monitoring method A and feedback it to the user terminal.
[0103] In this way, the user can obtain the required classification performance information from the server according to the needs, and these classification performance information are associated with the monitoring field. Therefore, in this way, the server can provide more refined performance information for the application program, specifically, it can provide the performance information corresponding to the monitoring field.
[0104] Figure 3Schematic diagram of the performance monitoring process of an application program shown in an exemplary embodiment of the present disclosure.
[0105] As Figure 3 shown, in the solution provided by the present disclosure, the user terminal 31 can send a configuration instruction to the server 32. The configuration instruction can specifically include a method configuration instruction and a field configuration instruction. The server 32 can determine the monitoring method to be monitored and the monitoring field to be monitored according to the configuration instruction.
[0106] The server 32 can monitor the application program according to the received configuration instruction. Specifically, it can collect the performance information of the monitoring method, and can also classify the performance information of each monitored method collected according to the monitoring field, thereby obtaining classified performance information.
[0107] The user can also operate the user terminal 31 to send a request for obtaining classified performance information to the server 32. The server 32 can obtain the corresponding classified performance information according to this request and feedback the classified performance information to the user terminal 31.
[0108] Figure 4 Schematic diagram of the structure of a performance monitoring device for an application program shown in an exemplary embodiment of the present disclosure.
[0109] As Figure 4 shown, the performance monitoring device 400 for an application program provided by the present disclosure includes:
[0110] A method determination unit 410, configured to obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring methods in the application program according to the monitoring information, wherein the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method;
[0111] A monitoring unit 420, configured to obtain the performance information of the monitoring method according to the enhanced monitoring method;
[0112] A field determination unit 430, configured to determine monitoring fields in the enhanced monitoring method according to the monitoring information;
[0113] A classification unit 440, configured to classify the performance information according to the monitoring fields to obtain the classified performance information of the monitoring method.
[0114] The performance monitoring device for an application program provided by the present disclosure can classify the obtained performance information according to the monitoring fields, and the monitoring fields are related to the business. Therefore, in this way, the performance information at the business level of the application program can be collected.
[0115] Figure 5Schematic diagram of the structure of the performance monitoring device for an application shown in another exemplary embodiment of the present disclosure.
[0116] As Figure 5 shown, in the performance monitoring device 500 for an application provided by the present disclosure, the field determination unit 430 includes:
[0117] The type determination module 431 is configured to obtain the field monitoring information included in the monitoring information, and determine the monitoring field type according to the type identifier in the field monitoring information;
[0118] The field determination module 432 is configured to obtain the specified information in the field monitoring information, and determine the monitoring field according to the specified information and the monitoring field type.
[0119] In an alternative embodiment, the type determination module 431 is specifically configured to:
[0120] If the type identifier is the first identifier, determine that the type of the monitoring field is the input parameter;
[0121] If the type identifier is the second identifier, determine that the type of the monitoring field is the output parameter.
[0122] In an alternative embodiment, the field determination module 432 is specifically configured to, if the monitoring field type is the input parameter, determine the monitoring field from the input parameter fields according to the specified information;
[0123] If the monitoring field type is the output parameter, determine the monitoring field from the output parameter fields according to the specified information;
[0124] Wherein, the specified information includes one or more of the following information: field serial number, field type, field name.
[0125] In an alternative embodiment, the classification unit 440 includes:
[0126] The information determination module 441 is configured to determine the target performance information corresponding to the monitoring field in the performance information of the monitoring method;
[0127] The classification information determination module 442 is configured to determine the classification performance information corresponding to the monitoring field according to the target performance information.
[0128] In an alternative embodiment, the information determination module 441 is specifically configured to:
[0129] If the monitoring field is an input parameter field, obtain the performance information when the monitoring field is used as an input parameter to execute the monitoring method;
[0130] If the monitored field is an output parameter field, obtain the performance information when the monitoring method outputs the monitored field.
[0131] Optionally, the apparatus further includes a configuration unit 450, configured to:
[0132] Receive a request for obtaining classification performance information, where the request includes a monitoring method and a monitored field;
[0133] Obtain and feedback the classification performance information corresponding to the monitoring method and the monitored field according to the monitoring method and the monitored field in the request.
[0134] Optionally, the monitoring information includes information on the monitoring method and information on the monitored field; the apparatus further includes a feedback unit 460, configured to:
[0135] Receive a method configuration instruction for configuring a method to be monitored, where the method configuration instruction includes information on the monitoring method, and store the information on the monitoring method;
[0136] Receive a field configuration instruction for configuring the monitored field in the monitoring method, and store the information on the monitored field.
[0137] In an optional embodiment of the present disclosure, there is also provided an electronic device, including:
[0138] A memory;
[0139] A processor; and
[0140] A computer program;
[0141] Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement any one of the performance monitoring methods of the application program as described above.
[0142] In an optional embodiment of the present disclosure, there is also provided a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement any one of the performance monitoring methods of the application program as described above.
[0143] In an optional embodiment of the present disclosure, there is also provided a computer program product, including a computer program, where the computer program implements any one of the performance monitoring methods of the application program as described above when executed by a processor.
[0144] Figure 6 It is a block diagram of an electronic device shown according to an exemplary embodiment, and the device may be a computer or the like.
[0145] Device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0146] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0147] The memory 604 is configured to store various types of data to support the operation of the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0148] The power component 606 provides power to the various components of the device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.
[0149] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may not only sense the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations.
[0150] The I / O interface 612 provides an interface between the processing component 602 and a peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
[0151] The sensor assembly 614 includes one or more sensors for providing a status assessment of various aspects of the device 600. For example, the sensor assembly 614 can detect the on / off state of the device 600, the relative positioning of components, such as the display and keypad of the device 600. The sensor assembly 614 can also detect a change in the position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600, and the temperature change of the device 600. The sensor assembly 614 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 614 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0152] The communication component 616 is configured to facilitate communication between the device 600 and other devices in a wired or wireless manner. The device 600 can access a wireless network based on communication standards, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0153] In an exemplary embodiment, the device 600 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method.
[0154] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the above instructions can be executed by a processor 620 of the device 600 to complete the above-described method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0155] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to execute the performance monitoring method of the application program of the terminal device.
[0156] Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common general knowledge or conventional technical means in the technical field not disclosed herein. The specification and examples are only illustrative, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0157] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A method for monitoring the performance of an application, characterized in that Including: Obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring method in the application program according to the monitoring information, wherein the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method; Obtain the performance information of the monitoring method according to the enhanced monitoring method, and obtain the field monitoring information included in the monitoring information, and determine the monitoring field type according to the type identifier in the field monitoring information; Obtain the specified information in the field monitoring information, and determine the monitoring field according to the specified information and the monitoring field type; If the monitoring field is an input parameter field, obtain the target performance information when the monitoring field is used as an input parameter to execute the monitoring method; If the monitoring field is an output parameter field, obtain the target performance information when the monitoring method outputs the monitoring field; Determine the classification performance information corresponding to the monitoring field according to the target performance information.
2. The method according to claim 1, characterized in that, The determining the monitoring field type according to the type identifier in the field monitoring information includes: If the type identifier is the first identifier, determine that the type of the monitoring field is an input parameter; If the type identifier is the second identifier, determine that the type of the monitoring field is an output parameter.
3. The method according to claim 1, wherein The determining the monitoring field according to the specified information and the monitoring field type includes: If the monitoring field type is an input parameter, determine the monitoring field in the input parameter field according to the specified information; If the monitoring field type is an output parameter, determine the monitoring field in the output parameter field according to the specified information; Wherein, the specified information includes one or more of the following information: field serial number, field type, field name.
4. The method according to any one of claims 1 to 3, characterized in that, Also including: Receive a request for obtaining classification performance information, where the request includes a monitoring method and a monitoring field; Obtain and feedback the classification performance information corresponding to the monitoring method and the monitoring field according to the monitoring method and the monitoring field in the request.
5. The method according to any one of claims 1 to 3, characterized in that The monitoring information includes information on the monitoring method and information on the monitoring field; the method also includes: Receive a method configuration instruction for configuring the monitoring method to be monitored, where the method configuration instruction includes information on the monitoring method, and store the information on the monitoring method; Receive a field configuration instruction for configuring the monitoring field in the monitoring method, and store the information on the monitoring field.
6. A performance monitoring device for an application, characterized in that, Including: A method determination unit, configured to obtain preset monitoring information, and perform bytecode enhancement processing on the monitoring method in the application program according to the monitoring information, wherein the bytecode in the enhanced monitoring method is used to obtain the performance information of the monitoring method; A monitoring unit, configured to obtain the performance information of the monitoring method according to the enhanced monitoring method; A field determination unit, configured to obtain the field monitoring information included in the monitoring information, determine the monitoring field type according to the type identifier in the field monitoring information; obtain the specified information in the field monitoring information, and determine the monitoring field according to the specified information and the monitoring field type; A classification unit is configured to, if the monitored field is an input parameter field, obtain the target performance information when using the monitored field as an input parameter to execute the monitoring method; if the monitored field is an output parameter field, obtain the target performance information when the monitoring method outputs the monitored field; and determine the classification performance information corresponding to the monitored field according to the target performance information.
7. An electronic device, comprising: a memory; a processor; and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when executed by the processor, are used to implement the performance monitoring method of the application program according to any one of claims 1-5.
9. A computer program product, comprising a computer program, which when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Service data real-time monitoring system and method based on Java byte code enhancement technology
CN110083436A