|
|
@ -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.Log; |
|
|
|
import com.fr.third.alibaba.druid.support.logging.LogFactory; |
|
|
|
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.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.StringUtils; |
|
|
|
import com.fr.third.alibaba.druid.util.Utils; |
|
|
|
import com.fr.third.alibaba.druid.util.Utils; |
|
|
|
import com.fr.third.alibaba.druid.wall.WallProviderStatValue; |
|
|
|
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.ScheduledThreadPoolExecutor; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
import static com.fr.third.alibaba.druid.util.Utils.getBoolean; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MonitorClient { |
|
|
|
public class MonitorClient { |
|
|
|
|
|
|
|
|
|
|
|
private final static Log LOG = LogFactory.getLog(MonitorClient.class); |
|
|
|
private final static Log LOG = LogFactory.getLog(MonitorClient.class); |
|
|
@ -192,14 +187,6 @@ public class MonitorClient { |
|
|
|
} |
|
|
|
} |
|
|
|
}, timeBetweenSqlCollect, timeBetweenSqlCollect, timeUnit); |
|
|
|
}, timeBetweenSqlCollect, timeBetweenSqlCollect, timeUnit); |
|
|
|
|
|
|
|
|
|
|
|
scheduler.scheduleAtFixedRate(new Runnable() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
collectSpringMethod(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, timeBetweenSpringCollect, timeBetweenSpringCollect, timeUnit); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scheduler.scheduleAtFixedRate(new Runnable() { |
|
|
|
scheduler.scheduleAtFixedRate(new Runnable() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -285,30 +272,6 @@ public class MonitorClient { |
|
|
|
return ctx; |
|
|
|
return ctx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void collectSpringMethod() { |
|
|
|
|
|
|
|
if (!collectSpringMethodEnable) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SpringMethodStatValue> statValueList = new ArrayList<SpringMethodStatValue>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set<Object> 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() { |
|
|
|
private void collectWebURI() { |
|
|
|
if ((!collectWebAppEnable) && !collectWebURIEnable) { |
|
|
|
if ((!collectWebAppEnable) && !collectWebURIEnable) { |
|
|
|
return; |
|
|
|
return; |
|
|
|