|
|
|
@ -29,10 +29,11 @@ import cn.hippo4j.springboot.starter.monitor.collect.Collector;
|
|
|
|
|
import cn.hippo4j.springboot.starter.monitor.send.MessageSender;
|
|
|
|
|
import cn.hippo4j.springboot.starter.remote.ServerHealthCheck;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import com.example.monitor.base.DynamicThreadPoolMonitor;
|
|
|
|
|
import com.example.monitor.base.MonitorTypeEnum;
|
|
|
|
|
import com.example.monitor.base.ThreadPoolMonitor;
|
|
|
|
|
import cn.hippo4j.monitor.base.DynamicThreadPoolMonitor;
|
|
|
|
|
import cn.hippo4j.monitor.base.MonitorTypeEnum;
|
|
|
|
|
import cn.hippo4j.monitor.base.ThreadPoolMonitor;
|
|
|
|
|
import com.google.common.base.Strings;
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import lombok.NonNull;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.SneakyThrows;
|
|
|
|
@ -40,10 +41,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.DisposableBean;
|
|
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.ArrayBlockingQueue;
|
|
|
|
|
import java.util.concurrent.BlockingQueue;
|
|
|
|
|
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
|
|
|
@ -109,6 +107,7 @@ public class ReportingEventExecutor implements Runnable, CommandLineRunner, Disp
|
|
|
|
|
if (!properties.getCollect()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
threadPoolMonitors = Lists.newArrayList();
|
|
|
|
|
String collectType = Optional.ofNullable(Strings.emptyToNull(properties.getCollectType())).orElse(MonitorTypeEnum.SERVER.name().toLowerCase());
|
|
|
|
|
collectVesselExecutor = new ScheduledThreadPoolExecutor(
|
|
|
|
|
new Integer(collectType.split(",").length),
|
|
|
|
|