Database connection pool monitoring method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202280004219.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2024-11-26
AI Technical Summary
The existing Druid database connection pool monitoring technology fails to work effectively in cloud native scenarios, and does not support integration with the Prometheus monitoring system, resulting in low utilization of database connection pool resources by the business system, high monitoring costs, and poor user experience.
By developing the extension component DBCP-explorer, we can collect and convert indicators from the Druid database connection pool into data formats supported by Prometheus, establish an interface with the Prometheus monitoring system, perform data aggregation and visual output, and generate alarm information and monitoring images.
It realizes Druid database connection pool monitoring in cloud-native scenarios, reduces the cost of accessing Druid monitoring for business systems, improves user experience, and allows users to use it without understanding the monitoring principles, simplifying monitoring configuration.
Smart Images

Figure CN119032350A_ABST
Abstract
Description
Database connection pool monitoring method and device, electronic device, and storage medium Technical Field
[0001] The present disclosure relates to the technical field of database connection pool monitoring, and in particular to a database connection pool monitoring method and device, electronic equipment, and storage medium. Background Art
[0002] Currently, cloud computing is based on the traditional Internet Data Center (IDC) architecture, resulting in low resource utilization for some IDC-based applications. Prometheus, the most commonly used service monitoring system in the cloud-native era, can perform highly complex monitoring data aggregation calculations. Druid, a Java-based database connection pool, is one of the most important monitoring options. SQL execution and database connection pool performance are crucial. Currently, Druid's monitoring capabilities are not integrated with cloud-native scenarios, and Druid does not support integration with Prometheus.
[0003] Summary of the Invention
[0004] In view of this, embodiments of the present disclosure provide a method and apparatus for monitoring a database connection pool, an electronic device, and a storage medium, which can monitor the performance and SQL execution status of a database connection pool of a business system.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for monitoring a database connection pool is provided, for use in a first type monitoring system, the method comprising:
[0006] Obtaining an indicator of a second type of database connection pool in the business system through an extension component; wherein the extension component is a component implemented by creating a new component or reusing the function of an existing component;
[0007] Converting the indicator into first format data through the first interface function and / or the second interface function supported by the extension component; wherein the format of the first format data is a data format that can be called by the application to which the first type of monitoring system belongs;
[0008] The first format data is obtained through the extension component.
[0009] In some exemplary embodiments, the method further comprises:
[0010] Aggregate the data in the first format to obtain second data, and output the second data through a monitoring interface.
[0011] In some exemplary embodiments, the method further comprises:
[0012] Comparing the second data output by the monitoring interface with the set monitoring parameters to generate a comparison result, and generating an alarm message based on the comparison result; and / or
[0013] A monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented through a display unit.
[0014] In some exemplary embodiments, the indicator of the second type database connection pool includes at least one of the following:
[0015] Connection pool initial size, minimum number of connections in the connection pool, maximum number of connections in the connection pool, and Structured Query Language (SQL) execution metrics.
[0016] In some exemplary embodiments, obtaining the indicator of the second type of database connection pool in the business system through the extension component includes:
[0017] Obtaining at least one of the initial size of the connection pool, the minimum number of connections in the connection pool, and the maximum number of connections in the connection pool by reading the data source configuration of the second type database connection pool; and / or
[0018] The SQL execution indicator is obtained by reading the filter configuration of the second type database connection pool.
[0019] In some exemplary embodiments, the performing aggregation processing on the first format data includes:
[0020] Obtaining the initial size of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system; and / or
[0021] Obtaining the minimum number of connections in the connection pool configured for all data sources corresponding to the business system, and determining the minimum number of connections in the second type database connection pool of the business system as the sum of the minimum number of connections in the connection pool configured for all data sources corresponding to the business system; and / or
[0022] The maximum number of connections in the connection pool configured for all data sources corresponding to the business system is obtained, and the maximum number of connections in the second type database connection pool of the business system is determined as the sum of the maximum number of connections in the connection pool configured for all data sources corresponding to the business system.
[0023] In some exemplary embodiments, the performing aggregation processing on the first format data includes:
[0024] Periodically obtaining the current number of idle connections in the second type database connection pool, and calculating a rate of change of the number of idle connections in the second type database connection pool within a set period based on the obtained number of idle connections; and / or
[0025] Periodically obtaining the current number of active connections in the second type database connection pool, and calculating a rate of change of the number of active connections in the second type database connection pool within a set period based on the obtained number of active connections; and / or
[0026] Periodically obtaining the current number of query operation SQL executions by the second type database connection pool, and calculating a rate of change of the number of query operation SQL executions by the second type database connection pool within a set period based on the obtained number of query operation SQL executions; and / or
[0027] The current number of update operation SQLs executed by the second type database connection pool is periodically obtained, and a change rate of the number of update operation SQLs executed by the second type database connection pool within a set period is calculated based on the obtained number of update operation SQLs executed.
[0028] In some exemplary embodiments, the first type of monitoring system includes a Prometheus monitoring application; the first interface function includes a Prometheus client interface function, and the second interface function includes a Mircometer interface function.
[0029] According to a second aspect of an embodiment of the present disclosure, a monitoring device for a database connection pool is provided, comprising:
[0030] A first acquisition unit is configured to acquire an indicator of a second type of database connection pool in the business system through an extension component; wherein the extension component is a component that is newly created or implemented by reusing the functions of an existing component;
[0031] a conversion unit configured to convert the indicator into first format data through the first interface function and / or the second interface function supported by the extension component; wherein the format of the first format data is a data format that can be called by the application to which the first type of monitoring system belongs;
[0032] The second acquiring unit is configured to acquire the first format data through the extension component.
[0033] In some exemplary embodiments, the apparatus further comprises:
[0034] The processing unit is configured to perform aggregation processing on the first format data to obtain second data; and output the second data through the monitoring interface.
[0035] In some exemplary embodiments, the processing unit is further configured to:
[0036] Comparing the second data output by the monitoring interface with the set monitoring parameters to generate a comparison result, and generating an alarm message based on the comparison result; and / or
[0037] A monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented through a display unit.
[0038] In some exemplary embodiments, the indicator of the second type database connection pool includes at least one of the following:
[0039] Connection pool initial size, minimum number of connections in the connection pool, maximum number of connections in the connection pool, and Structured Query Language (SQL) execution metrics.
[0040] In some exemplary embodiments, the first acquiring unit is further configured to:
[0041] Obtaining at least one of the initial size of the connection pool, the minimum number of connections in the connection pool, and the maximum number of connections in the connection pool by reading the data source configuration of the second type database connection pool; and / or
[0042] The SQL execution indicator is obtained by reading the filter configuration of the second type database connection pool.
[0043] In some exemplary embodiments, the processing unit is further configured to:
[0044] Obtaining the initial size of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system; and / or
[0045] Obtaining the minimum number of connections in the connection pools configured for all data sources corresponding to the business system, and determining the minimum number of connections in the second type database connection pool of the business system as the sum of the minimum number of connections in the connection pools configured for all data sources corresponding to the business system; and / or
[0046] The maximum number of connections in the connection pool configured for all data sources corresponding to the business system is obtained, and the maximum number of connections in the second type database connection pool of the business system is determined as the sum of the maximum number of connections in the connection pool configured for all data sources corresponding to the business system.
[0047] In some exemplary embodiments, the processing unit is further configured to:
[0048] Periodically obtaining the current number of idle connections in the second type database connection pool, and calculating a rate of change of the number of idle connections in the second type database connection pool within a set period based on the obtained number of idle connections; and / or
[0049] Periodically obtaining the current number of active connections in the second type database connection pool, and calculating a rate of change of the number of active connections in the second type database connection pool within a set period based on the obtained number of active connections; and / or
[0050] Periodically obtaining the current number of query operation SQL executions by the second type database connection pool, and calculating a rate of change of the number of query operation SQL executions by the second type database connection pool within a set period based on the obtained number of query operation SQL executions; and / or
[0051] The current number of update operation SQLs executed by the second type database connection pool is periodically obtained, and a change rate of the number of update operation SQLs executed by the second type database connection pool within a set period is calculated based on the obtained number of update operation SQLs executed.
[0052] In some exemplary embodiments, the first type of monitoring system includes a Prometheus monitoring application; the first interface function includes a Prometheus client interface function, and the second interface function includes a Mircometer interface function.
[0053] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a processor and a memory for storing processor-executable instructions, wherein the processor is configured to execute the steps of the database connection pool monitoring method when calling the executable instructions in the memory.
[0054] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the steps of the method for monitoring a database connection pool.
[0055] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0056] In the embodiment of the present disclosure, an interactive interface between the business system and the first type of monitoring system is established by setting an extension component. The first type of monitoring system converts the indicators of the second type of database connection pool into first format data through the extension component, which can fully utilize the monitoring function of the first type of monitoring system and output the monitoring results to the user, making it convenient for the user to accurately judge the indicators of the business system and the second type of database connection pool, and realizing the docking of the business system with the first type of monitoring system in a cloud-native scenario, greatly reducing the monitoring cost of the business system, and users can use it without understanding its monitoring principles, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the embodiments of the present invention.
[0058] FIG1 is a flow chart of a method for monitoring a database connection pool according to an embodiment of the present disclosure;
[0059] FIG2 is a schematic diagram of a scenario of a monitoring system for a database connection pool according to an embodiment of the present disclosure;
[0060] FIG3 is a schematic diagram of an implementation flow of a method for monitoring a database connection pool according to an embodiment of the present disclosure;
[0061] FIG4 is a schematic diagram of the structure of a monitoring device for a database connection pool according to an embodiment of the present disclosure;
[0062] Fig. 5 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible implementations consistent with the present disclosure. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0064] The terms used in the embodiments of the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of the present disclosure. The singular forms "a," "the," and "the" used in the embodiments of the present disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0065] It should be understood that although the terms first, second, etc. may be used to describe various information in the embodiments of the present disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0066] FIG1 is a flow chart of a method for monitoring a database connection pool according to an embodiment of the present disclosure. As shown in FIG1 , the method for monitoring a database connection pool is applied to a first type of monitoring system and specifically includes the following processing steps:
[0067] S11. Obtain indicators of the second type of database connection pool in the business system through the extension component.
[0068] In the embodiments of the present disclosure, the extension component is a newly created component, that is, a brand new extension component developed for the database connection pool monitoring of the embodiments of the present disclosure to enable access to the second type of database connection pool. As an implementation method, the extension component can also be implemented by reusing the functions of existing components, that is, adding some additional functions to the original components in the first type of monitoring system to enable access to the second type of database connection pool in the embodiments of the present disclosure.
[0069] In the embodiments of the present disclosure, the first type of monitoring system may include Prometheus. Prometheus is a system monitoring and alarm framework. As a new generation of cloud native monitoring system, it is mainly developed for community open source projects. At present, Prometheus has officially joined the Cloud Native Computing Foundation (CNCF) project, which can better cooperate with container platforms and cloud platforms. As the most commonly used monitoring component in the cloud native era, Prometheus has become the standard for community monitoring. It has an active community and rich surrounding projects. Prometheus is currently the most popular open source multi-dimensional monitoring solution, integrating collection, storage, query, and alarm. It has a powerful Prom SQL structured query language (Structured Query Language, SQL) statement, which can perform very complex monitoring data aggregation calculations, and even support relational aggregation. Prom SQL is the database query syntax of Prometheus, which can easily find the value of monitoring indicators, perform mathematical operations and quick statistical data, and set alarm thresholds.
[0070] Here, the first type of monitoring system is used only as an example and is not intended to be limiting. It can also be other monitoring applications. The business system is an extended monitoring system that can access the Druid database connection pool. To implement related monitoring, the user needs to add corresponding configurations in the code. The embodiment of the present disclosure can be for the case where the business system is connected to the Druid database connection pool. Druid is one of the database connection pools that supports the Java language. It is superior to other database connection pools in terms of functionality, performance, and scalability, and therefore has a wider range of applications. SQL execution and the performance of the DB connection pool are important factors affecting service performance. Therefore, SQL execution and the performance of the DB connection pool are very important monitoring items. However, Druid's related monitoring is currently not integrated with cloud native scenarios, and it does not support docking with Prometheus. Therefore, how to monitor the business system's use of database connection pool resources and how to execute SQL, etc., to visually monitor the operation of the business system, etc. Therefore, other monitoring applications similar to Prometheus can also adopt the technical means of the embodiment of the present disclosure.
[0071] In the embodiment of the present disclosure, the second type of database connection pool may include a Druid database connection pool. Here, the second type of database connection pool is only an example, and all database connection pools that can be connected to the business system can adopt the technical means of the embodiment of the present disclosure.
[0072] As an example, the extension component may include a DBCP-explorer interface. Here, DBCP refers to a database connection pool (DBCP). The DBCP-explorer interface of the disclosed embodiment is used to collect relevant data on the connection status between the business system and the database connection pool, and convert the collected relevant data into a data format supported by a first type of monitoring system such as Prometheus. Through the monitoring function of Prometheus, the collected relevant parameters are converted into monitoring results, and output to the user in a visual manner, thereby enabling the user to dynamically visualize the connection status between the business system and the database connection pool, facilitating the user's intuitive understanding of the operating status of the business system and improving the user experience.
[0073] In some embodiments of the present disclosure, the indicators of the second type database connection pool may include at least one of the following:
[0074] The initial size of the connection pool (which can be expressed as initialSizeDB), the minimum number of connections in the connection pool (which can be expressed as minIdleDB), the maximum number of connections in the connection pool (which can be expressed as maxActiveDB), and SQL execution indicators.
[0075] The SQL execution indicator may include at least one of the following:
[0076] The upper limit of prepared statements in all sessions on the relational database management system (MySQL) at the same time (which can be expressed as preparedStatementOpenCount), the number of prepared statement hits in the cache (which can be expressed as cachedPreparedStatementHitCount), the number of query operation SQL executions (which can be expressed as executeQueryCount), and the number of update operation SQL executions (which can be expressed as executeUpdateCount).
[0077] S12. Convert the indicators of the second-type database connection pool into first format data through the first interface function and / or the second interface function supported by the extension component.
[0078] In the embodiment of the present disclosure, the format of the first format data is a data format that can be called by the application belonging to the first type of monitoring system, that is, the format of the first format data is a data format that can be directly used by the application belonging to the first type of monitoring system. The first interface function and the second interface function are interface functions for interaction between the extension component and the first type of monitoring system. In the embodiment of the present application, the extension component supports the connection protocol of the Prometheus monitoring application, that is, it can access and interact with the Prometheus monitoring application and perform data communication. In addition, the extension component also supports the connection protocol of the micrometer application, that is, it can also establish a communication connection interface with the Mircometer application to achieve data interaction with the Mircometer application. Micrometer is a measurement library for monitoring indicators that can achieve interaction with the Prometheus server. The extension component of the embodiment of the present disclosure acts as a proxy component between the first type of monitoring system and the second type of database connection pool, plays the role of performing protocol data conversion between the first type of monitoring system and the second type of database connection pool, realizes a communication tunnel between the first type of monitoring system and the second type of database connection pool, thereby smoothly building a communication bridge between the first type of monitoring system and the second type of database connection pool, and smoothly realizing format conversion and transmission of monitoring data. As the most commonly used monitoring component in the cloud-native era, Prometheus supports multi-dimensional monitoring solutions, integrates collection, storage, query, and alarm, and has powerful PromSQL statements. It can perform very complex monitoring data aggregation calculations and even supports relational aggregation. Druid is one of the database connection pools that supports the Java language. It is better than other database connection pools in terms of function, performance, and scalability, so it has a wider range of applications. The execution of Structured Query Language (SQL) and the performance of the DB connection pool are important factors affecting service performance. Therefore, the execution of SQL and the performance of the DB connection pool are very important monitoring items. However, the current related monitoring of Druid is not combined with cloud-native scenarios, and it does not support docking with Prometheus. The disclosed embodiment develops an extension component DBCP-explorer interface, which can interact with the Prometheus server in the form of a Prometheus client or Mircometer, and can collect relevant data on the connection status between database connection pools, realize the combination of Druid and Prometheus, and thus support powerful monitoring functions.
[0079] When the first type of monitoring system is a Prometheus monitoring application, the first interface function may include a Prometheus client interface function; the second interface function may include a Mircometer interface function, etc. A Prometheus client establishes a connection with a Prometheus server as a client, while a Prometheus Mircometer establishes a connection with a Prometheus server as a metric library.
[0080] In an embodiment of the present disclosure, as an example, the format of the first format data may include format types such as Counter, Gauge, Summary, or Histogram in a Prometheus monitoring application.
[0081] In some embodiments of the present disclosure, obtaining the indicator of the second type database connection pool in the business system through the extension component specifically includes:
[0082] At least one of the following parameters is obtained by reading the data source (DruidDataSource) configuration of the second-type database connection pool: initialSizeDB, minimum number of connections minIdleDB, and maximum number of connections maxActiveDB. A data source refers to the database or database server used by a database application, and is the device or raw media that provides the required data. The corresponding database connection can be found by using the data source name.
[0083] and / or
[0084] SQL execution metrics are obtained by reading the filter (StatFilter) configuration of the second type of database connection pool. StatFilter is used to collect statistics to implement Druid's monitoring function.
[0085] As an example, metrics for the aforementioned second-type database connection pool are collected through the business system and the DruidDataSource and StatFilter of the second-type database connection pool. The collected metrics for the second-type database connection pool are then converted to the Counter, Gauge, Summary, or Histogram types in the Prometheus monitoring system through the Prometheus Client interface or the Prometheus Mircometer interface. This allows the Prometheus monitoring application to generate visual monitoring results based on the converted data for user analysis. Because the Prometheus monitoring system and Druid belong to different fields and support different languages, there has been no technical solution for implementing Druid monitoring in cloud-native scenarios.
[0086] S13. Obtain the first format data through the extension component.
[0087] In some embodiments of the present disclosure, after establishing a connection between a first type of monitoring system and a second type of database connection pool through an extension component, the extension component obtains monitoring data from the second type of database connection pool and converts the obtained monitoring data into first format data supported by the first type of monitoring system, so as to facilitate the first type of monitoring system to process the first format data and output corresponding monitoring results through the monitoring interface.
[0088] In an embodiment of the present disclosure, after the first-type monitoring system obtains data in a first format, it also aggregates the first-format data to obtain second data, and outputs the second data through a monitoring interface. In an embodiment of the present disclosure, as an implementation method, aggregating the first-format data includes: obtaining the initial size (initialSizeDB) of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system.
[0089] In an embodiment of the present disclosure, as an implementation method, aggregating the data in the first format may also include: obtaining the minimum number of connections in the connection pool configured for all corresponding data sources of the business system, and determining the minimum number of connections (minIdleDB) of the second type database connection pool of the business system as the sum of the minimum number of connections in the connection pool configured for all corresponding data sources of the business system.
[0090] In an embodiment of the present disclosure, as an implementation method, aggregating the data in the first format may also include: obtaining the maximum number of connections (maxActiveDB) of the connection pool configured for all corresponding data sources of the business system, and determining the maximum number of connections of the second type database connection pool of the business system as the sum of the maximum number of connections of the connection pool configured for all corresponding data sources of the business system.
[0091] The processed second data is exposed to the Prometheus server through the designated monitoring port for visualization to the user. Here, the monitoring port refers to the network interface. That is, after the monitoring system obtains the monitoring data, it needs to report the monitoring data to the designated network interface for display, output, storage, and other operations.
[0092] The set time period here can be 1 minute, 2 minutes, 5 minutes, 10 minutes, or a smaller granularity of 30 seconds, 15 seconds, 10 seconds, 5 seconds, etc.
[0093] In an embodiment of the present disclosure, as an implementation method, performing aggregation processing on the first format data may further include:
[0094] The current number of idle connections in the second type database connection pool is periodically obtained, and a rate of change of the number of idle connections in the second type database connection pool within a set period of time is calculated based on the obtained number of idle connections. Based on the rate of change of the number of idle connections, the data usage of the second type database connection pool can be monitored to determine whether to add new data or perform other operations.
[0095] In an embodiment of the present disclosure, as an implementation method, performing aggregation processing on the first format data may further include:
[0096] The current number of active connections in the second-type database connection pool is periodically obtained, and a rate of change of the number of active connections in the second-type database connection pool within a set period of time is calculated based on the obtained number of active connections. Based on the monitored rate of change of the number of active connections, resource usage of the second-type database connection pool can be estimated to determine whether to execute new processing, etc.
[0097] In an embodiment of the present disclosure, as an implementation method, aggregating data in the first format may further include periodically obtaining the current number of query SQL executions by the second type database connection pool, and calculating the rate of change of the number of query SQL executions by the second type database connection pool within a set time period based on the obtained number of query SQL executions. The rate of change of the number of query SQL executions can be used to determine the frequency of SQL operations for the second type database connection pool, thereby determining whether the current query operation is relatively frequent, and appropriately allocating processing resources or performing distributed processing of the current query operation.
[0098] In an embodiment of the present disclosure, as an implementation method, aggregating data in the first format may further include periodically obtaining the current number of SQL updates executed by the second type of database connection pool, and calculating a rate of change in the number of SQL updates executed by the second type of database connection pool within a set period based on the obtained number of SQL updates executed. The rate of change in the number of SQL updates executed can be used to determine data updates for the second type of database connection pool, thereby monitoring data writes or modifications to the second type of database connection pool and providing a basis for maintaining the second type of database connection pool.
[0099] In some embodiments of the present disclosure, the second data output by the monitoring interface is compared with the set monitoring parameters to generate a comparison result, and an alarm message is generated based on the comparison result. For example, when monitoring a target to be monitored, when it is identified that the characteristic information of the target to be monitored matches the pre-input characteristic information, an alarm message is output to remind that a specific target has been monitored. As an example, when the target to be monitored is data of a set type, the characteristic information includes attribute information of the data, suffix information of the data, etc.
[0100] In some embodiments of the present disclosure, a monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented via a display unit. For example, after the second data is collected, a monitoring image is generated and displayed via a display unit such as a display interface, thereby enabling real-time monitoring of the monitored area. Furthermore, the collected second data can be parsed, and if the parsed data is abnormal, a warning message corresponding to the abnormal data is generated.
[0101] The essence of the technical solution of the embodiment of the present disclosure is further illustrated below through detailed application scenarios.
[0102] Currently, there are two ways to monitor the Druid database connection pool: using its built-in monitoring solution implemented through a probabilistic filter-chain extension. However, this requires users to add complex configurations to the code to implement the corresponding monitoring functionality. Another approach is to integrate Spring's monitoring solution, which monitors more granular metrics and outputs them via API calls. However, neither of these monitoring technologies is compatible with cloud-native monitoring scenarios, and the monitoring data does not conform to the format of Prometheus metrics, making it impossible to monitor the performance of the Druid database connection pool on cloud-native container platforms.
[0103] The embodiments of the present disclosure mainly address the above-mentioned technical issues and solve the monitoring problem of the Druid database connection pool in cloud-native scenarios, which can greatly reduce the cost of monitoring the business system access to the Druid database connection pool.
[0104] Figure 2 is a scenario diagram of a database connection pool monitoring system shown in an embodiment of the present disclosure. As shown in Figure 2, in the embodiment of the present disclosure, after the business system is connected to the Druid database connection pool, it is also necessary to set up the extension component DBCP-explorer to connect the business system to the Prometheus monitoring application to collect performance data of the business system and the Druid database connection pool, and convert the collected performance data into data in the Prometheus metrics format. The Prometheus monitoring system regularly obtains the Druid monitoring data exposed by the monitoring middleware through the extension component. Users can use the Prometheus monitoring system to visualize the performance related to the connection operation between the Druid database connection pool and the business system and configure corresponding alarms.
[0105] In the embodiment of the present disclosure, the extension component DBCP-explorer supports the aforementioned indicator collection function, and supports the function of converting the collected indicators into the form of Prometheus metrics. The DB-explorer of the embodiment of the present disclosure supports two ways of docking with the Prometheus server: the Prometheus client and the micrometer, wherein Micrometer is a measurement library for monitoring indicators. DB-explorer can establish a communication link with the Prometheus server in the form of a Prometheus client. In this case, DB-explorer is programmed and implemented in the form of a Prometheus client; at the same time, DB-explorer can also establish a communication link with the Prometheus server in the form of a Prometheus micrometer. In this case, DB-explorer is programmed and implemented in the form of a Prometheus micrometer. In this way, in the embodiment of the present disclosure, it is only necessary to introduce DB-explorer into the business system, and the docking method with the Prometheus server can be selected according to the monitoring requirements. The annotation @EnableDruidPromMonitor is added to the service startup class. The function of @EnableDruidPromMonitor is to enable Prometheus monitoring of the Druid database connection pool, or the annotation @EnableDruidMicMonitor is added to the service startup class. The function of @EnableDruidMicMonitor is to enable micrometer monitoring of the Druid database connection pool. By adding the annotation operation mentioned above, the monitoring function can be enabled. That is, according to the two implementation methods of DB-explorer, the corresponding monitoring function can be started by calling the DB-explorer through the internal program, thereby greatly reducing the difficulty and configuration cost of docking the business system with Druid monitoring in the cloud native scenario, and users can use it without understanding its principles.
[0106] In some embodiments of the present disclosure, the business system adds DBCP-explorer and collects the performance data of the Druid database connection pool through DBCP-explorer to realize the data monitoring of the Druid database connection pool by the business system; DBCP-explorer converts it into monitoring data in the form of Prometheus metrics through Micrometer or Prometheus client, and then exposes it through a specific port; specifically, the performance data of the Druid database connection pool in the business system is collected, calculated, aggregated and converted into indicators in the form of Prometheus metrics, and then exposed to the Prometheus system of the container platform of the Druid database connection pool. The Prometheus system of the container platform regularly obtains the Druid monitoring data exposed by the monitoring middleware, and the user can use the monitoring system of the container platform to visualize the performance of the connection operation between the Druid database connection pool and the business system and configure corresponding alarms. In the embodiment of the present disclosure, by setting DBCP-explorer to realize the function of Micrometer or Prometheus client, the Druid monitoring data can be transmitted to the Prometheus system in real time, thereby realizing the monitoring function, without the need for additional configuration of plug-ins or scripts, and reducing the cost of monitoring configuration.
[0107] FIG3 is a schematic diagram of an implementation flow of a method for monitoring a database connection pool according to an embodiment of the present disclosure. As shown in FIG3 , the method for monitoring a database connection pool according to an embodiment of the present disclosure includes the following processing steps:
[0108] Step 1: Read and load the indicators of the second type of database connection pool through the DB-explorer interface. The indicators here may include, for example, DB connection pool performance and SQL execution indicators.
[0109] As an example, metrics for the second type of database connection pool may include performance indicators for the DB connection pool, such as initialSize (DB connection pool initial size), minIdle (DB connection pool minimum number of connections), maxActive (DB connection pool maximum number of connections), and SQL execution metrics, such as preparedStatementOpenCount (the upper limit of prepared statements in all MySQL sessions at the same time), cachedPreparedStatementHitCount (the number of prepared statement hits in the cache), executeQueryCount (the number of query SQL executions), and executeUpdateCount (the number of update SQL executions). This technical solution collects and loads these performance metrics through DruidDataSource and StatFilter.
[0110] Step 2: Convert the collected metrics into Prometheus Counter, Gauge, Summary, or Histogram types through Prometheus Client or Prometheus Mircometer.
[0111] Step 3: Expose the indicator parameters processed in step 2 to the Prometheus Server through the specified port.
[0112] Step 4: The Prometheus container platform collects the exposed data to be monitored.
[0113] Step 5: Perform relevant calculations and aggregation based on the collected monitoring data, as follows:
[0114] The initial size of the DB connection pool for a business system is the sum of the initial sizes (initialSize) of all DataSources in the business system, that is:
[0115]
[0116] Similarly, the minimum and maximum number of connections in the business system's DB connection pool are:
[0117]
[0118]
[0119] For the number of idle connections and active connections in the DB connection pool, their original indicators poolCount and activeCount are both counter type indicators. However, in actual applications, users are more concerned with their instantaneous values. Here, it is necessary to calculate the change rate within a set period, such as the change rate within one minute, RpoolCount and RactiveCount, as follows:
[0120] poolCount before Indicates the number of idle connections in the DB connection pool corresponding to the start time of the set period, poolCount after Indicates the number of idle connections in the DB connection pool corresponding to the end of the set time period;
[0121] activeCount before Indicates the number of active connections in the DB connection pool corresponding to the start time of the set period, activeCount after Indicates the number of active connections in the DB connection pool at the end of the set time period;
[0122] As an example, the period for calculating the rate of change may also be other time periods such as 5 minutes, 10 minutes, etc.
[0123] Regarding SQL execution indicators, they may include the number of times executeQueryCount executes query operations SQL, the number of times executeUpdateCount executes update operations SQL, etc. In the embodiment of the present disclosure, the change rate calculation is also required. Taking the change rate RexecuteQueryCount and RexecuteUpdateCount within one minute as an example, the specific calculation is as follows:
[0124]
[0125] executeQueryCount before Indicates the number of times the query operation SQL is executed at the beginning of the set period, executeQueryCount after Indicates the number of times the query operation SQL is executed at the end of the set time period;
[0126]
[0127] updateQueryCount before Indicates the number of times the update operation SQL is executed during the set period at the start time of the set period, updateQueryCount after Indicates the number of times the update operation SQL is executed at the end of the set period;
[0128] The calculated and aggregated metrics can be visualized using Grafana and corresponding alerts can be configured using Prometheus alerts. This allows monitoring of the relevant operational status of the business system. Grafana configuration can be implemented using HTML or JavaScript applications, eliminating cross-domain access restrictions when accessing the database. Prometheus alert configuration is a configuration file that identifies alert information. The monitoring system uses this configuration to identify and collect alerts.
[0129] The disclosed embodiment configures DB-explorer to support both Prometheus client and micrometer docking with the Prometheus server. Users only need to introduce DB-explorer dependencies into their business systems, select the appropriate docking method based on their needs, and add the annotations @EnableDruidPromMonitor or @EnableDruidMicMonitor to the service startup class. This significantly reduces the cost of docking business systems with Druid monitoring in cloud-native scenarios, and users can easily use it without having to understand its principles.
[0130] FIG4 is a schematic diagram of the structure of a monitoring device for a database connection pool according to an embodiment of the present disclosure. As shown in FIG4 , the monitoring device for a database connection pool according to an embodiment of the present disclosure includes:
[0131] A first acquisition unit 40 is configured to acquire an indicator of a second type of database connection pool in the business system through an extension component; wherein the extension component is a component that is newly created or implemented by reusing the functions of an existing component;
[0132] The conversion unit 41 is configured to convert the indicator into a first format data through the first interface function and / or the second interface function supported by the extension component; wherein the format of the first format data is a data format that can be called by the application to which the first type of monitoring system belongs;
[0133] The second acquiring unit 42 is configured to acquire the first format data through the extension component.
[0134] In some exemplary embodiments, based on the database connection pool monitoring device shown in FIG4 , the database connection pool monitoring device further includes:
[0135] The processing unit (not shown in FIG4 ) is configured to perform aggregation processing on the first format data to obtain second data; and output the second data through the monitoring interface.
[0136] In some exemplary embodiments, the processing unit is further configured to:
[0137] Comparing the second data output by the monitoring interface with the set monitoring parameters to generate a comparison result, and generating an alarm message based on the comparison result; and / or
[0138] A monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented through a display unit.
[0139] In some exemplary embodiments, the indicator of the second type database connection pool includes at least one of the following:
[0140] Connection pool initial size, minimum number of connections in the connection pool, maximum number of connections in the connection pool, and Structured Query Language (SQL) execution metrics.
[0141] In some exemplary embodiments, the first acquiring unit 40 is further configured to:
[0142] Obtaining at least one of the initial size of the connection pool, the minimum number of connections in the connection pool, and the maximum number of connections in the connection pool by reading the data source configuration of the second type database connection pool; and / or
[0143] The SQL execution indicator is obtained by reading the filter configuration of the second type database connection pool.
[0144] In some exemplary embodiments, the processing unit is further configured to:
[0145] Obtaining the initial size of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system; and / or
[0146] Obtaining the minimum number of connections in the connection pools configured for all data sources corresponding to the business system, and determining the minimum number of connections in the second type database connection pool of the business system as the sum of the minimum number of connections in the connection pools configured for all data sources corresponding to the business system; and / or
[0147] The maximum number of connections in the connection pools configured for all data sources corresponding to the business system is obtained, and the maximum number of connections in the second type database connection pool of the business system is determined as the sum of the maximum number of connections in the connection pools configured for all data sources corresponding to the business system.
[0148] In some exemplary embodiments, the processing unit is further configured to:
[0149] Periodically obtaining the current number of idle connections in the second type database connection pool, and calculating a rate of change of the number of idle connections in the second type database connection pool within a set period based on the obtained number of idle connections; and / or
[0150] Periodically obtaining the current number of active connections in the second type database connection pool, and calculating a rate of change of the number of active connections in the second type database connection pool within a set period based on the obtained number of active connections; and / or
[0151] Periodically obtaining the current number of query operation SQL executions by the second type database connection pool, and calculating a rate of change of the number of query operation SQL executions by the second type database connection pool within a set period based on the obtained number of query operation SQL executions; and / or
[0152] The current number of update operation SQLs executed by the second type database connection pool is periodically obtained, and a change rate of the number of update operation SQLs executed by the second type database connection pool within a set period is calculated based on the obtained number of update operation SQLs executed.
[0153] In some exemplary embodiments, the first type of monitoring system includes a Prometheus monitoring application; the first interface function includes a Prometheus client interface function, and the second interface function includes a Mircometer interface function.
[0154] In an exemplary embodiment, the first acquisition unit 40, the conversion unit 41, the second acquisition unit 42, the processing unit, etc. can be implemented by one or more central processing units (CPU), graphics processing units (GPU), baseband processors (BP), application-specific integrated circuits (ASIC), digital signal processors (DSP), programmable logic devices (PLD), complex programmable logic devices (CPLD), field programmable gate arrays (FPGA), general-purpose processors, controllers, microcontrollers (MCU), microprocessors, or other electronic components.
[0155] In the embodiment of the present disclosure, the specific manner in which each unit in the monitoring device for the database connection pool shown in FIG4 performs operations has been described in detail in the embodiment of the method and will not be elaborated on here.
[0156] Figure 5 is a block diagram of an electronic device 800 according to an exemplary embodiment. As shown in Figure 5, the post-processing device 800 supports multi-screen output. The post-processing device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0157] The processing component 802 generally controls the overall operation of the post-processing device 800, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
[0158] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the post-processing device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0159] The power component 806 provides power to the various components of the post-processing device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the post-processing device 800.
[0160] The multimedia component 808 includes a screen that provides an output interface between the post-processing device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0161] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the post-processing device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0162] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0163] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the post-processing device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the post-processing device 800. The sensor assembly 814 can also detect changes in the position of the post-processing device 800 or a component of the post-processing device 800, the presence or absence of user contact with the post-processing device 800, the orientation or acceleration / deceleration of the post-processing device 800, and changes in the temperature of the post-processing device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0164] The communication component 816 is configured to facilitate wired or wireless communication between the post-processing device 800 and other devices. The post-processing device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0165] In an exemplary embodiment, the post-processing device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the steps of the database connection pool monitoring method of the above embodiment.
[0166] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory 804 including instructions. The instructions can be executed by the processor 820 of the post-processing device 800 to complete the steps of the database connection pool monitoring method of the above embodiment. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0167] The disclosed embodiment also records a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the steps of the database connection pool monitoring method of the aforementioned embodiment.
[0168] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0169] It should be understood that the present disclosure is not limited to the precise structure described above and shown in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0170] Other embodiments of the present invention will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed in the present invention. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0171] It should be understood that the embodiments of the present invention are not limited to the precise structures described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the embodiments of the present invention is limited only by the appended claims.
Claims
1. A method for monitoring a database connection pool, used in a first type monitoring system, characterized in that: The method comprises: Obtaining an indicator of a second type of database connection pool in the business system through an extension component; wherein the extension component is a component implemented by creating a new component or reusing the function of an existing component; Converting the indicator into first format data through the first interface function and / or the second interface function supported by the extension component; wherein the format of the first format data is a data format that can be called by the application to which the first type of monitoring system belongs; The first format data is obtained through the extension component.
2. The method according to claim 1, characterized in that The method further comprises: Aggregate the data in the first format to obtain second data, and output the second data through a monitoring interface.
3. The method according to claim 2, characterized in that The method further comprises: Comparing the second data output by the monitoring interface with the set monitoring parameters to generate a comparison result, and generating an alarm message based on the comparison result; and / or A monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented through a display unit.
4. The method according to claim 1, wherein The indicators of the second type of database connection pool include at least one of the following: Connection pool initial size, minimum number of connections in the connection pool, maximum number of connections in the connection pool, and Structured Query Language (SQL) execution metrics.
5. The method according to claim 2, characterized in that The obtaining, through the extension component, an indicator of the second type of database connection pool in the business system includes: Obtaining at least one of the initial size of the connection pool, the minimum number of connections in the connection pool, and the maximum number of connections in the connection pool by reading the data source configuration of the second type database connection pool; and / or The SQL execution indicator is obtained by reading the filter configuration of the second type database connection pool.
6. The method according to claim 5, characterized in that The aggregating the data in the first format includes: Obtaining the initial size of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system; and / or Obtaining the minimum number of connections in the connection pool configured for all data sources corresponding to the business system, and determining the minimum number of connections in the second type database connection pool of the business system as the sum of the minimum number of connections in the connection pool configured for all data sources corresponding to the business system; and / or The maximum number of connections in the connection pool configured for all data sources corresponding to the business system is obtained, and the maximum number of connections in the second type database connection pool of the business system is determined as the sum of the maximum number of connections in the connection pool configured for all data sources corresponding to the business system.
7. The method according to claim 5, characterized in that The aggregating the data in the first format includes: Periodically obtaining the current number of idle connections in the second type database connection pool, and calculating a rate of change of the number of idle connections in the second type database connection pool within a set period based on the obtained number of idle connections; and / or Periodically obtaining the current number of active connections in the second type database connection pool, and calculating a rate of change of the number of active connections in the second type database connection pool within a set period based on the obtained number of active connections; and / or Periodically obtaining the current number of query operation SQL executions by the second type database connection pool, and calculating a rate of change of the number of query operation SQL executions by the second type database connection pool within a set period based on the obtained number of query operation SQL executions; and / or The current number of update operation SQLs executed by the second type database connection pool is periodically obtained, and a change rate of the number of update operation SQLs executed by the second type database connection pool within a set period is calculated based on the obtained number of update operation SQLs executed.
8. The method according to any one of claims 1 to 7, characterized in that The first type of monitoring system includes a Prometheus monitoring application; the first interface function includes a Prometheus client interface function, and the second interface function includes a Mircometer interface function.
9. A monitoring device for a database connection pool, characterized in that: The device comprises: A first acquisition unit is configured to acquire an indicator of a second type of database connection pool in the business system through an extension component; wherein the extension component is a component that is newly created or implemented by reusing the functions of an existing component; a conversion unit configured to convert the indicator into first format data through the first interface function and / or the second interface function supported by the extension component; wherein the format of the first format data is a data format that can be called by the application to which the first type of monitoring system belongs; The second acquiring unit is configured to acquire the first format data through the extension component.
10. The device according to claim 9, characterized in that The device further comprises: The processing unit is configured to perform aggregation processing on the first format data to obtain second data; and output the second data through the monitoring interface.
11. The device according to claim 10, characterized in that The processing unit is further configured to: comparing the second data output by the monitoring interface with set monitoring parameters to generate a comparison result, and generating alarm information based on the comparison result; and / or A monitoring image is generated based on the second data output by the monitoring interface, and the monitoring image is presented through a display unit.
12. The device according to claim 9, characterized in that The indicators of the second type of database connection pool include at least one of the following: Connection pool initial size, minimum number of connections in the connection pool, maximum number of connections in the connection pool, and Structured Query Language (SQL) execution metrics.
13. The device according to claim 9, characterized in that The first acquiring unit is further configured to: Obtaining at least one of the initial size of the connection pool, the minimum number of connections in the connection pool, and the maximum number of connections in the connection pool by reading the data source configuration of the second type database connection pool; and / or The SQL execution indicator is obtained by reading the filter configuration of the second type database connection pool.
14. The device according to claim 13, characterized in that The processing unit is further configured to: Obtaining the initial size of the connection pool configured for all data sources corresponding to the business system, and determining the initial size of the second-type database connection pool of the business system as the sum of the initial sizes of the connection pool configured for all data sources corresponding to the business system; and / or Obtaining the minimum number of connections in the connection pool configured for all data sources corresponding to the business system, and determining the minimum number of connections in the second-type database connection pool of the business system as the sum of the minimum number of connections in the connection pool configured for all data sources corresponding to the business system; and / or The maximum number of connections in the connection pool configured for all data sources corresponding to the business system is obtained, and the maximum number of connections in the second type database connection pool of the business system is determined as the sum of the maximum number of connections in the connection pool configured for all data sources corresponding to the business system.
15. The device according to claim 13, characterized in that The processing unit is further configured to: Periodically obtaining a current number of idle connections in the second type database connection pool, and calculating a rate of change of the number of idle connections in the second type database connection pool within a set period based on the obtained number of idle connections; and / or Periodically obtaining a current number of active connections in the second-type database connection pool, and calculating a rate of change of the number of active connections in the second-type database connection pool within a set period based on the obtained number of active connections; and / or Periodically obtaining the current number of query operation SQLs executed by the second type database connection pool, and calculating a rate of change of the number of query operation SQLs executed by the second type database connection pool within a set period based on the obtained number of query operation SQLs executed; and / or The current number of update operation SQLs executed by the second type database connection pool is periodically obtained, and a change rate of the number of update operation SQLs executed by the second type database connection pool within a set period is calculated based on the obtained number of update operation SQLs executed.
16. The device according to any one of claims 9 to 15, characterized in that The first type of monitoring system includes a Prometheus monitoring application; the first interface function includes a Prometheus client interface function, and the second interface function includes a Mircometer interface function.
17. An electronic device comprising a processor and a memory for storing instructions executable by the processor, characterized in that: The processor is configured to execute the steps of the method for monitoring a database connection pool according to any one of claims 1 to 8 when calling the executable instructions in the memory.
18. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the steps of the method for monitoring a database connection pool according to any one of claims 1 to 8.
Citation Information
Patent Citations
Management system of cluster database connection pool
CN112069237A
Management monitoring method and system for database connection pool
CN113934588A
Application database connection pool monitoring component construction method and system
CN113934784A
Methods and systems for microservices observability automation
US20200092180A1
Systems and methods for tuning containers in a high availability environment
US20210117217A1
