This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git


The following commit(s) were added to refs/heads/main by this push:
     new bc20c6e888 remove idleCount in druid plugin (#679)
bc20c6e888 is described below

commit bc20c6e888e35c6a9bc9aba92c907976c3ad1187
Author: dingjiefei <1264677...@qq.com>
AuthorDate: Wed Apr 10 22:14:14 2024 +0800

    remove idleCount in druid plugin (#679)
---
 .../apm/plugin/druid/v1/PoolingAddDruidDataSourceInterceptor.java | 3 +--
 test/plugin/scenarios/druid-1.x-scenario/config/expectedData.yaml | 8 +-------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git 
a/apm-sniffer/apm-sdk-plugin/druid-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/druid/v1/PoolingAddDruidDataSourceInterceptor.java
 
b/apm-sniffer/apm-sdk-plugin/druid-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/druid/v1/PoolingAddDruidDataSourceInterceptor.java
index 63a85409de..03416103b2 100644
--- 
a/apm-sniffer/apm-sdk-plugin/druid-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/druid/v1/PoolingAddDruidDataSourceInterceptor.java
+++ 
b/apm-sniffer/apm-sdk-plugin/druid-1.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/druid/v1/PoolingAddDruidDataSourceInterceptor.java
@@ -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());
diff --git a/test/plugin/scenarios/druid-1.x-scenario/config/expectedData.yaml 
b/test/plugin/scenarios/druid-1.x-scenario/config/expectedData.yaml
index 79b64a8ab5..ca4a349b5b 100644
--- a/test/plugin/scenarios/druid-1.x-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/druid-1.x-scenario/config/expectedData.yaml
@@ -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:

Reply via email to