From c90e6ed9a7ee5ea05a946b54267631c14023e77f Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 10 Jul 2018 15:42:17 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-9508=20jboss=E5=90=AF=E5=8A=A8=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20druid=E5=AF=B9spring=E7=9A=84=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=88=91=E4=BB=AC=E4=B9=9F=E7=94=A8=E4=B8=8D=E5=88=B0=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../druid/support/monitor/MonitorClient.java | 39 +------------------ .../druid/support/monitor/dao/MonitorDao.java | 15 +++---- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/MonitorClient.java b/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/MonitorClient.java index 4b711eef3..b8f983c7d 100644 --- a/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/MonitorClient.java +++ b/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/MonitorClient.java @@ -26,9 +26,6 @@ import com.fr.third.alibaba.druid.support.http.stat.WebURIStatValue; import com.fr.third.alibaba.druid.support.logging.Log; import com.fr.third.alibaba.druid.support.logging.LogFactory; import com.fr.third.alibaba.druid.support.monitor.dao.MonitorDao; -import com.fr.third.alibaba.druid.support.spring.stat.SpringMethodStatValue; -import com.fr.third.alibaba.druid.support.spring.stat.SpringStat; -import com.fr.third.alibaba.druid.support.spring.stat.SpringStatManager; import com.fr.third.alibaba.druid.util.StringUtils; import com.fr.third.alibaba.druid.util.Utils; import com.fr.third.alibaba.druid.wall.WallProviderStatValue; @@ -47,8 +44,6 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import static com.fr.third.alibaba.druid.util.Utils.getBoolean; - public class MonitorClient { private final static Log LOG = LogFactory.getLog(MonitorClient.class); @@ -192,14 +187,6 @@ public class MonitorClient { } }, timeBetweenSqlCollect, timeBetweenSqlCollect, timeUnit); - scheduler.scheduleAtFixedRate(new Runnable() { - - @Override - public void run() { - collectSpringMethod(); - } - }, timeBetweenSpringCollect, timeBetweenSpringCollect, timeUnit); - scheduler.scheduleAtFixedRate(new Runnable() { @Override @@ -284,31 +271,7 @@ public class MonitorClient { ctx.setCollectTime(Utils.getStartTime()); return ctx; } - - private void collectSpringMethod() { - if (!collectSpringMethodEnable) { - return; - } - - List statValueList = new ArrayList(); - - Set stats = SpringStatManager.getInstance().getSpringStatSet(); - - for (Object item : stats) { - if (!(item instanceof SpringStat)) { - continue; - } - - SpringStat sprintStat = (SpringStat) item; - statValueList.addAll(sprintStat.getStatList(true)); - } - - if (statValueList.size() > 0) { - MonitorContext ctx = createContext(); - dao.saveSpringMethod(ctx, statValueList); - } - } - + private void collectWebURI() { if ((!collectWebAppEnable) && !collectWebURIEnable) { return; diff --git a/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDao.java b/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDao.java index ccd256edb..5e808f5cb 100644 --- a/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDao.java +++ b/fine-druid/src/com/fr/third/alibaba/druid/support/monitor/dao/MonitorDao.java @@ -15,27 +15,24 @@ */ package com.fr.third.alibaba.druid.support.monitor.dao; -import java.sql.SQLException; -import java.util.Date; -import java.util.List; -import java.util.Map; - import com.fr.third.alibaba.druid.pool.DruidDataSourceStatValue; import com.fr.third.alibaba.druid.stat.JdbcSqlStatValue; import com.fr.third.alibaba.druid.support.http.stat.WebAppStatValue; import com.fr.third.alibaba.druid.support.http.stat.WebURIStatValue; import com.fr.third.alibaba.druid.support.monitor.MonitorContext; -import com.fr.third.alibaba.druid.support.spring.stat.SpringMethodStatValue; import com.fr.third.alibaba.druid.wall.WallProviderStatValue; +import java.sql.SQLException; +import java.util.Date; +import java.util.List; +import java.util.Map; + public interface MonitorDao { void saveSql(MonitorContext ctx, List statList); void saveSqlWall(MonitorContext ctx, List statList); - - void saveSpringMethod(MonitorContext ctx, List methodList); - + void saveWebURI(MonitorContext ctx, List uriList); void saveWebApp(MonitorContext ctx, List uriList);