fix: dynamic
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
||||
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
||||
|
||||
import org.dromara.dynamictp.core.spring.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.nl.common.annotation.Limit;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
@@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
QuartzAutoConfiguration.class,
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableDynamicTp
|
||||
@ServletComponentScan
|
||||
@EnableTransactionManagement
|
||||
@EnableMethodCache(basePackages = "org.nl")
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.config.thread;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.dynamictp.common.entity.ThreadPoolStats;
|
||||
import org.dromara.dynamictp.core.monitor.collector.AbstractCollector;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 线程监控
|
||||
* @Date: 2023/12/25
|
||||
*/
|
||||
@Slf4j
|
||||
public class ThreadMonitorCollector extends AbstractCollector {
|
||||
public static ThreadPoolStats TOMCAT_THREAD;
|
||||
public static ThreadPoolStats EL_THREAD;
|
||||
@Override
|
||||
public void collect(ThreadPoolStats threadPoolStats) {
|
||||
if ("tomcatTp".equals(threadPoolStats.getPoolName())) {
|
||||
ThreadMonitorCollector.TOMCAT_THREAD = threadPoolStats;
|
||||
} else {
|
||||
ThreadMonitorCollector.EL_THREAD = threadPoolStats;
|
||||
}
|
||||
log.info("线程池数据:{}", threadPoolStats);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String type() {
|
||||
return "test_collect";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
# org.nl.config.thread.ThreadMonitorCollector
|
||||
Reference in New Issue
Block a user