init:项目初始化删除无用依赖
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
package org.nl.config.redis;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
import org.nl.system.service.redis.vo.RedisMonitorRespVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: redis---Spring Boot 对象转换 MapStruct
|
||||
* @Date: 2022-08-04
|
||||
*/
|
||||
@Mapper
|
||||
public interface RedisConvert {
|
||||
|
||||
RedisConvert INSTANCE = Mappers.getMapper(RedisConvert.class);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param info
|
||||
* @param dbSize
|
||||
* @param commandStats
|
||||
* @return RedisMonitorRespVO
|
||||
*/
|
||||
default RedisMonitorRespVO build(Properties info, Long dbSize, Properties commandStats) {
|
||||
RedisMonitorRespVO respVO = RedisMonitorRespVO.builder().info(info).dbSize(dbSize)
|
||||
.commandStats(new ArrayList<>(commandStats.size())).build();
|
||||
commandStats.forEach((key, value) -> {
|
||||
respVO.getCommandStats().add(RedisMonitorRespVO.CommandStat.builder()
|
||||
.command(StrUtil.subAfter((String) key, "cmdstat_", false))
|
||||
.calls(Integer.valueOf(StrUtil.subBetween((String) value, "calls=", ",")))
|
||||
.usec(Long.valueOf(StrUtil.subBetween((String) value, "usec=", ",")))
|
||||
.build());
|
||||
});
|
||||
return respVO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +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";
|
||||
}
|
||||
}
|
||||
//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";
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user