CN111045891A - Java multithreading-based monitoring method, device, equipment and storage medium - Google Patents
Java multithreading-based monitoring method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111045891A CN111045891A CN201911267533.5A CN201911267533A CN111045891A CN 111045891 A CN111045891 A CN 111045891A CN 201911267533 A CN201911267533 A CN 201911267533A CN 111045891 A CN111045891 A CN 111045891A
- Authority
- CN
- China
- Prior art keywords
- monitoring
- interface
- class
- thread
- java
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012544 monitoring process Methods 0.000 title claims abstract description 224
- 238000000034 method Methods 0.000 title claims abstract description 56
- 238000004088 simulation Methods 0.000 claims abstract description 29
- 238000004590 computer program Methods 0.000 claims description 13
- 238000002372 labelling Methods 0.000 claims description 13
- 230000006399 behavior Effects 0.000 claims description 6
- 238000002347 injection Methods 0.000 claims description 2
- 239000007924 injection Substances 0.000 claims description 2
- 238000012806 monitoring device Methods 0.000 abstract description 6
- 238000012360 testing method Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012552 review Methods 0.000 description 2
- 239000000243 solution Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000010835 comparative analysis Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000013024 troubleshooting Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3051—Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3089—Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the invention discloses a java multithreading-based monitoring method, a java multithreading-based monitoring device, java multithreading-based monitoring equipment and a storage medium, wherein the method comprises the following steps: accessing a monitoring interface into a Spring class; generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine; monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result; and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal. According to the invention, the monitoring interface is arranged to automatically check and analyze the result of the concurrent thread, and the analysis result is fed back to the user, so that a large amount of manpower can be saved and the testing efficiency can be improved.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a java multithreading-based monitoring method, a java multithreading-based monitoring device, java multithreading-based monitoring equipment and a java multithreading-based storage medium.
Background
In the prior art, in some concurrent scenarios, a code review mode is usually used for code which is unsafe to thread. However, if the traffic is large and the code design is complex, it is difficult to perform the troubleshooting on the codes which are unsafe to the threads in the code review manner, and at the same time, we also need to perform the performance analysis on the unsafe problems of the threads.
Disclosure of Invention
In view of this, embodiments of the present invention provide a java multithreading-based monitoring method, apparatus, device and storage medium, where a monitoring interface is configured to automatically check and analyze results of concurrent threads, and feed back an analysis result to a user, so that a large amount of manpower can be saved and test efficiency can be improved.
In one aspect, an embodiment of the present invention provides a java multithreading-based monitoring method, where the method includes:
accessing a monitoring interface into a Spring class;
generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine;
monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result;
and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
In another aspect, an embodiment of the present invention provides a java multithreading-based monitoring apparatus, where the apparatus includes:
the access unit is used for accessing the monitoring interface into the Spring class;
the generation unit is used for generating a plurality of request threads for concurrent simulation in a thread pool of the java virtual machine;
the monitoring and recording unit is used for monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface and recording a monitoring result;
and the analysis sending unit is used for analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
In yet another aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the monitoring method based on java multithreading as described above is implemented.
In yet another aspect, the present invention also provides a computer readable storage medium, which stores one or more computer programs that can be executed by one or more processors to implement the java multithreading-based monitoring method as described above.
The embodiment of the invention provides a monitoring method, a monitoring device, monitoring equipment and a storage medium based on java multithreading, wherein the method comprises the following steps: accessing a monitoring interface into a Spring class; generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine; monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result; and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal. According to the invention, the monitoring interface is arranged to automatically check and analyze the result of the concurrent thread, and the analysis result is fed back to the user, so that a large amount of manpower can be saved and the testing efficiency can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is an application scenario diagram of a java multithreading-based monitoring method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a java multithreading-based monitoring method according to an embodiment of the present invention;
FIG. 3 is another schematic flow chart of a java multithreading-based monitoring method according to an embodiment of the present invention;
FIG. 4 is a schematic block diagram of a java multithreading-based monitoring apparatus provided by an embodiment of the present invention;
FIG. 5 is another schematic block diagram of a java multithreading-based monitoring apparatus provided by an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic view of an application scenario of a monitoring method based on java multithreading according to an embodiment of the present invention, and fig. 2 is a schematic flow diagram of the monitoring method based on java multithreading according to the embodiment of the present invention. The java multithreading-based monitoring method is applied to a java virtual machine. As an application, as shown in fig. 1, the java multithreading based monitoring method is applied to a java virtual machine 10, and the java virtual machine 10 monitors and analyzes the running result of the concurrent threads, and sends the analysis result to a user terminal 20 to notify a user, such as a developer, to perform subsequent processing according to the analysis result, wherein the user terminal is a terminal device used by the developer, such as a desktop computer, a notebook computer, or a smart phone.
Referring to fig. 2, fig. 2 is a schematic flow chart of a java multithreading-based monitoring method according to an embodiment of the present invention. As shown in fig. 2, the method includes the following steps S101 to S104.
S101, accessing the monitoring interface into a Spring class.
In the embodiment of the present invention, the monitoring interface is formed by compiling a monitoring code written by a user in a self-defined manner in a Spring class, in this embodiment, the monitoring interface is implemented in an aop (Aspect-Oriented Programming) manner, so-called aop refers to a Programming scheme for intercepting before and after execution of a method or when an exception is thrown in a dynamic proxy manner, and the monitoring interface can be formed by compiling a code of a monitoring target method in an interceptor of the dynamic proxy by using a aop technology.
Specifically, referring to fig. 3, the step S101 includes steps S201 to S203:
s201, declaring a section class in a Spring class, and labeling the section class by using a first preset mark.
In the embodiment of the invention, a tangent plane class is declared in a Spring class through a tangent plane function provided by an AspectJ framework, and the declared tangent plane class is labeled by using a first preset mark, for example, labeled by using "@ Aspect", and the labeling is for the purpose of explaining that the tangent plane class is a tangent plane class.
S202, declaring a monitoring method in the section class, and injecting a monitoring code into the monitoring method.
In the embodiment of the present invention, after the section class is declared, a monitoring method is declared in the declared section class, and a code to be monitored is written by the monitoring method.
And S203, marking the injected monitoring code by using a second preset mark, and compiling the monitoring code.
In the embodiment of the present invention, after the monitoring code is written, a second preset mark is used for labeling on the monitoring method, for example, a "@ Around" mark is used for labeling, and a specific format for labeling by using the "@ Around" is as follows: @ Around ("@ annotation (custom annotation name)"), wherein the annotation name can be selected by the user, and is not limited herein, and after the monitoring code is labeled, the custom annotation is compiled, so that the monitoring interface is accessed into the spring class.
S102, generating a plurality of request threads for concurrent simulation in a thread pool of the java virtual machine.
In this embodiment of the present invention, the generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine specifically includes: generating a plurality of request threads for concurrent simulation through Thread classes of the inheritance Thread pool; alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool. Specifically, a plurality of request threads for concurrent simulation are generated in a thread pool of the java virtual machine, and the generated request threads are used for monitoring the performance of the java virtual machine and acquiring various performance parameters of the java virtual machine through operation. The method for generating the request Thread in the Thread pool can be obtained by inheriting the Thread class of the Thread pool, and can also be obtained by realizing a Runnable interface of the Thread pool. The method comprises the steps that a first request thread generated in a thread pool is used for obtaining an initial result and initial performance parameters of a java virtual machine; when the java virtual machine needs to process a large number of tasks, more request threads are generated in the thread pool to monitor the performance of the java virtual machine.
S103, monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result.
In this embodiment of the present invention, the monitoring, by using the monitoring interface, a plurality of request threads generated in the java virtual machine, and recording the monitoring result specifically includes: and recording the initialization performance parameters, thread unsafe behavior information and thread overhead information acquired when the requesting thread runs by using the monitoring interface. Specifically, the first request thread generated by the thread pool is used for acquiring an initial result and an initial performance parameter of the java virtual machine. When the java virtual machine needs to process a large number of tasks, more request threads are generated in the thread pool to monitor the performance of the java virtual machine. And recording the initialization performance parameters, thread unsafe behavior information and thread overhead information acquired when the request thread runs by using the monitoring interface.
And S104, analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
In the embodiment of the present invention, analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal specifically includes: and comparing the monitoring result recorded by the monitoring interface with a preset normal monitoring result, if the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, generating alarm information, and sending the alarm information to the preset user terminal to inform the relevant user terminal.
Specifically, after the running of the concurrently simulated request thread is finished, the monitoring result of the monitoring interface needs to be analyzed. Before analyzing the monitoring result, preparing a normal monitoring result in advance for comparative analysis. If the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, the problem of thread safety of the monitored thread can be determined. For example: when a multi-request thread is simulated concurrently, if the possible reason of stack overflow is that the recursion depth is too large, and if the possible reason of too long response time is that loop query is adopted. Through the analysis of the result and the feedback to the developer, the developer can be specifically informed of optimizing the thread with problems in the form of mails, automatic investigation and analysis are realized through the monitoring interface, the analysis result is fed back to the developer, a large amount of manpower can be saved, and the test efficiency can be improved.
As can be seen from the above, in the embodiment of the present invention, the monitoring interface is accessed into the Spring class; generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine; monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result; and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal. According to the invention, the monitoring interface is arranged to automatically check and analyze the result of the concurrent thread, and the analysis result is fed back to the user, so that a large amount of manpower can be saved and the testing efficiency can be improved.
Referring to fig. 4, in response to the java multithreading-based monitoring method, an embodiment of the present invention further provides a java multithreading-based monitoring apparatus, where the apparatus 100 includes: access unit 101, generation unit 102, monitoring and recording unit 103, analysis and transmission unit 104.
The access unit 101 is configured to access a monitoring interface into a Spring class; the generation unit 102 is used for generating a plurality of request threads for concurrent simulation in a thread pool of the java virtual machine; the monitoring and recording unit 103 is used for monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface and recording a monitoring result; and the analysis sending unit 104 is configured to analyze the monitoring result recorded by the monitoring interface and send the analysis result to the user terminal.
Referring to fig. 5, the access unit 101 includes: the first labeling unit 101a is configured to declare a cut-to-surface class in a Spring class, and label the cut-to-surface class by using a first preset mark; a code injection unit 101b, configured to declare a monitoring method in the section class, and inject a monitoring code into the monitoring method; and the second labeling unit 101c is configured to label the injected monitoring code with a second preset label, and compile the monitoring code.
The generating unit 102 is specifically configured to generate multiple request threads for concurrent simulation through a Thread class inheriting a Thread pool; alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool.
The monitoring and recording unit 103 is specifically configured to record, by using the monitoring interface, initialization performance parameters, thread unsafe behavior information, and thread overhead information that are obtained when the requesting thread runs.
The analysis sending unit 104 is specifically configured to compare the monitoring result recorded by the monitoring interface with a preset normal monitoring result, generate an alarm message if the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, and send the alarm message to the user terminal.
As can be seen from the above, in the embodiment of the present invention, the monitoring interface is accessed into the Spring class; generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine; monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result; and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal. According to the invention, the monitoring interface is arranged to automatically check and analyze the result of the concurrent thread, and the analysis result is fed back to the user, so that a large amount of manpower can be saved and the testing efficiency can be improved.
The java multithreading-based monitoring device corresponds to the java multithreading-based monitoring method one to one, and the specific principle and process of the java multithreading-based monitoring device are the same as those of the method in the embodiment, and are not described again.
The java multithreading based monitoring apparatus may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 6.
FIG. 6 is a schematic diagram of a computer device according to the present invention. The device can be a terminal or a server, wherein the terminal can be an electronic device such as a notebook computer, a desktop computer and the like. The server may be an independent server or a server cluster composed of a plurality of servers. Referring to fig. 6, the computer apparatus 500 includes a processor 502, a nonvolatile storage medium 503, an internal memory 504, and a network interface 505, which are connected by a system bus 501. The non-volatile storage medium 503 of the computer device 500 may store, among other things, an operating system 5031 and a computer program 5032 that, when executed, causes the processor 502 to perform a java multithreading based monitoring method. The processor 502 of the computer device 500 is used to provide computing and control capabilities that support the overall operation of the computer device 500. The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which when executed by the processor causes the processor 502 to perform a java multithreading based monitoring method. The network interface 505 of the computer device 500 is used for network communication. Those skilled in the art will appreciate that the illustration in fig. 6 is merely a block diagram of a portion of the structure associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those illustrated, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 implements the following operations when executing the computer program:
accessing a monitoring interface into a Spring class;
generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine;
monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result;
and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
In one embodiment, the accessing the monitoring interface into the Spring class includes:
declaring a cut-to-surface class in a Spring class, and marking the cut-to-surface class by using a first preset mark;
declaring a monitoring method in the section class, and injecting a monitoring code into the monitoring method;
and marking the injected monitoring code by using a second preset mark, and compiling the monitoring code.
In one embodiment, the generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine includes:
generating a plurality of request threads for concurrent simulation through Thread classes of the inheritance Thread pool; alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool.
In an embodiment, the monitoring, with the monitoring interface, a plurality of request threads generated in the java virtual machine, and recording a monitoring result includes:
and recording the initialization performance parameters, thread unsafe behavior information and thread overhead information acquired when the requesting thread runs by using the monitoring interface.
In an embodiment, the analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal includes:
and comparing the monitoring result recorded by the monitoring interface with a preset normal monitoring result, if the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, generating alarm information, and sending the alarm information to the user terminal.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 6 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device only includes a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are the same as those of the embodiment shown in fig. 6, and are not described herein again.
The present invention provides a computer readable storage medium storing one or more computer programs, the one or more computer programs being executable by one or more processors to perform the steps of:
accessing a monitoring interface into a Spring class;
generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine;
monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result;
and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
In one embodiment, the accessing the monitoring interface into the Spring class includes:
declaring a cut-to-surface class in a Spring class, and marking the cut-to-surface class by using a first preset mark;
declaring a monitoring method in the section class, and injecting a monitoring code into the monitoring method;
and marking the injected monitoring code by using a second preset mark, and compiling the monitoring code.
In one embodiment, the generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine includes:
generating a plurality of request threads for concurrent simulation through Thread classes of the inheritance Thread pool; alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool.
In an embodiment, the monitoring, with the monitoring interface, a plurality of request threads generated in the java virtual machine, and recording a monitoring result includes:
and recording the initialization performance parameters, thread unsafe behavior information and thread overhead information acquired when the requesting thread runs by using the monitoring interface.
In an embodiment, the analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal includes:
and comparing the monitoring result recorded by the monitoring interface with a preset normal monitoring result, if the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, generating alarm information, and sending the alarm information to the user terminal.
The foregoing storage medium of the present invention includes: various media that can store program codes, such as a magnetic disk, an optical disk, and a Read-Only Memory (ROM).
The elements of all embodiments of the present invention may be implemented by a general purpose integrated circuit, such as a CPU (central processing Unit), or by an ASIC (Application Specific integrated circuit).
The steps in the java multithreading-based monitoring method in the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The units in the java multithreading-based monitoring device can be merged, divided and deleted according to actual needs.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A java multithreading-based monitoring method, comprising:
accessing a monitoring interface into a Spring class;
generating a plurality of request threads for concurrent simulation in a thread pool of a java virtual machine;
monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface, and recording a monitoring result;
and analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
2. The method of claim 1, wherein the accessing the monitoring interface into a Spring class comprises:
declaring a cut-to-surface class in a Spring class, and marking the cut-to-surface class by using a first preset mark;
declaring a monitoring method in the section class, and injecting a monitoring code into the monitoring method;
and marking the injected monitoring code by using a second preset mark, and compiling the monitoring code.
3. The method of claim 1, wherein generating multiple requesting threads for concurrent simulation in a thread pool of a java virtual machine comprises:
generating a plurality of request threads for concurrent simulation through Thread classes of the inheritance Thread pool;
alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool.
4. The method as claimed in claim 1, wherein the monitoring the plurality of request threads generated in the java virtual machine by using the monitoring interface and recording the monitoring result comprises:
and recording the initialization performance parameters, thread unsafe behavior information and thread overhead information acquired when the requesting thread runs by using the monitoring interface.
5. The method of claim 1, wherein analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal comprises:
and comparing the monitoring result recorded by the monitoring interface with a preset normal monitoring result, if the monitoring result recorded by the monitoring interface is inconsistent with the preset normal monitoring result, generating alarm information, and sending the alarm information to the user terminal.
6. A java multithreading-based monitor apparatus, comprising:
the access unit is used for accessing the monitoring interface into the Spring class;
the generation unit is used for generating a plurality of request threads for concurrent simulation in a thread pool of the java virtual machine;
the monitoring and recording unit is used for monitoring a plurality of request threads generated in the java virtual machine by using the monitoring interface and recording a monitoring result;
and the analysis sending unit is used for analyzing the monitoring result recorded by the monitoring interface and sending the analysis result to the user terminal.
7. The apparatus of claim 6, wherein the access unit comprises:
the system comprises a first labeling unit, a second labeling unit and a judging unit, wherein the first labeling unit is used for declaring a cut-to-face class in a Spring class and labeling the cut-to-face class by using a first preset mark;
a code injection unit, which is used for declaring a monitoring method in the section class and injecting a monitoring code in the monitoring method;
and the second labeling unit is used for labeling the injected monitoring code by using a second preset mark and compiling the monitoring code.
8. The apparatus according to claim 6, wherein the generating unit is specifically configured to generate a plurality of request threads for concurrent simulation by inheriting a Thread class of a Thread pool; alternatively, multiple requesting threads for concurrent simulation are generated through a Runnable interface implementing a thread pool.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the java multithreading-based monitoring method as claimed in any one of claims 1 to 5 when executing the computer program.
10. A computer readable storage medium storing one or more computer programs, the one or more computer programs being executable by one or more processors to implement the java multithreading-based monitoring method as claimed in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911267533.5A CN111045891B (en) | 2019-12-11 | 2019-12-11 | Monitoring method, device, equipment and storage medium based on java multithreading |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911267533.5A CN111045891B (en) | 2019-12-11 | 2019-12-11 | Monitoring method, device, equipment and storage medium based on java multithreading |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111045891A true CN111045891A (en) | 2020-04-21 |
CN111045891B CN111045891B (en) | 2024-03-19 |
Family
ID=70235703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911267533.5A Active CN111045891B (en) | 2019-12-11 | 2019-12-11 | Monitoring method, device, equipment and storage medium based on java multithreading |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111045891B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111813633A (en) * | 2020-07-20 | 2020-10-23 | 前海人寿保险股份有限公司 | Performance monitoring method, device, equipment and readable storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130227528A1 (en) * | 2012-02-29 | 2013-08-29 | International Business Machines Corporation | Paradigm for concurrency testcase generation |
CN103838654A (en) * | 2012-11-27 | 2014-06-04 | 重庆新媒农信科技有限公司 | Multithreading and concurrency testing simulator and testing method thereof |
US20180189160A1 (en) * | 2016-12-30 | 2018-07-05 | Intel Corporation | Apparatus and method for multithreading-aware performance monitoring events |
CN109284227A (en) * | 2018-09-06 | 2019-01-29 | 政采云有限公司 | A kind of automation method for testing pressure and device calculate equipment and storage medium |
CN109766241A (en) * | 2018-12-29 | 2019-05-17 | 中国银行股份有限公司 | System monitoring method, apparatus, computer equipment and computer readable storage medium |
CN110290212A (en) * | 2019-06-28 | 2019-09-27 | 浙江大搜车软件技术有限公司 | Service call recording method, device, computer equipment and storage medium |
CN110445669A (en) * | 2019-06-26 | 2019-11-12 | 苏州浪潮智能科技有限公司 | A kind of monitoring method, equipment and the readable medium of the server based on association's journey |
-
2019
- 2019-12-11 CN CN201911267533.5A patent/CN111045891B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130227528A1 (en) * | 2012-02-29 | 2013-08-29 | International Business Machines Corporation | Paradigm for concurrency testcase generation |
CN103838654A (en) * | 2012-11-27 | 2014-06-04 | 重庆新媒农信科技有限公司 | Multithreading and concurrency testing simulator and testing method thereof |
US20180189160A1 (en) * | 2016-12-30 | 2018-07-05 | Intel Corporation | Apparatus and method for multithreading-aware performance monitoring events |
CN109284227A (en) * | 2018-09-06 | 2019-01-29 | 政采云有限公司 | A kind of automation method for testing pressure and device calculate equipment and storage medium |
CN109766241A (en) * | 2018-12-29 | 2019-05-17 | 中国银行股份有限公司 | System monitoring method, apparatus, computer equipment and computer readable storage medium |
CN110445669A (en) * | 2019-06-26 | 2019-11-12 | 苏州浪潮智能科技有限公司 | A kind of monitoring method, equipment and the readable medium of the server based on association's journey |
CN110290212A (en) * | 2019-06-28 | 2019-09-27 | 浙江大搜车软件技术有限公司 | Service call recording method, device, computer equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111813633A (en) * | 2020-07-20 | 2020-10-23 | 前海人寿保险股份有限公司 | Performance monitoring method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111045891B (en) | 2024-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7818721B2 (en) | Dynamic application tracing in virtual machine environments | |
US8978020B2 (en) | Generating reusable test components out of remote application programming interface | |
US10303490B2 (en) | Apparatus and method for optimizing startup of embedded system | |
EP2442230B1 (en) | Two pass automated application instrumentation | |
US8719784B2 (en) | Assigning runtime artifacts to software components | |
US20160092248A1 (en) | Hook framework | |
US8312417B2 (en) | Using dynamic call graphs for creating state machines | |
US9940478B2 (en) | Fine-grained user control over usages of sensitive system resources having private data with applications in privacy enforcement | |
US20210173665A1 (en) | Bootstrapping Profile-Guided Compilation and Verification | |
KR20080099247A (en) | Qualitatively annotated code | |
US8151251B2 (en) | e-Profiler: dynamic profiling and auditing framework | |
CN114531477B (en) | Method and device for configuring functional components, computer equipment and storage medium | |
Farooq et al. | Runtimedroid: Restarting-free runtime change handling for android apps | |
Tang et al. | Xdebloat: Towards automated feature-oriented app debloating | |
US20070067762A1 (en) | Exposing code contentions | |
CN112181388B (en) | Initializing method and device of SDK (software development kit) component, storage medium and control terminal | |
CN111045891A (en) | Java multithreading-based monitoring method, device, equipment and storage medium | |
US20080115109A1 (en) | Enhanced Hover Help For Software Debuggers | |
US11263115B2 (en) | Problem diagnosis technique of memory corruption based on regular expression generated during application compiling | |
Leonhardt et al. | Unlocking the heterogeneous landscape of big data NLP with DUUI | |
JP5525658B2 (en) | Computer, resource usage calculation method, and resource usage calculation program | |
Marra et al. | Framework-aware debugging with stack tailoring | |
CN115686676B (en) | Dynamic calling method and device for object and electronic equipment | |
Gioachin et al. | Dynamic high-level scripting in parallel applications | |
CN107632934B (en) | Function copying method and device in C-sharp |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |