Skip to content

Commit

Permalink
fix:Fix the problem that a custom implementation class of ThreadPoolM…
Browse files Browse the repository at this point in the history
…onitor cannot be introduced through the SPI mechanism in the ReportingEventExecutor class when the project is started. (#1518)
  • Loading branch information
Dawanyezhi committed Nov 24, 2023
1 parent c783306 commit f49fd99
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +50,10 @@ public DynamicThreadPoolMicrometerMonitorHandler(ThreadPoolRunStateHandler handl
super(handler);
}

static {
ServiceLoaderRegistry.register(ThreadPoolMonitor.class);
}

@Override
protected void execute(ThreadPoolRunStateInfo poolRunStateInfo) {
ThreadPoolRunStateInfo stateInfo = runStateCache.get(poolRunStateInfo.getTpId());
Expand Down

0 comments on commit f49fd99

Please sign in to comment.