CN-122019326-A - Image batch processing performance monitoring and bottleneck diagnosis method, program product and device
Abstract
The disclosure provides a Java Agent-based image batch processing performance monitoring and bottleneck diagnosis method, a program product and a device. The method comprises the steps of loading and initializing Java Agent when an image processing service to be monitored is started, carrying out byte code enhancement on a preset target class through the Java Agent, implanting monitoring codes in the target class method, carrying out monitoring codes to collect performance data executed by the method when the image processing service is running, generating unique tracking identification for the same image batch processing request based on tracking context, associating the performance data of the cross-method and the cross-thread through the tracking identification, sending the collected performance data to a performance analysis server, carrying out association analysis on the performance data of the calling link and corresponding Java virtual machine runtime environment data based on the tracking identification by the performance analysis server, and identifying the performance bottleneck of image batch processing and generating a diagnosis result.
Inventors
- CHEN YONG
Assignees
- 河北幸福消费金融股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260130
Claims (11)
- 1. The Java Agent-based image batch processing performance monitoring and bottleneck diagnosis method is characterized by comprising the following steps of: when an image processing service to be monitored is started, loading and initializing Java Agent; Performing byte code enhancement on a preset target class through the Java Agent, and implanting a monitoring code in a method of the target class; When the image processing service runs, the monitoring code is executed to acquire performance data of method execution, and generates a unique tracking identifier for the same image batch processing request based on the tracking context, and the cross-method and cross-thread performance data are associated through the tracking identifier; The collected performance data is sent to a performance analysis server; And the performance analysis server aggregates a complete call link based on the tracking identification, and performs association analysis on performance data of the call link and corresponding Java virtual machine runtime environment data so as to identify performance bottlenecks in the image batch processing process and generate a diagnosis result.
- 2. The method of claim 1, further comprising visually displaying the diagnostic result and outputting alarm information when a preset alarm condition is met.
- 3. The method of claim 2, wherein the Java Agent is packaged as a Jar package that is deployed into a server running the image processing service; and when the image processing service is started, loading the Java Agent in the starting or running process of the Java virtual machine corresponding to the image processing service.
- 4. The method of claim 1, wherein the target classes include at least an image processing related class, a file input output related class, and a network communication related class.
- 5. The method of claim 1, wherein byte code enhancing the predetermined target class comprises: A first monitoring code for recording a method identifier, a start time and a tracking context is inserted at an entrance of a method of a target class, and a second monitoring code for recording a method identifier, an end time and exception information is inserted at all normal return points and exception ejection points of the method of the target class.
- 6. The method of claim 5, wherein the trace context is bound to the currently executing thread by way of thread local storage and the trace identification is passed to the child thread by way of encapsulating task objects when the image processing flow involves cross-thread operations.
- 7. The method of claim 5, wherein the performance data includes at least a method identification, a start time, an end time, a time consumption, anomaly information, and the tracking identification.
- 8. The method of claim 7, wherein the correlating the performance data of the call link with the corresponding Java virtual machine runtime environment data comprises: executing a time-consuming statistical index based on the time window calculation method; Finding out a slow method with time consumption exceeding a threshold value, and inquiring a calling link of the slow method to form a hot spot path; And carrying out association analysis on the hot spot path and Java virtual machine runtime environment data to determine the performance degradation reason.
- 9. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
- 11. A computer apparatus, comprising: A memory having a computer program stored thereon; A processor which when executing the computer program performs the steps of the method of any one of claims 1 to 8.
Description
Image batch processing performance monitoring and bottleneck diagnosis method, program product and device Technical Field The present invention relates to the field of image batch processing, and more particularly, to a method, program product, and apparatus for monitoring image batch processing performance and diagnosing bottlenecks. Background With the development of digital image technology, image batch processing services are widely applied to the fields of medical image analysis, security monitoring, industrial detection, internet content processing and the like. The service generally needs to execute various processing operations such as decoding, format conversion, feature extraction, compression storage, network uploading and the like on a large amount of image data, and has the advantages of complex processing flow, high consumption of computing resources and higher requirements on system performance and stability. Therefore, the method effectively monitors and analyzes the operation performance of the image batch processing service, and is an important means for guaranteeing the efficient operation of the system. Disclosure of Invention The invention provides a technical scheme for monitoring image batch processing performance and diagnosing bottleneck based on Java Agent. According to one embodiment of the invention, a Java Agent-based image batch processing performance monitoring and bottleneck diagnosis method is provided, which comprises the following steps: when an image processing service to be monitored is started, loading and initializing Java Agent; Performing byte code enhancement on a preset target class through the Java Agent, and implanting a monitoring code in a method of the target class; When the image processing service runs, the monitoring code is executed to acquire performance data of method execution, and generates a unique tracking identifier for the same image batch processing request based on the tracking context, and the cross-method and cross-thread performance data are associated through the tracking identifier; The collected performance data is sent to a performance analysis server; And the performance analysis server aggregates a complete call link based on the tracking identification, and performs association analysis on performance data of the call link and corresponding Java Virtual Machine (JVM) runtime environment data so as to identify performance bottlenecks in the image batch processing process and generate a diagnosis result. In some embodiments of the present invention, the method further includes visually displaying the diagnosis result and outputting alarm information when a preset alarm condition is satisfied. In some embodiments of the present invention, the Java Agent is encapsulated into a Jar package, and the Jar package is deployed in a server running the image processing service, where when the image processing service is started, the Java Agent is loaded in a starting or running process of a Java virtual machine corresponding to the image processing service. In some embodiments of the present invention, the target class includes at least an image processing related class, a file input/output related class, and a network communication related class. In some embodiments of the present invention, the byte code enhancement of the predetermined target class includes inserting a first monitoring code for recording a method identification, a start time and a trace context at an entry of a method of the target class, and inserting a second monitoring code for recording a method identification, an end time and exception information at all normal return points and exception cast points of the method of the target class. In some embodiments of the present invention, the tracking context is bound to the currently executing thread by a thread local storage means, and the tracking identifier is transferred to the sub-thread by means of encapsulating the task object when the image processing flow involves a cross-thread operation. In some embodiments of the invention, the performance data includes at least a method identification, a start time, an end time, a time consumption, exception information, and the tracking identification. In some embodiments of the present invention, the performing association analysis on the performance data of the call link and the corresponding Java virtual machine runtime environment data includes: executing a time-consuming statistical index based on the time window calculation method; Finding out a slow method with time consumption exceeding a threshold value, and inquiring a calling link of the slow method to form a hot spot path; And carrying out association analysis on the hot spot path and Java virtual machine runtime environment data to determine the performance degradation reason. According to another embodiment of the invention, a computer program product is provided, comprising a computer program which, when being executed