Information reporting method and device of application program, electronic equipment and storage medium
By recording and reporting memory dump information and statistical information in the application, the performance degradation caused by frequent allocation of JVM objects and garbage collection is solved, and effective monitoring and troubleshooting of application performance is achieved, ensuring efficient and stable operation of the application.
Patent Information
- Application Number
- CN202411592604.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
JVM frequently creates and destroys objects in applications, resulting in high memory management overhead, affects performance, and garbage collection operations occupy CPU time, increasing response time and reducing throughput.
By obtaining application identification and configuration information, the target business is executed in the target application based on this information, the object's memory dump information and statistical information are recorded, and the information is reported to the server for performance analysis.
Effectively monitor the performance of the application, promptly troubleshoot, improve performance monitoring and troubleshooting capabilities, and ensure efficient and stable operation of the application.
Smart Images

Figure CN119645756A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for reporting application information. Background Art
[0002] Applications can be run in a Java virtual machine (JVM), and the running process of the application can be monitored by the JVM. However, the JVM has a high object allocation rate problem, that is, objects are frequently created and destroyed in the application, resulting in high memory management overhead.
[0003] The above situation may cause the performance of the application to degrade, because frequent object allocation and garbage collection operations will take up a lot of central processing unit (CPU) time and cause all application threads to suspend execution, increase application response time, reduce application throughput, and increase unnecessary memory overhead.
[0004] Therefore, how to improve the performance monitoring and troubleshooting capabilities of applications to ensure efficient and stable operation of applications is an issue that needs to be addressed urgently. Summary of the invention
[0005] The embodiments of the present application provide an application information reporting method, device, electronic device and storage medium, which effectively monitor the performance of the application and timely troubleshoot by analyzing the reported application information, improve the performance monitoring and troubleshooting capabilities of the application, and thus ensure the efficient and stable operation of the application.
[0006] In a first aspect, an embodiment of the present application provides a method for reporting information of an application program, the method comprising:
[0007] Obtaining an application identifier and configuration information from the service execution request; the configuration information includes: multiple configurations required to execute the target service in the target application corresponding to the application identifier;
[0008] Execute the target business in the target application based on the configuration information, and record the memory dump information and statistical information of multiple objects corresponding to the target business; wherein the memory dump information includes: resource occupancy corresponding to the multiple objects, and the statistical information includes: quantity and class name corresponding to the multiple objects;
[0009] The memory dump information and the statistical information are reported to the server; the server is used to perform performance analysis on the target application according to the memory dump information and the statistical information.
[0010] In an optional embodiment, executing the target service in the target application based on the configuration information includes:
[0011] If the configuration information contains verification information of the target service, the target service is executed in the target application when the verification information passes the verification; wherein the verification information includes: a process identifier and a container identifier corresponding to the target service.
[0012] In an optional embodiment, recording memory dump information and statistical information of multiple objects corresponding to the target business includes:
[0013] Determine a first trigger and a second trigger based on the proxy configuration included in the configuration information;
[0014] When it is determined that there is a target class in a class set corresponding to multiple objects whose class resource occupancy meets the preset resource conditions, memory dump information of at least one object corresponding to the target class is recorded based on the first trigger, and statistical information corresponding to at least one object is recorded based on the second trigger.
[0015] In an optional embodiment, determining that there is a target class whose class resource occupancy meets a preset resource condition in a class set corresponding to the plurality of objects includes:
[0016] For at least one class included in the class collection, perform the following operations:
[0017] Get the resource usage of a class within a set sliding time window;
[0018] Based on the resource usage of a class in the sliding time window, determine the corresponding resource usage mean and resource usage standard deviation;
[0019] Obtaining a resource occupancy threshold value based on a resource occupancy mean value and a resource occupancy standard deviation;
[0020] When a class has a resource occupancy greater than or equal to a resource occupancy threshold value among resource occupancy within the sliding time window, the class is determined to be a target class that meets the preset resource condition.
[0021] In an optional embodiment, after determining the first trigger and the second trigger based on the proxy configuration included in the configuration information, the method further includes:
[0022] Real-time detection of proxy configuration to obtain corresponding detection information; wherein the detection information is used to indicate whether the proxy configuration has changed;
[0023] If the detection information indicates that the proxy configuration has changed, the first trigger and the second trigger are re-determined based on the changed proxy configuration.
[0024] In an optional embodiment, reporting the memory dump information and the statistical information to the server includes:
[0025] If the first parameter included in the memory dump information is the first field, the memory dump information is uploaded to the server; wherein the first parameter is used to indicate whether to upload the memory dump information;
[0026] And, uploading object histograms of the plurality of objects generated based on the statistical information to the server.
[0027] In an optional embodiment, the object histogram is generated in the following manner:
[0028] If the virtual machine is in an on state and supports the collector to collect object information during the execution of the target business in the target application, a target session is created for multiple objects, and statistical information is recorded in the target session;
[0029] At the object histogram generation time in the configuration information, an object histogram is generated based on the statistical information.
[0030] In an optional embodiment, before creating a target session for multiple objects, the method further includes:
[0031] If there is currently an ongoing session, first information is sent to the server; the first information is used to indicate that the object histogram cannot be generated.
[0032] In an optional embodiment, the method further includes:
[0033] If the virtual machine is in a shutdown state and / or does not support the collector to collect object information during the execution of the target business in the target application, second information is sent to the server; the second information is used to indicate that the object histogram cannot be generated.
[0034] In a second aspect, an embodiment of the present application further provides an application information reporting device, the device comprising:
[0035] The information acquisition module is used to obtain the application identifier and configuration information from the service execution request; the configuration information includes: multiple configurations required to execute the target service in the target application corresponding to the application identifier;
[0036] An information recording module is used to execute a target business in a target application based on the configuration information, and record memory dump information and statistical information of multiple objects corresponding to the target business; wherein the memory dump information includes: resource occupancy corresponding to the multiple objects, and the statistical information includes: quantity and class name corresponding to the multiple objects;
[0037] The information reporting module is used to report the memory dump information and the statistical information to the server; the server is used to perform performance analysis on the target application according to the memory dump information and the statistical information.
[0038] In an optional embodiment, when executing the target service in the target application based on the configuration information, the information recording module is specifically used to:
[0039] If the configuration information contains verification information of the target service, the target service is executed in the target application when the verification information passes the verification; wherein the verification information includes: a process identifier and a container identifier corresponding to the target service.
[0040] In an optional embodiment, when recording memory dump information and statistical information of multiple objects corresponding to the target business, the information recording module is specifically used to:
[0041] Determine a first trigger and a second trigger based on the proxy configuration included in the configuration information;
[0042] When it is determined that there is a target class in a class set corresponding to multiple objects whose class resource occupancy meets the preset resource conditions, memory dump information of at least one object corresponding to the target class is recorded based on the first trigger, and statistical information corresponding to at least one object is recorded based on the second trigger.
[0043] In an optional embodiment, when it is determined that in a class set corresponding to a plurality of objects, there is a target class whose class resource occupancy meets a preset resource condition, the information recording module is specifically configured to:
[0044] For at least one class included in the class collection, perform the following operations:
[0045] Get the resource usage of a class within a set sliding time window;
[0046] Based on the resource usage of a class in the sliding time window, determine the corresponding resource usage mean and resource usage standard deviation;
[0047] Obtaining a resource occupancy threshold value based on a resource occupancy mean value and a resource occupancy standard deviation;
[0048] When a class has a resource occupancy greater than or equal to a resource occupancy threshold value among resource occupancy within the sliding time window, the class is determined to be a target class that meets the preset resource condition.
[0049] In an optional embodiment, after determining the first trigger and the second trigger based on the proxy configuration included in the configuration information, the information recording module is further used to:
[0050] Real-time detection of proxy configuration to obtain corresponding detection information; wherein the detection information is used to indicate whether the proxy configuration has changed;
[0051] If the detection information indicates that the proxy configuration has changed, the first trigger and the second trigger are re-determined based on the changed proxy configuration.
[0052] In an optional embodiment, when reporting the memory dump information and the statistical information to the server, the information reporting module is specifically used to:
[0053] If the first parameter included in the memory dump information is the first field, the memory dump information is uploaded to the server; wherein the first parameter is used to indicate whether to upload the memory dump information;
[0054] And, uploading object histograms of the plurality of objects generated based on the statistical information to the server.
[0055] In an optional embodiment, the object histogram is generated by the information recording module in the following manner:
[0056] If the virtual machine is in an on state and supports the collector to collect object information during the execution of the target business in the target application, a target session is created for multiple objects, and statistical information is recorded in the target session;
[0057] At the object histogram generation time in the configuration information, an object histogram is generated based on the statistical information.
[0058] In an optional embodiment, before creating target sessions for multiple objects, the information reporting module is further used to:
[0059] If there is currently an ongoing session, first information is sent to the server; the first information is used to indicate that the object histogram cannot be generated.
[0060] In an optional embodiment, the information reporting module is further used to:
[0061] If the virtual machine is in a shutdown state and / or does not support the collector to collect object information during the execution of the target business in the target application, second information is sent to the server; the second information is used to indicate that the object histogram cannot be generated.
[0062] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0063] Processor; and
[0064] Memory for storing programs,
[0065] The program includes instructions, and when the instructions are executed by the processor, the processor executes the information reporting method of the application program as described in the first aspect.
[0066] In a fourth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the information reporting method of the application program as described in the first aspect.
[0067] In a fifth aspect, the present application provides a computer program product, which, when called by a computer, enables the computer to execute the steps of the application information reporting method as described in the first aspect.
[0068] The beneficial effects of this application are as follows:
[0069] In the application information reporting method provided in the embodiment of the present application, when executing the target business in the target application based on the configuration information, the memory dump information including the resource occupation corresponding to the multiple objects and the statistical information including the quantity and class name corresponding to the multiple objects can be recorded, and the memory dump information and the statistical information can better reflect the performance of the target application. Therefore, when executing the target business in the target application, the memory dump information and the statistical information are recorded and reported in a timely manner, so as to analyze the reported application information later, so as to effectively monitor the performance of the application and timely troubleshoot, improve the performance monitoring and troubleshooting capabilities of the application, and thus ensure the efficient and stable operation of the application.
[0070] In addition, other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described here are used to provide a further understanding of the present application, constitute a part of the present application, and do not constitute an improper limitation on the present application. In the drawings:
[0072] Figure 1 A schematic diagram of an optional system architecture applicable to the embodiments of the present application;
[0073] Figure 2 A schematic diagram of an implementation flow of a method for reporting information of an application program provided in an embodiment of the present application;
[0074] Figure 3 A schematic diagram of a scenario for obtaining application identification and configuration information provided in an embodiment of the present application;
[0075] Figure 4 A schematic diagram of an implementation flow of a method for determining a target class provided in an embodiment of the present application;
[0076] Figure 5 A specific schematic diagram of detailed information of an object provided in an embodiment of the present application;
[0077] Figure 6 A logical schematic diagram of information sending provided in an embodiment of the present application;
[0078] Figure 7 A schematic diagram of the structure of an information reporting device for an application provided in an embodiment of the present application;
[0079] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0081] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0082] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0083] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0084] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0085] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0086] (1) Aspect oriented programming (AOP): Also known as aspect-oriented programming, it is a technology that uses precompilation and runtime dynamic proxy to dynamically and uniformly add functions to a program without modifying the source code.
[0087] (2) Bytecode manipulation: Java Agent allows developers to intercept and modify the bytecode of a class during the process of loading a class in an application. This requires analyzing, modifying, and regenerating the bytecode. To achieve this, bytecode manipulation libraries are usually used. These libraries provide advanced application programming interfaces (APIs), making it relatively easy to operate at the bytecode level.
[0088] (3) Class loading mechanism: refers to the Java class loader that is responsible for loading classes from the class path into memory. Java Agent uses the class loader's delegation mechanism to intervene in the class loading process and implement dynamic modification of classes, that is, it provides the ability to perform bytecode conversion before and after class loading.
[0089] (4) Runtime transformation: Java Agent allows bytecode to be modified when a class is loaded, thereby changing the behavior of the class. It can be widely used for various purposes, including performance optimization, monitoring, logging, security enhancement, etc.
[0090] (5) Garbage collection overhead: Java's garbage collector is responsible for recycling objects that are no longer in use and releasing the memory they occupy. Frequent object allocation will lead to more frequent garbage collection, which will take up a lot of CPU time and reduce the responsiveness of the application.
[0091] (6) "Stop-the-world": This is an important concept related to JVM garbage collection (GC). It means that during the execution of an application, the JVM will pause the execution of all application threads to perform garbage collection (GC) work. This pause period is called a "stop-the-world" event, which will cause the application to temporarily stagnate until the garbage collection work is completed.
[0092] (7) "Memory dump": In JVM, memory dump is a snapshot operation that captures the memory status of the current JVM process. Memory dump files usually contain all objects, threads, class loaders, and other related information in the currently running Java application. After generating a memory dump file, you need to use analysis tools to analyze it. You can view the distribution of objects in memory, hot spots of memory usage, and possible leaks, thereby helping you optimize the application's memory and solve related performance problems.
[0093] Based on the above-mentioned nouns and related terminology explanations, the design concept of the embodiments of the present application is briefly introduced below:
[0094] Java Agent is a mechanism provided by JVM that allows the bytecode of an application to be modified or enhanced through an agent when the application is started. This mechanism is often used to implement various types of code injection, performance monitoring, logging, AOP and other functions, providing the possibility of implementing various innovative functions and tools.
[0095] However, the JVM object high rate allocation problem refers to the situation where objects are frequently created and destroyed in Java applications, resulting in high memory management overhead. This situation may cause application performance degradation because frequent object allocation and garbage collection operations take up a lot of CPU time and "stop-the-world", increasing application response time, reducing application throughput, and adding unnecessary memory overhead.
[0096] In view of this, in order to improve the performance monitoring and troubleshooting capabilities of the application, thereby ensuring the efficient and stable operation of the application, the embodiment of the present application proposes an information reporting method for the application, which may specifically include: obtaining an application identifier and configuration information from a business execution request; then, executing the target business in the target application based on the configuration information, recording the memory dump information and statistical information of multiple objects corresponding to the target business; finally, reporting the memory dump information and statistical information to the server. Among them, the configuration information may include: multiple configurations required to execute the target business in the target application corresponding to the application identifier; the memory dump information may include: the resource occupancy corresponding to multiple objects, and the statistical information may include: the quantity and class name corresponding to multiple objects; the server may be used to perform performance analysis on the target application based on the memory dump information and statistical information.
[0097] Since when executing the target business in the target application based on the configuration information, memory dump information including resource occupancy corresponding to multiple objects and statistical information including quantity and class name corresponding to multiple objects can be recorded, and the memory dump information and statistical information can better reflect the performance of the target application. Therefore, when executing the target business in the target application, the memory dump information and statistical information are recorded and reported in a timely manner, so as to analyze the reported application information later, so as to effectively monitor the performance of the application and timely troubleshoot, improve the performance monitoring and troubleshooting capabilities of the application, and thus ensure the efficient and stable operation of the application.
[0098] In particular, the preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments of the present application and the features in the embodiments may be combined with each other if there is no conflict.
[0099] See also Figure 1 As shown, it is a schematic diagram of a system architecture applicable to an embodiment of the present application, and the system architecture may include: a terminal device (101a, 101b) and a server 102. The terminal device (101a, 101b) and the server 102 may exchange information through a communication network, wherein the communication mode adopted by the communication network may include: a wireless communication mode and a wired communication mode. Exemplarily, the terminal device (101a, 101b) may access the network through cellular mobile communication technology and communicate with the server 102. Wherein, the cellular mobile communication technology, for example, includes the fifth generation mobile communication (5th generation mobile networks, 5G) technology or the next generation mobile communication technology. Optionally, the terminal device (101a, 101b) may access the network through a short-range wireless communication mode and communicate with the server 102. Wherein, the short-range wireless communication mode, for example, includes wireless fidelity (wireless fidelity, Wi-Fi) technology.
[0100] The embodiment of the present application does not impose any restriction on the number of communication devices involved in the above system architecture. For example, the above system architecture may include more terminal devices, or fewer terminal devices, or other network devices. Figure 1 As shown, only the terminal devices (101a, 101b) and the server 102 are described as examples, and the above communication devices and their respective functions are briefly introduced below.
[0101] The terminal device (101a, 101b) is a device that can provide voice and / or data connectivity to users, and can be a device that supports wired and / or wireless connection.
[0102] Exemplarily, the terminal devices (101a, 101b) may include, but are not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.
[0103] In addition, a related client may be installed on the terminal device (101a, 101b), and the client may be software, such as an application, a browser, a short video software, etc., or a web page, a mini-program, etc.
[0104] It should be noted that the terminal device (101a, 101b) in the embodiment of the present application can obtain the application identifier and configuration information from the service execution request; then, based on the configuration information, the target service is executed in the target application corresponding to the application identifier, and the memory dump information and statistical information of multiple objects corresponding to the target service are recorded; finally, the memory dump information and statistical information are reported to the server 102. Among them, the aforementioned configuration information may include multiple configurations required to execute the target service in the target application; the aforementioned memory dump information may include the resource occupancy (for example, memory usage rate, etc.) corresponding to the aforementioned multiple objects, and the statistical information may include the quantity and class name corresponding to the aforementioned multiple objects.
[0105] The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. It is worth mentioning that in the embodiment of the present application, the server 102 can be used to receive memory dump information and statistical information reported by the terminal device (101a, 101b), and perform performance analysis on the target application based on the memory dump information and statistical information.
[0106] The following describes the information reporting method of the application provided by the exemplary embodiment of the present application in combination with the above-mentioned system architecture and reference to the accompanying drawings. It should be noted that the above-mentioned system architecture is only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this regard.
[0107] See also Figure 2 As shown, it is a schematic diagram of an implementation process of an application information reporting method provided in an embodiment of the present application. The execution subject takes a terminal device as an example. The specific implementation process of the method is as follows:
[0108] S201: Obtain application identification and configuration information from a service execution request.
[0109] The above configuration information may include: various configurations required to execute the target business in the target application corresponding to the application identifier. Exemplarily, the above configuration information may include memory configuration, proxy configuration, process configuration, container configuration, and kernel configuration. In addition, the application identifier may be an application name, which is not specifically limited in the embodiments of the present application.
[0110] For example, see Figure 3 As shown, when executing step S201, the terminal device can present a first interface to the target user, and the first interface includes application identifiers corresponding to multiple applications. In this way, the target user can select the target application on the first interface, for example, by clicking the application identifier corresponding to the target application. At this time, the terminal device can respond to the target user's service execution request for the target application, and then obtain the application identifier and configuration information of the target application from the service execution request, so as to subsequently execute the target service in the target application.
[0111] Optionally, the above-mentioned multiple applications may also be program codes or running programs in the background server, which is not specifically limited in the embodiments of the present application.
[0112] S202: Execute a target service in a target application based on the configuration information, and record memory dump information and statistical information of multiple objects corresponding to the target service.
[0113] The above-mentioned memory dump information, i.e., the dump file, may include the resource usage corresponding to the above-mentioned multiple objects, which is used to locate problems such as high memory usage and memory leaks. The above-mentioned statistical information may include the number and class name corresponding to the multiple objects. Exemplarily, the above-mentioned classes may include character (char) arrays, byte (byte) arrays, string (string) objects, and integer (int) arrays, etc. Therefore, the corresponding class names may be char, byte, string, and int, etc.
[0114] For example, "C" can be used to represent a char array, "B" can be used to represent a byte array, "java.lang.String" can be used to represent a string object, and "I" can be used to represent an int array. It should also be noted that the present application embodiment does not specifically limit the class name. For example, a char array can be called a char class or a character class, and of course it can have other names.
[0115] In an optional implementation, in order to ensure that the service execution request of the target user is a valid request, the terminal device needs to verify the verification information in the configuration information before executing the target service in the target application based on the configuration information. That is, if the verification information of the target service exists in the configuration information, the target service is executed in the target application when the verification information passes the verification, thereby avoiding the resource occupation of the terminal device by invalid requests. The verification information may include: the process identification (PID) and container identification (i.e., container ID) corresponding to the target service.
[0116] In this way, Java Agent technology can be used to communicate through the network between servers, so that memory dump can be manually triggered and statistical information can be automatically recorded or object histograms can be generated, and the results can be reported to the server.
[0117] Furthermore, when the terminal device executes the target service in the target application, the memory dump operation can be implemented to record the memory dump information of multiple objects corresponding to the aforementioned target service. Exemplarily, the dump file, i.e., the memory dump information, can be generated according to the application identifier (or application name) of the target application, the dump directory (i.e., the directory of the dump file), the configuration parameters, the PID, whether it is an active dump, the container ID, and the restriction parameters.
[0118] It should be noted that if the type of JVM is different, the method of generating the dump file may be different. For example, if the JVM is an OpenJ9 JVM, a specific dump file generation method can be scheduled.
[0119] In order to record and report memory dump information and statistical information in a timely manner, the memory dump information and statistical information of multiple objects can be recorded according to the automatic trigger configuration, CPU, memory, garbage collection and time and other different resource conditions. Therefore, in an optional implementation, the terminal device can determine the first trigger and the second trigger based on the proxy configuration contained in the above configuration information; and when it is determined that there is a target class whose class resource occupancy meets the preset resource condition in the class set corresponding to the multiple objects, the memory dump information of at least one object corresponding to the target class is recorded based on the first trigger, and the statistical information corresponding to at least one object is recorded based on the second trigger.
[0120] In an alternative implementation, see Figure 4 As shown, the terminal device can determine whether there is a target class whose class resource occupancy meets the preset resource condition in the class set corresponding to the above multiple objects in the following manner. Specifically, for any one class in at least one class included in the above class set, perform the following operations:
[0121] S401: Obtain resource usage of a class within a set sliding time window.
[0122] The size of the sliding time window set above may be determined according to the fluctuation of historical data of executing the target business in the target application program, for example, the sliding time window may generally be a window size of 5-10 minutes.
[0123] Optionally, when executing step S401, the terminal device may obtain a certain amount of resource occupancy according to a set data collection frequency (i.e., sampling frequency) within the above-mentioned preset sliding time window. Exemplarily, the above-mentioned set data collection frequency may be determined according to actual needs. For example, it may be 1 second, 10 seconds, or 1 minute.
[0124] S402: Based on the resource occupancy of a class in the sliding time window, determine the corresponding resource occupancy mean and resource occupancy standard deviation.
[0125] Exemplarily, when executing step S402, assuming that the terminal device obtains 5 resource occupancy of a class (such as an int array) within 10 minutes (i.e., a sliding time window), the mean resource occupancy and standard deviation of the resource occupancy of the class within 10 minutes can be determined based on the above 5 resource occupancy.
[0126] Optionally, the above resource occupancy mean value may be expressed as μ, the above resource occupancy standard deviation may be expressed as σ, and the calculation formulas of the resource occupancy mean value μ and the resource occupancy standard deviation σ may be expressed as follows:
[0127]
[0128] Where N represents the amount of resource usage obtained in the sliding time window, x i Indicates the i-th resource occupancy obtained within the sliding time window.
[0129] S403: Obtain a resource occupancy threshold based on the resource occupancy mean and the resource occupancy standard deviation.
[0130] In this way, the terminal device can dynamically adjust the resource occupancy threshold value for subsequent triggering of memory dump information and statistical information recording according to the obtained resource occupancy mean value and resource occupancy standard value. It can be seen that the resource occupancy mean value within the sliding time window plus an offset (i.e., the resource occupancy standard deviation) is used as the resource occupancy threshold value, which ensures that the resource occupancy threshold value can be adaptively adjusted according to the recent system load situation (i.e., the resource occupancy situation).
[0131] In an optional implementation, when executing step S403, the terminal device can combine the fluctuation of the resource occupancy of the target service executed in the target application (i.e., the weight factor corresponding to the resource occupancy standard deviation) in the process of obtaining the resource occupancy threshold value based on the resource occupancy mean and the resource occupancy standard deviation, so as to more accurately determine the resource occupancy threshold value. The aforementioned weight factor can also be called a sensitivity coefficient for controlling the resource occupancy threshold value, for example, a value of 2.0 or 2.5, etc., depending on the fluctuation range of the resource occupancy.
[0132] Optionally, the calculation formula of the resource occupancy threshold value may be specifically expressed as follows:
[0133] Y=μ+Y×σ
[0134] Among them, Y represents the above-mentioned resource occupancy threshold value, μ represents the above-mentioned resource occupancy mean value, σ represents the above-mentioned resource occupancy standard deviation, and K represents the weight factor corresponding to the above-mentioned resource occupancy standard deviation. A smaller K value will make the resource occupancy threshold value Y easier to trigger, and a larger K value is suitable for scenarios with larger fluctuations in resource occupancy.
[0135] Based on the method steps recorded in S401 to S403 above, using the sliding time window set above, the earliest resource occupancy can be removed and the new resource occupancy can be added, so as to dynamically update the resource occupancy mean and resource occupancy standard deviation to maintain the real-time nature of the resource occupancy threshold value.
[0136] S404: When a resource occupancy of a class within the sliding time window is greater than or equal to a resource occupancy threshold, a class is determined to be a target class that meets a preset resource condition.
[0137] Optionally, when the resource occupancy of the above-mentioned one class in the sliding time window does not have a resource occupancy greater than or equal to the resource occupancy threshold value, it can be determined that the above-mentioned one class is not a target class that meets the preset resource condition. In other words, if the resource occupancy of the above-mentioned one class in the sliding time window is less than the resource occupancy threshold value, it can be determined that the above-mentioned one class is not a target class that meets the preset resource condition.
[0138] It should also be noted that both the above-mentioned first trigger and the above-mentioned second trigger can provide automatic diagnosis services, wherein the automatic diagnosis service, i.e., the service class used to manage and control the automatic diagnosis function, can implement the proxy configuration listener interface and can monitor changes in the proxy configuration. Therefore, after the terminal device determines the first trigger and the second trigger based on the proxy configuration contained in the configuration information, it can detect the proxy configuration in real time and obtain corresponding detection information, wherein the detection information is used to indicate whether the proxy configuration has changed; if the detection information indicates that the proxy configuration has changed, the first trigger and the second trigger are re-determined based on the changed proxy configuration. In other words, if a change in the proxy configuration is detected, the first trigger and the second trigger can be updated according to the new proxy configuration. Conversely, if the above-mentioned detection information indicates that the proxy configuration has not changed, there is no need to re-determine the first trigger and the second trigger.
[0139] Since the first trigger and the second trigger are both automatic diagnosis configuration triggers, the basic behaviors of the automatic diagnosis trigger, namely, the start trigger and the cancel trigger, can be defined through the corresponding interface. Among them, the start trigger can receive a timed service executor for executing the timed service. For example, the interface can be implemented according to the specific trigger class, and the timed service can be set in the startup to regularly check whether the conditions for automatic diagnosis are met. When the triggers are started, they will regularly check the system status according to the configured rules, and perform the corresponding automatic diagnosis operations when the conditions are met. Canceling a trigger means stopping the operation of the trigger when it is no longer needed.
[0140] Based on the above method, when the proxy configuration changes, the automatic diagnosis service of the terminal device will obtain the latest automatic diagnosis configuration (i.e., the new proxy configuration), and then re-acquire the first trigger and the second trigger according to the new proxy configuration. Specifically, if the new and old triggers are different, the old trigger is canceled and the new trigger is started.
[0141] It should also be noted that the above-mentioned first trigger can also be called a heap memory automatic diagnosis configuration trigger, which can realize automatic diagnosis of heap memory dump, and the above-mentioned second trigger can also be called a memory object statistics automatic diagnosis configuration trigger, which can realize automatic diagnosis of memory object statistics.
[0142] In addition, the above-mentioned preset resource conditions, i.e., resource condition rules, can define whether automatic diagnosis should be triggered through corresponding interfaces, and are used to determine whether automatic diagnosis should be triggered. For example, a specific class can determine whether automatic diagnosis should be triggered based on specific resource conditions (e.g., memory usage or CPU usage exceeds a certain threshold).
[0143] Optionally, when determining whether automatic diagnosis should be triggered, the threshold comparison operator in the comparator can be used to determine whether the trigger condition is met. The interface corresponding to the aforementioned threshold comparison operator defines a "Whether to trigger (digital value, digital threshold)" method for determining whether the trigger condition is met. When a specific class implements this interface, it can be implemented according to the provided "Whether to trigger (digital value, digital threshold)" method. For example, compare the current memory usage with the set memory usage threshold to determine whether the trigger condition is met.
[0144] Then, through the interface corresponding to the above preset resource conditions, a method of "need to trigger (digital threshold, threshold comparison operator)" can be defined to determine whether the trigger condition is met. When a specific class implements this interface, it can determine whether automatic diagnosis should be triggered based on the provided "need to trigger (digital threshold, threshold comparison operator)" method through specific threshold conditions (i.e., digital threshold) and comparison operations (i.e., threshold comparison operators).
[0145] For example, taking the resource condition of memory percentage as an example, the current memory usage rate is usually obtained and compared through the "trigger (numeric value, numeric threshold)" method corresponding to the above threshold comparison operator.
[0146] S203: Report the memory dump information and statistical information to the server.
[0147] In this way, after recording the memory dump information and statistical information, the terminal device can report the memory dump information and statistical information to the server, so that the server can perform performance analysis on the target application based on the memory dump information and statistical information, thereby effectively monitoring the performance of the application and timely troubleshooting, improving the performance monitoring and troubleshooting capabilities of the application, and thus ensuring the efficient and stable operation of the application.
[0148] In an optional implementation, when executing step S203, if the first parameter included in the memory dump information is the first field, the terminal device can upload the memory dump information to the server. The first parameter can be used to indicate whether to upload the memory dump information. Optionally, the terminal device can submit the upload task (i.e., the task of uploading the memory dump information) as an execution task and add the upload task to the task manager. Exemplarily, the aforementioned task manager can also be used to monitor the resource usage of the target business and allocate resources to the target business.
[0149] Exemplarily, if the dump file (ie, memory dump information) is successfully generated, and the transfer field (ie, the first parameter) parsed from the configuration parameters in the dump file is a true field (eg, true), ie, the first field, then the terminal device can upload the aforementioned dump file to the server.
[0150] Optionally, the method for uploading the dump file may be to parse a transfer entity object from the configuration parameters, and then submit a new upload service to the execution service of the target application.
[0151] Furthermore, the terminal device may upload an object histogram of multiple objects generated based on the statistical information to the server.
[0152] In an optional implementation, if the JVM is turned on and supports the collector to collect object information during the execution of the target business in the target application, a target session is created for multiple objects, and statistical information is recorded in the target session, so that at the time of generating the object histogram in the configuration information, an object histogram is generated based on the statistical information. It should be noted that the target session is a process in which a terminal device communicates with an interactive system.
[0153] For example, you can use the jmap-histo:[live] command to generate an object histogram of live objects in the JVM heap memory. This command will output detailed information about the currently live objects in the JVM. The output results can be found in Figure 5As shown. Among them, the "num:" column shows the ordinal number of the object (for example, 1, 2, 3), which is usually sorted from large to small according to the memory occupied by the object. The "instances:" column shows the number of object instances, such as the number of objects of this type in the heap. For example, 24000 means that there are 24,000 instances of objects of this class. The "bytes:" column shows the total number of bytes occupied by objects of this type. For example, 5760000 means that 24,000 objects of this class occupy a total of 5,760,000 bytes of memory. The "class name:" column shows the name of the class, indicating the fully qualified name of the class to which the object belongs. For example, "C" represents a char array, "B" represents a byte array, "java.lang.string" represents a string object, and "I" represents an int array.
[0154] In this way, the server can subsequently analyze the above data (i.e., the object histogram) to help identify the object types that occupy a large amount of memory, thereby performing performance tuning and memory management.
[0155] Optional, see Figure 6 As shown, if there is currently an ongoing session, the terminal device can send a first message to the server; wherein the first message can be used to indicate that the object histogram cannot be generated. If the JVM is in a closed state and / or does not support the collector to collect object information during the execution of the target business in the target application, the terminal device can send a second message to the server; wherein the second message can be used to indicate that the object histogram cannot be generated.
[0156] It should be noted that the first information and the second information are both warning information, that is, reminding the target user that the object histogram cannot be generated. Of course, there may be other names, which are not limited in the present embodiment of the application.
[0157] Through the above method, the terminal device can realize the generation and upload of the object histogram, that is, after receiving a configuration parameter containing a command entity, the default proxy configuration and application identifier can be obtained. Next, check whether the JVM is enabled. If the JVM is enabled, it can be checked whether the collector is supported. If the collector is supported, and there is no session or the current session has ended, create a new session according to the capture mode of the command entity and start the session. Then send a start event. If there is an ongoing session, record the error information and send a failure event. If the session can be started normally, generate the object histogram at the appropriate time according to the configuration parameters and upload it to the server. If the collector is not supported or the JVM is not enabled, record the error information and send a failure event.
[0158] In summary, in the application information reporting method provided in the embodiment of the present application, when executing the target business in the target application based on the configuration information, memory dump information including resource occupancy corresponding to multiple objects and statistical information including quantity and class name corresponding to multiple objects can be recorded, and the memory dump information and statistical information can better reflect the performance of the target application. Therefore, when executing the target business in the target application, the memory dump information and statistical information are recorded and reported in a timely manner, so as to analyze the reported application information later, so as to effectively monitor the performance of the application and timely troubleshoot, improve the performance monitoring and troubleshooting capabilities of the application, and thus ensure the efficient and stable operation of the application.
[0159] In particular, when running complex systems or applications, the management of memory usage and garbage collection will become particularly important. Unreasonable memory usage and frequent garbage collection may cause application performance degradation or even pauses, affecting user experience and system stability. By implementing such monitoring functions, the system can issue warnings or automatically take measures, such as memory dumps or object statistics, when resource usage approaches or exceeds predetermined values by setting thresholds and comparison logic, so that developers can quickly respond to potential performance issues. Secondly, when performance problems occur, memory dump information and object statistics can help developers analyze the cause of the problem and locate the root cause of memory leaks or high resource consumption. Furthermore, through the collected data and triggered operations, the application can be tuned to improve resource utilization efficiency and reduce unnecessary garbage collection, thereby improving overall performance. In addition, automated monitoring and response mechanisms can reduce manual intervention and reduce operation and maintenance costs, while improving system reliability and stability.
[0160] Further, based on the same technical concept, the embodiment of the present application provides an application information reporting device, and the application information reporting device is used to implement the above method flow of the embodiment of the present application. Figure 7 As shown, the information reporting device 700 of the application may include: an information acquisition module 701, an information recording module 702 and an information reporting module 703, wherein:
[0161] The information acquisition module 701 is used to acquire the application identifier and configuration information from the service execution request; the configuration information includes: various configurations required to execute the target service in the target application corresponding to the application identifier;
[0162] The information recording module 702 is used to execute the target business in the target application based on the configuration information, and record the memory dump information and statistical information of multiple objects corresponding to the target business; wherein the memory dump information includes: resource occupancy corresponding to the multiple objects, and the statistical information includes: quantity and class name corresponding to the multiple objects;
[0163] The information reporting module 703 is used to report the memory dump information and the statistical information to the server; the server is used to perform performance analysis on the target application according to the memory dump information and the statistical information.
[0164] In an optional embodiment, when executing the target service in the target application based on the configuration information, the information recording module 702 is specifically used to:
[0165] If the configuration information contains verification information of the target service, the target service is executed in the target application when the verification information passes the verification; wherein the verification information includes: a process identifier and a container identifier corresponding to the target service.
[0166] In an optional embodiment, when recording the memory dump information and statistical information of multiple objects corresponding to the target business, the information recording module 702 is specifically used to:
[0167] Determine a first trigger and a second trigger based on the proxy configuration included in the configuration information;
[0168] When it is determined that there is a target class in a class set corresponding to multiple objects whose class resource occupancy meets the preset resource conditions, memory dump information of at least one object corresponding to the target class is recorded based on the first trigger, and statistical information corresponding to at least one object is recorded based on the second trigger.
[0169] In an optional embodiment, when it is determined that in the class set corresponding to the multiple objects, there is a target class whose class resource occupancy meets the preset resource condition, the information recording module 702 is specifically used to:
[0170] For at least one class included in the class collection, perform the following operations:
[0171] Get the resource usage of a class within a set sliding time window;
[0172] Based on the resource usage of a class in the sliding time window, determine the corresponding resource usage mean and resource usage standard deviation;
[0173] Obtaining a resource occupancy threshold value based on a resource occupancy mean value and a resource occupancy standard deviation;
[0174] When a class has a resource occupancy greater than or equal to a resource occupancy threshold value among resource occupancy within the sliding time window, the class is determined to be a target class that meets the preset resource condition.
[0175] In an optional embodiment, after determining the first trigger and the second trigger based on the proxy configuration included in the configuration information, the information recording module 702 is further used to:
[0176] Real-time detection of proxy configuration to obtain corresponding detection information; wherein the detection information is used to indicate whether the proxy configuration has changed;
[0177] If the detection information indicates that the proxy configuration has changed, the first trigger and the second trigger are re-determined based on the changed proxy configuration.
[0178] In an optional embodiment, when reporting the memory dump information and the statistical information to the server, the information reporting module 703 is specifically used to:
[0179] If the first parameter included in the memory dump information is the first field, the memory dump information is uploaded to the server; wherein the first parameter is used to indicate whether to upload the memory dump information;
[0180] And, uploading object histograms of the plurality of objects generated based on the statistical information to the server.
[0181] In an optional embodiment, the object histogram is generated by the information recording module 702 in the following manner:
[0182] If the virtual machine is in an on state and supports the collector to collect object information during the execution of the target business in the target application, a target session is created for multiple objects, and statistical information is recorded in the target session;
[0183] At the object histogram generation time in the configuration information, an object histogram is generated based on the statistical information.
[0184] In an optional embodiment, before creating target sessions for multiple objects, the information reporting module is further used to:
[0185] If there is currently an ongoing session, first information is sent to the server; the first information is used to indicate that the object histogram cannot be generated.
[0186] In an optional embodiment, the information reporting module 703 is further used to:
[0187] If the virtual machine is in a shutdown state and / or does not support the collector to collect object information during the execution of the target business in the target application, second information is sent to the server; the second information is used to indicate that the object histogram cannot be generated.
[0188] Based on the description of the above method embodiment and device embodiment, the exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to enable the electronic device to perform the method according to the embodiment of the present invention when executed by the at least one processor.
[0189] An embodiment of the present application also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.
[0190] An embodiment of the present application also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute a method according to an embodiment of the present application.
[0191] See also Figure 8 As shown, the structured block diagram of the electronic device 800 that can be used as the server or client of the present application will now be described, which is an example of the hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent the computer device of various forms of digital electronics, such as, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only used as examples, and are not intended to limit the implementation of the present application described herein and / or required.
[0192] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0193] A plurality of components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the electronic device 800, and the input unit 806 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 807 may be any type of device capable of presenting information, and may include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 808 may include but is not limited to a disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a worldwide interoperability for microwave access (WiMax) device, a cellular communication device, and / or the like.
[0194] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a CPU, a graphics processing unit (GPU), various artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above. For example, in some embodiments, the information reporting method of the above-mentioned application may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. In some embodiments, the computing unit 801 may be configured to execute the information reporting method of the above-mentioned application by any other appropriate means (e.g., by means of firmware).
[0195] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0196] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0197] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0198] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tub (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0199] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0200] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0201] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope covered by the present application.
Claims
1. A method for reporting application information, characterized in that: include: Obtain application identification and configuration information from the business execution request; The configuration information includes: multiple configurations required to execute the target business in the target application corresponding to the application identifier; Executing the target business in the target application based on the configuration information, recording memory dump information and statistical information of multiple objects corresponding to the target business; wherein the memory dump information includes: resource occupancy corresponding to the multiple objects, and the statistical information includes: quantity and class name corresponding to the multiple objects; The memory dump information and the statistical information are reported to a server; the server is used to perform performance analysis on the target application according to the memory dump information and the statistical information.
2. The method according to claim 1, characterized in that Executing the target service in the target application based on the configuration information includes: If the configuration information contains verification information of the target service, then when the verification information passes the verification, the target service is executed in the target application; wherein the verification information includes: a process identifier and a container identifier corresponding to the target service.
3. The method according to claim 1 or 2, characterized in that The recording of memory dump information and statistical information of multiple objects corresponding to the target business includes: Determining a first trigger and a second trigger based on the proxy configuration included in the configuration information; When it is determined that there is a target class in the class set corresponding to the multiple objects whose class resource occupancy meets the preset resource conditions, memory dump information of at least one object corresponding to the target class is recorded based on the first trigger, and statistical information corresponding to the at least one object is recorded based on the second trigger.
4. The method according to claim 3, characterized in that The step of determining that, in the class set corresponding to the plurality of objects, there is a target class whose class resource occupancy meets a preset resource condition, comprises: For at least one class included in the class set, the following operations are performed respectively: Get the resource usage of a class within a set sliding time window; Based on the resource occupancy of the one class within the sliding time window, determining a corresponding resource occupancy mean and a resource occupancy standard deviation; Obtaining a resource occupancy threshold value based on the resource occupancy mean value and the resource occupancy standard deviation; When the resource occupancy of the one class within the sliding time window is greater than or equal to the resource occupancy threshold, the one class is determined to be the target class that meets the preset resource condition.
5. The method according to claim 3, characterized in that After determining the first trigger and the second trigger based on the proxy configuration included in the configuration information, the method further includes: Detecting the proxy configuration in real time to obtain corresponding detection information; wherein the detection information is used to indicate whether the proxy configuration has changed; If the detection information indicates that the proxy configuration has changed, the first trigger and the second trigger are re-determined based on the changed proxy configuration.
6. The method according to any one of claims 1 to 5, characterized in that The reporting the memory dump information and the statistical information to the server includes: If the first parameter included in the memory dump information is the first field, uploading the memory dump information to the server; wherein the first parameter is used to indicate whether to upload the memory dump information; And, uploading the object histograms of the plurality of objects generated based on the statistical information to the server.
7. The method according to claim 6, characterized in that The object histogram is generated in the following way: If, during the process of executing the target service in the target application, the virtual machine is in an on state and supports the collector to collect object information, a target session is created for the multiple objects, and the statistical information is recorded in the target session; At the object histogram generation time in the configuration information, the object histogram is generated based on the statistical information.
8. The method according to claim 7, characterized in that Before creating the target session for the multiple objects, the method further includes: If there is currently an ongoing session, first information is sent to the server; the first information is used to indicate that the object histogram cannot be generated.
9. The method according to claim 7 or 8, characterized in that The method further comprises: If, during the execution of the target service in the target application, the virtual machine is in a shutdown state and / or does not support the collector to collect object information, second information is sent to the server; the second information is used to indicate that the object histogram cannot be generated.
10. An application information reporting device, characterized in that: include: An information acquisition module, used to obtain application identification and configuration information from a business execution request; The configuration information includes: multiple configurations required to execute the target business in the target application corresponding to the application identifier; An information recording module, configured to execute the target business in the target application based on the configuration information, and record memory dump information and statistical information of multiple objects corresponding to the target business; wherein the memory dump information includes: resource occupancy corresponding to the multiple objects, and the statistical information includes: quantity and class name corresponding to the multiple objects; The information reporting module is used to report the memory dump information and the statistical information to the server; the server is used to perform performance analysis on the target application according to the memory dump information and the statistical information.
11. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Memory leak monitoring method, device and electronic equipment
CN112035314A
Memory monitoring method, device and equipment and computer readable storage medium
CN112214388A
Application program monitoring method and device
CN113868090A
Operation data anomaly detection method and device, equipment, medium and product
CN115934476A
Engineering information acquisition and processing system based on Internet of Things
CN116595338A