CN114356713A - Thread pool monitoring method and device, electronic equipment and storage medium - Google Patents

Thread pool monitoring method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114356713A
CN114356713A CN202210012189.0A CN202210012189A CN114356713A CN 114356713 A CN114356713 A CN 114356713A CN 202210012189 A CN202210012189 A CN 202210012189A CN 114356713 A CN114356713 A CN 114356713A
Authority
CN
China
Prior art keywords
thread pool
information
thread
present disclosure
pool information
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.)
Pending
Application number
CN202210012189.0A
Other languages
Chinese (zh)
Inventor
张学刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202210012189.0A priority Critical patent/CN114356713A/en
Publication of CN114356713A publication Critical patent/CN114356713A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a thread pool monitoring method, a thread pool monitoring device, an electronic device and a storage medium, wherein the method comprises the following steps: determining thread pool information according to a thread pool instance held by an agent class of a thread pool; generating a prompt message under the condition that the thread pool information meets the early warning condition; and outputting the prompt message.

Description

Thread pool monitoring method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a thread pool monitoring method, apparatus, electronic device, computer-readable storage medium, and computer program product.
Background
With the large-scale application of the pooling technology in the software field, the thread pool is increasingly applied to business scenes. When a problem occurs in the thread pool, an exception occurs in the service provided by the application program, and the experience of the client is affected.
Disclosure of Invention
The present disclosure provides a thread pool monitoring method, device, electronic device, computer-readable storage medium, and computer program product, which can generate a prompt message when thread pool information satisfies an early warning condition, prompt a risk of a thread pool having a problem, alleviate a problem of an application program error report caused by further deterioration of the thread pool, and achieve an effect of improving client experience.
One aspect of the present disclosure provides a thread pool monitoring method, including: determining thread pool information according to a thread pool instance held by an agent class of a thread pool; generating a prompt message under the condition that the thread pool information is determined to meet the early warning condition; and outputting the prompt message.
According to an embodiment of the present disclosure, the determining thread pool information according to the thread pool instance held by the proxy class of the thread pool includes: acquiring a thread pool instance held by the proxy class of the thread pool; and traversing the thread pool instance held by the proxy class of the thread pool to obtain the thread pool information.
According to the embodiment of the present disclosure, the thread pool monitoring method further includes: and acquiring the contact information of the specified object. The generating a prompt message when it is determined that the thread pool information satisfies the early warning condition includes: and under the condition that the thread pool information meets the early warning condition, generating a prompt message aiming at the specified object according to the contact information of the specified object.
According to an embodiment of the present disclosure, wherein the pre-warning condition comprises at least one of: the current active thread number in the thread pool is larger than or equal to a first threshold, wherein the current active thread number in the thread pool represents the thread number of the current processing request in the thread pool; and the ratio of the current active thread number in the thread pool to the maximum thread number of the thread pool is greater than or equal to a second threshold, wherein the maximum thread number of the thread pool represents the maximum value of the thread number which can be simultaneously accommodated in the thread pool.
According to the embodiment of the present disclosure, the thread pool monitoring method further includes: and carrying out fragment processing on the thread pool information and storing the thread pool information so as to display the stored thread pool information.
Another aspect of the present disclosure provides a thread pool monitoring system, including: the system comprises a thread pool information determining module, a prompt message generating module and a prompt message output module; the thread pool information determining module is used for determining thread pool information according to a thread pool instance held by an agent class of the thread pool; the prompt message generation module is used for generating a prompt message under the condition that the thread pool information is determined to meet the early warning condition; and the prompt information output module is used for outputting the prompt information.
According to an embodiment of the present disclosure, the thread pool monitoring system further includes: and the data processing module is used for carrying out fragment processing on the thread pool information and storing the thread pool information so as to display the stored thread pool information.
Another aspect of the disclosure provides an electronic device comprising one or more processors, further comprising memory for storing one or more programs; wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the methods of embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions for implementing the method of the embodiments of the present disclosure when executed.
Another aspect of the present disclosure provides a computer program product comprising computer-executable instructions that, when executed, implement the method of an embodiment of the present disclosure.
According to the embodiment of the disclosure, the running state of the thread pool is monitored, and the prompt message is generated under the condition that the information of the thread pool meets the early warning condition, so that the risk of the thread pool having problems can be prompted before the thread pool has problems, a user can conveniently intervene in the running state of the thread pool, the problem that an application program is mistakenly reported due to further deterioration of the thread pool is avoided, and the effect of improving the client experience is achieved. In addition, the embodiment of the disclosure also determines the thread pool information according to the thread pool instance of the agent class, so that the determined thread pool information is more comprehensive and is not easy to lose, thereby improving the accuracy of the monitoring result.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture to which the application thread pool monitoring method and apparatus of the present disclosure may be applied;
FIG. 2 schematically illustrates a flow diagram of a thread pool monitoring method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates an operational schematic diagram of a process for fragmenting thread pool information according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of a thread pool monitoring method according to another embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a thread pool monitoring system according to an embodiment of the present disclosure; and
FIG. 6 schematically illustrates a block diagram of an electronic device adapted to implement a thread pool monitoring method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
An embodiment of the present disclosure provides a thread pool monitoring method, including: determining thread pool information according to a thread pool instance held by an agent class of a thread pool; generating a prompt message under the condition that the thread pool information meets the early warning condition; and outputting the prompt message.
FIG. 1 schematically illustrates an exemplary system architecture 100 to which the thread pool monitoring method and apparatus may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and otherwise process data such as the received user request, and feed back a processing result (for example, thread pool information or prompt information obtained or generated according to the user request) to the terminal device.
It should be noted that the thread pool monitoring method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the thread pool monitoring system provided by the embodiments of the present disclosure may be generally disposed in the server 105. The thread pool monitoring method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the thread pool monitoring system provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the thread pool monitoring method provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the thread pool monitoring system provided by the embodiment of the present disclosure may also be disposed in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the thread pool to be monitored may be stored in any of the terminal devices 101, 102, or 103 (e.g., but not limited to terminal device 101), or stored on an external storage device and may be imported into terminal device 101. Then, the terminal device 101 may locally execute the thread pool monitoring method provided by the embodiment of the present disclosure, or send the thread pool to be monitored to another terminal device, a server, or a server cluster, and execute the thread pool monitoring method provided by the embodiment of the present disclosure by another terminal device, a server, or a server cluster that receives the thread pool to be monitored.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
FIG. 2 schematically shows a flow chart of a thread pool monitoring method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S230.
In operation S210, thread pool information is determined according to a thread pool instance held by an agent class of the thread pool.
The proxy class of a thread pool is a template that describes the behavior and state of an object (thread pool instance). The proxy class of the thread pool needs to be created in advance, and can be created through a proxy method. The thread pool instance is a specific thread pool, such as a thread pool to be monitored in an application.
The proxy class of the thread pool holds a thread pool instance representation: the agent class of the thread pool serves as a container, and thread pool instances created according to the agent class of the thread pool are stored. The number of thread pool instances held by the proxy class of the thread pool is not limited.
The thread pool information may include one or more of a name of an application corresponding to the thread pool, an IP address of the thread pool, a name of the thread pool, a number of tasks that the thread pool needs to execute, a current active number of threads in the number of threads, a core number of threads configured by the thread pool, a maximum number of threads configured by the thread pool, a number of queues in the current thread pool, a maximum number of threads created once, a number of tasks completed by the thread pool, and the like. The number of threads currently active in the thread pool represents the number of threads currently processing requests in the thread pool. The number of core threads configured by the thread pool indicates the number of threads that can be concurrently concurrent in the thread pool. The maximum thread number configured by the thread pool represents the maximum number of threads that can be accommodated in the thread pool at the same time. The maximum number of threads created represents the number of threads already in the thread pool, which may include the number of threads currently executing tasks and the number of threads currently not executing tasks.
In practical applications, when the number of the thread pools is large, multiple developers are required to create the thread pools, and it is considered that if each developer creates the thread pools in an own manner, the types of the created multiple thread pools are different. Therefore, in the subsequent process of collecting the thread pool information, the thread pool information needs to be collected from different types of thread pools respectively, and if some types of thread pools are omitted, the thread pool information is lost. In the embodiment of the present disclosure, the thread pools to be monitored are all created through the thread pool proxy class, and since the thread pool information is determined according to the thread pool instance held by the proxy class of the thread pool, some types of thread pools can be avoided from being omitted, and the problem of missing thread pool information is further alleviated.
In operation S220, in case it is determined that the thread pool information satisfies the early warning condition, a prompt message is generated.
The early warning condition is set by the user according to the requirement. For example, when the user needs to prompt when the load rate of the thread pool reaches the preset load rate, the ratio of the current active thread number to the maximum thread number may be set to be greater than or equal to the preset load rate.
In operation S230, a prompt message is output.
The prompt message is used for prompting the user so that the user can know that the thread pool information meets the early warning condition. The prompting message mode can include one or more modes of voice, text, mail, short message and the like.
It should be noted that operations S210 to S230 may be performed by an acquisition monitoring subsystem in the thread pool thread monitoring system, and the acquisition monitoring subsystem may include an asynchronous thread.
According to the embodiment of the disclosure, the running state of the thread pool is monitored, and the prompt message is generated under the condition that the information of the thread pool meets the early warning condition, so that the risk of the thread pool having problems can be prompted before the thread pool has problems, a user can conveniently intervene in the running state of the thread pool, the problem that an application program is mistakenly reported due to further deterioration of the thread pool is avoided, and the effect of improving the client experience is achieved.
According to another embodiment of the present disclosure, the pre-warning condition may include at least one of a first pre-warning condition and a second pre-warning condition. The first pre-warning condition may include a number of currently active threads in the thread pool being greater than or equal to a first threshold. The second warning condition may include a ratio of a current number of active threads in the thread pool to a maximum number of threads of the thread pool being greater than or equal to a second threshold.
In practical application, when there are at least two early warning conditions, the operation of determining that the thread pool information satisfies the early warning conditions may be: and determining that the thread pool information meets all early warning conditions. The following steps can be also included: determining that the thread pool information satisfies at least one early warning condition.
According to another embodiment of the present disclosure, referring to operation S210 in fig. 2, may include the following operations:
thread pool instances held by agent classes of the thread pool are obtained.
And traversing the thread pool instance held by the proxy class of the thread pool to obtain the thread pool information.
It should be noted that the operation of obtaining a thread pool instance held by an agent class of a thread pool may be in response to a query instruction. For example, a user queries the state of the thread pool at random, when the user needs to know whether the thread pool reaches an early warning condition, a query instruction is triggered, and the thread pool line monitoring device responds to the query instruction to acquire a thread pool instance held by an agent class of the thread pool. Considering that the thread pool information may vary according to the usage of the application, the thread pool instance held by the proxy class of the thread pool may also be obtained at a preset frequency, so as to obtain the current thread pool instance, where the preset frequency may be 1 second/time.
According to another embodiment of the present disclosure, the thread pool monitoring method may further include the following operations:
and acquiring the contact information of the specified object.
Accordingly, referring to operation S220 in fig. 2, may include the following operations: and under the condition that the thread pool information meets the early warning condition, generating a prompt message aiming at the specified object according to the contact information of the specified object.
It should be noted that the operation of acquiring the contact information of the specified object may be performed by the collection monitoring subsystem in the thread pool thread monitoring system.
The designated object may be a user responsible for maintaining and managing the thread pool. The contact information may be a telephone number, a mailbox address, etc. According to the contact information of the specified object, the operation of generating the prompt message for the specified object may be: and sending a prompt message by sending a mail, sending a short message, making a call and the like to the user according to the contact way of the user in charge of maintaining and managing the thread pool.
It should be noted that the operations of the embodiments of the present disclosure may be implemented by the following processes: for example, contact information of a specified object is acquired, and then whether the thread pool information meets an early warning condition is judged. If not, operation S210 in fig. 2 may be re-entered, or the next query instruction is waited and then operation S210 in fig. 2 is re-entered after the next query instruction is received. If yes, a prompt message for the specified object can be generated according to the contact information of the specified object. For another example, whether the thread pool information meets the early warning condition is judged. If not, operation S210 in fig. 2 may be re-entered, or the next query instruction is waited and then operation S210 in fig. 2 is re-entered after the next query instruction is received. If yes, the contact information of the specified object can be obtained, and then the prompt message aiming at the specified object is generated according to the contact information of the specified object.
According to another embodiment of the present disclosure, the thread pool monitoring method may further include the following operations:
and carrying out fragment processing on the thread pool information and storing the thread pool information so as to display the stored thread pool information.
It should be noted that, the thread pool monitoring system may include an acquisition monitoring subsystem and a message processing subsystem, and at least part of functions of the acquisition monitoring subsystem and the message processing subsystem may be integrated in one system. After the collection monitoring subsystem determines the thread pool information, the thread pool information can be output to the message processing subsystem, and the message processing subsystem performs fragment processing and storage on the thread pool information.
The operation of the collection monitoring subsystem outputting the thread pool information to the message processing subsystem may include: and the collection monitoring subsystem outputs the thread pool information to the message system. In one example, a message system may be implemented using Kafka (a high throughput distributed publish-subscribe message system) and then send thread pool information to the message handling subsystem upon request by the message handling subsystem.
The specific way of collecting the thread pool information output by the monitoring subsystem is not limited. In some embodiments, the thread pool information may be output by asynchronous threads. In practical applications, considering that the thread pool needs to handle core services, for example, in electronic commerce, the core task that the thread pool of an application needs to handle is ordering. The importance of the output thread pool information is lower than that of ordering, and in order to ensure that the ordering task can be executed in time, the thread pool information can be output through an asynchronous thread, so that the ordering task and the task of outputting the thread pool information are asynchronously carried out, and the ordering process is prevented from being influenced by the process of transmitting the thread pool information. In other embodiments, the thread pool information may also be directly output through the proxy mode of the proxy class, and the task processed by the thread pool is synchronized with the task outputting the thread pool information.
As shown in fig. 3, fig. 3 schematically illustrates an operation principle diagram of the fragmentation processing of the thread pool information according to the embodiment of the present disclosure. In the example of FIG. 3, Storm is a real-time computing framework. Spitout 310 represents a data generator for acquiring data. Bolt320 represents a node for implementing data processing logic. The TSDB (Time Series & Spatial Temporal Database) 330 is a storage medium for storing data.
The message processing subsystem can perform fragmentation processing on data through a real-time computing framework. The data processed by the message processing subsystem comprises thread pool messages and can also comprise early warning conditions and contact information of contacts. The real-time computing framework may be Storm or Flink, and the real-time computing framework may perform fragmentation processing on the data, that is, after the Spout310 acquires the data, the data is distributed to the plurality of bolts 320, the plurality of bolts 320 are used for processing the data, and the pressure of each Bolt320 is dispersed. After the message processing subsystem performs fragmentation processing on the current thread pool, the data is allocated to a plurality of storage media for storage, and the storage media may be the TSDB 330. The data storage dimension of the storage medium may include one or more types of data in the thread pool information, and may also include the pre-warning condition and contact information of the contact.
In practical applications, the stored data may be displayed by a display device. Because the data is subjected to the slicing processing, the data storage rate is higher, and the displayed data has better real-time performance. In addition, the thread pool information can be visually displayed through the display device, and historical data is provided for a user, so that the user can conveniently and reasonably set the thread pool by taking the historical data as a reference for setting the thread pool.
Referring to fig. 4, a thread pool monitoring method according to the present disclosure is described below in a specific embodiment. The method includes operations S410 to S460. It will be understood by those skilled in the art that the following examples are illustrative only, and the present disclosure is not limited thereto.
It should be noted that, the thread pool monitoring system may include an acquisition monitoring subsystem and a message processing subsystem, and at least part of functions of the acquisition monitoring subsystem and the message processing subsystem may be integrated in one system. Operation S430 of operations S410 to S460 may be performed by the message processing subsystem, and the remaining operations may be performed by the acquisition monitoring subsystem.
In operation S410, an early warning condition is acquired.
For example, after the application program to be monitored accesses the collection monitoring subsystem in the thread pool monitoring system, the user may enter the early warning condition into the database of the collection monitoring subsystem. The acquisition monitoring subsystem acquires the early warning condition in a reading mode.
In operation S420, a thread pool instance held by the agent class of the thread pool is obtained, and the thread pool instance held by the agent class of the thread pool is traversed to obtain thread pool information.
In operation S430, the thread pool information is sliced and stored so that the stored thread pool information is displayed.
For example, the thread pool information may be output by the collection monitoring subsystem Kafka, then output by Kafka to the message processing subsystem, and then the thread pool information is fragmented by the message processing subsystem and stored in the storage medium.
In operation S440, it is determined whether the thread pool information satisfies an early warning condition. If so, execution proceeds to operation S450. If not, operation S420 may be re-executed.
In operation S450, contact information of a designated object is acquired.
For example, after the application program to be monitored accesses the collection monitoring subsystem in the thread pool monitoring system, the user may enter the contact information of the specified object into the database of the collection monitoring subsystem. The collection monitoring subsystem obtains the contact information of the designated object in a reading mode.
In operation S460, a prompt message for the designated object is generated according to the contact information of the designated object.
For example, the prompt message is output by sending a mail, sending a short message, or making a call to a specified object.
FIG. 5 schematically shows a block diagram of a thread pool monitoring system according to an embodiment of the disclosure.
As shown in FIG. 5, the thread pool monitoring system 500 may include an acquisition monitoring subsystem that includes a thread pool information determination module 510, a hint message generation module 520, and a hint information output module 530. The thread pool information determining module 510 is configured to determine thread pool information according to a thread pool instance held by an agent class of the thread pool. The prompt message generating module 520 is configured to generate a prompt message when it is determined that the thread pool information satisfies the early warning condition. The prompt message output module 530 is used for outputting prompt messages.
According to another embodiment of the present disclosure, the thread pool information determination module 510 includes an acquisition sub-module and a traversal sub-module. The obtaining submodule is used for obtaining the thread pool instance held by the proxy class of the thread pool. And the traversal submodule is used for traversing the thread pool instance held by the proxy class of the thread pool to obtain the thread pool information.
According to another embodiment of the present disclosure, the collection monitoring subsystem in the thread pool monitoring system 500 further includes a contact information obtaining module, which is used for obtaining contact information of a specified object. Accordingly, the prompt message generation module 520 includes a prompt message generation sub-module, which is configured to generate a prompt message for the specified object according to the contact information of the specified object when it is determined that the thread pool information satisfies the early warning condition.
According to another embodiment of the present disclosure, the thread pool monitoring system 500 further comprises a message processing subsystem, and the message processing subsystem comprises a data processing module, which is configured to perform fragmentation processing on the thread pool information and store the thread pool information so as to display the stored thread pool information.
It should be noted that, the embodiments of the apparatus portion of the present disclosure correspond to the same or similar embodiments of the method portion of the present disclosure, and the detailed description of the present disclosure is omitted here.
Any number of modules, sub-modules, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules and sub-modules according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging the circuit, or in any one of three implementations, or in any suitable combination of any of the three. Alternatively, one or more of the modules, sub-modules, according to embodiments of the disclosure may be implemented at least in part as computer program modules, which when executed, may perform corresponding functions.
For example, any number of the thread pool information determining module 510, the hint message generating module 520, and the hint information output module 530 can be combined into one module/unit/sub-unit to be implemented, or any one of the modules/units/sub-units can be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the thread pool information determining module 510, the hint message generating module 520, and the hint information outputting module 530 can be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or can be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, at least one of the thread pool information determining module 510, the hint message generating module 520, and the hint information output module 530 can be implemented at least in part as a computer program module that, when executed, can perform corresponding functions.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A thread pool monitoring method comprises the following steps:
determining thread pool information according to a thread pool instance held by an agent class of a thread pool;
generating a prompt message under the condition that the thread pool information is determined to meet the early warning condition; and
and outputting the prompt information.
2. The method of claim 1, wherein determining thread pool information from thread pool instances held by agent classes of a thread pool comprises:
acquiring a thread pool instance held by the proxy class of the thread pool; and
and traversing the thread pool instance held by the proxy class of the thread pool to obtain the thread pool information.
3. The method of claim 1, further comprising:
acquiring contact information of a specified object;
the generating a prompt message when it is determined that the thread pool information satisfies the early warning condition includes:
and under the condition that the thread pool information meets the early warning condition, generating a prompt message aiming at the specified object according to the contact information of the specified object.
4. The method of claim 1, wherein the pre-warning condition comprises at least one of:
the current active thread number in the thread pool is larger than or equal to a first threshold, wherein the current active thread number in the thread pool represents the thread number of the current processing request in the thread pool;
and the ratio of the current active thread number in the thread pool to the maximum thread number of the thread pool is greater than or equal to a second threshold, wherein the maximum thread number of the thread pool represents the maximum value of the thread number which can be simultaneously accommodated in the thread pool.
5. The method of any of claims 1 to 4, further comprising:
and carrying out fragment processing on the thread pool information and storing the thread pool information so as to display the stored thread pool information.
6. A thread pool monitoring system, comprising:
the thread pool information determining module is used for determining thread pool information according to a thread pool instance held by the proxy class of the thread pool;
the prompt message generation module is used for generating a prompt message under the condition that the thread pool information is determined to meet the early warning condition; and
and the prompt information output module is used for outputting the prompt information.
7. The system of claim 6, further comprising:
and the data processing module is used for carrying out fragment processing on the thread pool information and storing the thread pool information so as to display the stored thread pool information.
8. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
10. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 5 when executed.
CN202210012189.0A 2022-01-06 2022-01-06 Thread pool monitoring method and device, electronic equipment and storage medium Pending CN114356713A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210012189.0A CN114356713A (en) 2022-01-06 2022-01-06 Thread pool monitoring method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210012189.0A CN114356713A (en) 2022-01-06 2022-01-06 Thread pool monitoring method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114356713A true CN114356713A (en) 2022-04-15

Family

ID=81107527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210012189.0A Pending CN114356713A (en) 2022-01-06 2022-01-06 Thread pool monitoring method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114356713A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981962A (en) * 2022-12-30 2023-04-18 北京基调网络股份有限公司 Thread pool monitoring method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981962A (en) * 2022-12-30 2023-04-18 北京基调网络股份有限公司 Thread pool monitoring method and device, electronic equipment and storage medium
CN115981962B (en) * 2022-12-30 2024-03-12 北京基调网络股份有限公司 Thread pool monitoring method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109033814B (en) Intelligent contract triggering method, device, equipment and storage medium
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN111125107A (en) Data processing method, device, electronic equipment and medium
US20160127217A1 (en) Business transaction context for call graph
CN114356713A (en) Thread pool monitoring method and device, electronic equipment and storage medium
CN106911784B (en) Method and device for executing asynchronous event
CN112882895A (en) Health examination method, device, computer system and readable storage medium
CN111831503B (en) Monitoring method based on monitoring agent and monitoring agent device
CN108390770B (en) Information generation method and device and server
CN114237765B (en) Functional component processing method, device, electronic equipment and medium
CN113535439B (en) Service request processing method, device, equipment and storage medium
CN114201508A (en) Data processing method, data processing apparatus, electronic device, and storage medium
CN113138772B (en) Construction method and device of data processing platform, electronic equipment and storage medium
CN114168607A (en) Global serial number generation method, device, equipment, medium and product
CN114116782A (en) Distributed database resource control method and device, electronic equipment and storage medium
CN112579282A (en) Data processing method, device, system and computer readable storage medium
CN116450465B (en) Data processing method, device, equipment and medium
CN114268558B (en) Method, device, equipment and medium for generating monitoring graph
US11722451B2 (en) Distributing event messages from a first service to additional services using a message store
CN117271277A (en) Alarming method, device, equipment and storage medium for abnormal service
CN114116518A (en) Data processing method, device, electronic equipment and medium
CN115373802A (en) Method and device for restarting agent system, electronic equipment and storage medium
CN115373846A (en) Method and device for preventing overflow of thread pool, electronic equipment and storage medium
CN114372035A (en) Data file processing method and device and electronic equipment
CN116775307A (en) Service processing method, device, equipment and storage medium

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