fix:Fix the problem that a custom implementation class of ThreadPoolMonitor cannot be introduced through the SPI mechanism in the ReportingEventExecutor class when the project is started. (#1518)

pull/1513/merge
yezi 7 months ago committed by GitHub
parent c783306939
commit f49fd99791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,12 +17,14 @@
package cn.hippo4j.monitor.micrometer;
import cn.hippo4j.common.extension.spi.ServiceLoaderRegistry;
import cn.hippo4j.core.config.ApplicationContextHolder;
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
import cn.hippo4j.common.toolkit.BeanUtil;
import cn.hippo4j.common.toolkit.CollectionUtil;
import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler;
import cn.hippo4j.monitor.base.AbstractDynamicThreadPoolMonitor;
import cn.hippo4j.threadpool.monitor.api.ThreadPoolMonitor;
import cn.hippo4j.threadpool.monitor.support.MonitorTypeEnum;
import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.Tag;
@ -48,6 +50,10 @@ public class DynamicThreadPoolMicrometerMonitorHandler extends AbstractDynamicTh
super(handler);
}
static {
ServiceLoaderRegistry.register(ThreadPoolMonitor.class);
}
@Override
protected void execute(ThreadPoolRunStateInfo poolRunStateInfo) {
ThreadPoolRunStateInfo stateInfo = runStateCache.get(poolRunStateInfo.getTpId());

Loading…
Cancel
Save