remove idleCount in druid plugin (#679)

This commit is contained in:
dingjiefei 2024-04-10 22:14:14 +08:00 committed by GitHub
parent eb1041675c
commit bc20c6e888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -58,10 +58,9 @@ public class PoolingAddDruidDataSourceInterceptor implements StaticMethodsAround
}
private Map<String, Function<DruidDataSourceMBean, Supplier<Double>>> getMetrics() {
Map<String, Function<DruidDataSourceMBean, Supplier<Double>>> metricMap = new HashMap();
Map<String, Function<DruidDataSourceMBean, Supplier<Double>>> metricMap = new HashMap<>();
metricMap.put("activeCount", (DruidDataSourceMBean druidDataSource) -> () -> (double) druidDataSource.getActiveCount());
metricMap.put("poolingCount", (DruidDataSourceMBean druidDataSource) -> () -> (double) druidDataSource.getPoolingCount());
metricMap.put("idleCount", (DruidDataSourceMBean druidDataSource) -> () -> (double) (druidDataSource.getPoolingCount() - druidDataSource.getActiveCount()));
metricMap.put("lockQueueLength", (DruidDataSourceMBean druidDataSource) -> () -> (double) druidDataSource.getLockQueueLength());
metricMap.put("maxWaitThreadCount", (DruidDataSourceMBean druidDataSource) -> () -> (double) druidDataSource.getMaxWaitThreadCount());
metricMap.put("commitCount", (DruidDataSourceMBean druidDataSource) -> () -> (double) druidDataSource.getCommitCount());

View File

@ -206,7 +206,7 @@ segmentItems:
- {key: http.status_code, value: '200'}
meterItems:
- serviceName: druid-1.x-scenario
meterSize: 14
meterSize: 13
meters:
- meterId:
name: datasource
@ -220,12 +220,6 @@ meterItems:
- {name: name, value: test_mysql-server:3306}
- {name: status, value: poolingCount}
singleValue: ge 0
- meterId:
name: datasource
tags:
- {name: name, value: test_mysql-server:3306}
- {name: status, value: idleCount}
singleValue: ge 0
- meterId:
name: datasource
tags: