【发布时间】:2019-12-18 01:28:56
【问题描述】:
我正在尝试微调 hystrix 线程池核心大小和最大大小。为此,我需要随时了解并绘制池中的活动线程数。有办法吗?
这是正确的方法吗?
HystrixThreadPoolKey hystrixThreadPoolKey = new HystrixThreadPoolKey() {
@Override
public String name() {
return threadPoolKey;
}
};
HystrixThreadPoolMetrics hystrixThreadPoolMetrics = HystrixThreadPoolMetrics.getInstance(hystrixThreadPoolKey);
log.info("Hystrix active threads: {}", hystrixThreadPoolMetrics.getCurrentActiveCount().toString());
我不确定,因为当我使用它时,当 corePoolSize 设置为 10 时,活动线程数为 0。
【问题讨论】:
标签: threadpool java-threads hystrix