Commit ad126519 by bing.liu

Merge branch 'feature/20210615_PrometheusSchedulerCustom_lb'

parents 5edb1056 59caa1cf
...@@ -30,7 +30,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -30,7 +30,7 @@ public class PrometheusSchedulerCustomJob {
* 最大连接池数量 * 最大连接池数量
* 最小连接池数量 * 最小连接池数量
*/ */
private final AtomicInteger activeCountGauge, maxActiveGauge, maxIdleGauge, minIdleGauge; private final AtomicInteger activeCountGauge, maxActiveGauge, maxIdleGauge, minIdleGauge,poolingCountGauge;
private final CachingConnectionFactory cachingConnectionFactory; private final CachingConnectionFactory cachingConnectionFactory;
private final DruidDataSource druidDataSource; private final DruidDataSource druidDataSource;
...@@ -45,6 +45,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -45,6 +45,7 @@ public class PrometheusSchedulerCustomJob {
idleChannelsNotTxHighWaterGauge = meterRegistry.gauge("rabbitmq_idle_channels_not_tx_high_water", new AtomicInteger(0)); idleChannelsNotTxHighWaterGauge = meterRegistry.gauge("rabbitmq_idle_channels_not_tx_high_water", new AtomicInteger(0));
activeCountGauge = meterRegistry.gauge("db_active_count", new AtomicInteger(0)); activeCountGauge = meterRegistry.gauge("db_active_count", new AtomicInteger(0));
poolingCountGauge = meterRegistry.gauge("db_pooling_count",new AtomicInteger(0));
maxActiveGauge = meterRegistry.gauge("db_max_active", new AtomicInteger(0)); maxActiveGauge = meterRegistry.gauge("db_max_active", new AtomicInteger(0));
maxIdleGauge = meterRegistry.gauge("db_max_idle", new AtomicInteger(0)); maxIdleGauge = meterRegistry.gauge("db_max_idle", new AtomicInteger(0));
minIdleGauge = meterRegistry.gauge("db_min_idle", new AtomicInteger(0)); minIdleGauge = meterRegistry.gauge("db_min_idle", new AtomicInteger(0));
...@@ -61,6 +62,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -61,6 +62,7 @@ public class PrometheusSchedulerCustomJob {
idleChannelsNotTxHighWaterGauge.set(Integer.parseInt(cacheProperties.getOrDefault("idleChannelsNotTxHighWater", 0).toString())); idleChannelsNotTxHighWaterGauge.set(Integer.parseInt(cacheProperties.getOrDefault("idleChannelsNotTxHighWater", 0).toString()));
activeCountGauge.set(druidDataSource.getActiveCount()); activeCountGauge.set(druidDataSource.getActiveCount());
poolingCountGauge.set(druidDataSource.getPoolingCount());
maxActiveGauge.set(druidDataSource.getMaxActive()); maxActiveGauge.set(druidDataSource.getMaxActive());
maxIdleGauge.set(druidDataSource.getMaxIdle()); maxIdleGauge.set(druidDataSource.getMaxIdle());
minIdleGauge.set(druidDataSource.getMinIdle()); minIdleGauge.set(druidDataSource.getMinIdle());
......
...@@ -30,7 +30,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -30,7 +30,7 @@ public class PrometheusSchedulerCustomJob {
* 最大连接池数量 * 最大连接池数量
* 最小连接池数量 * 最小连接池数量
*/ */
private final AtomicInteger activeCountGauge, maxActiveGauge, maxIdleGauge, minIdleGauge; private final AtomicInteger activeCountGauge, maxActiveGauge, maxIdleGauge, minIdleGauge,poolingCountGauge;
private final CachingConnectionFactory cachingConnectionFactory; private final CachingConnectionFactory cachingConnectionFactory;
private final DruidDataSource druidDataSource; private final DruidDataSource druidDataSource;
...@@ -45,6 +45,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -45,6 +45,7 @@ public class PrometheusSchedulerCustomJob {
idleChannelsNotTxHighWaterGauge = meterRegistry.gauge("rabbitmq_idle_channels_not_tx_high_water", new AtomicInteger(0)); idleChannelsNotTxHighWaterGauge = meterRegistry.gauge("rabbitmq_idle_channels_not_tx_high_water", new AtomicInteger(0));
activeCountGauge = meterRegistry.gauge("db_active_count", new AtomicInteger(0)); activeCountGauge = meterRegistry.gauge("db_active_count", new AtomicInteger(0));
poolingCountGauge = meterRegistry.gauge("db_pooling_count",new AtomicInteger(0));
maxActiveGauge = meterRegistry.gauge("db_max_active", new AtomicInteger(0)); maxActiveGauge = meterRegistry.gauge("db_max_active", new AtomicInteger(0));
maxIdleGauge = meterRegistry.gauge("db_max_idle", new AtomicInteger(0)); maxIdleGauge = meterRegistry.gauge("db_max_idle", new AtomicInteger(0));
minIdleGauge = meterRegistry.gauge("db_min_idle", new AtomicInteger(0)); minIdleGauge = meterRegistry.gauge("db_min_idle", new AtomicInteger(0));
...@@ -61,6 +62,7 @@ public class PrometheusSchedulerCustomJob { ...@@ -61,6 +62,7 @@ public class PrometheusSchedulerCustomJob {
idleChannelsNotTxHighWaterGauge.set(Integer.parseInt(cacheProperties.getOrDefault("idleChannelsNotTxHighWater", 0).toString())); idleChannelsNotTxHighWaterGauge.set(Integer.parseInt(cacheProperties.getOrDefault("idleChannelsNotTxHighWater", 0).toString()));
activeCountGauge.set(druidDataSource.getActiveCount()); activeCountGauge.set(druidDataSource.getActiveCount());
poolingCountGauge.set(druidDataSource.getPoolingCount());
maxActiveGauge.set(druidDataSource.getMaxActive()); maxActiveGauge.set(druidDataSource.getMaxActive());
maxIdleGauge.set(druidDataSource.getMaxIdle()); maxIdleGauge.set(druidDataSource.getMaxIdle());
minIdleGauge.set(druidDataSource.getMinIdle()); minIdleGauge.set(druidDataSource.getMinIdle());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment