模拟动态线程池提交任务, 查看运行以及监控数据.

pull/39/head
chen.ma 3 years ago
parent b40fc747c0
commit 88c7e25f64

@ -31,6 +31,7 @@ public class RunStateHandlerTest {
@SuppressWarnings("all") @SuppressWarnings("all")
public void runStateHandlerTest() { public void runStateHandlerTest() {
log.info("Test thread pool runtime state interface..."); log.info("Test thread pool runtime state interface...");
ThreadUtil.sleep(5000);
// 启动动态线程池模拟运行任务 // 启动动态线程池模拟运行任务
runTask(messageCenterDynamicThreadPool.getExecutor()); runTask(messageCenterDynamicThreadPool.getExecutor());
@ -42,7 +43,6 @@ public class RunStateHandlerTest {
private void runTask(ExecutorService executorService) { private void runTask(ExecutorService executorService) {
new Thread(() -> { new Thread(() -> {
ThreadUtil.sleep(5000);
for (int i = 0; i < Integer.MAX_VALUE; i++) { for (int i = 0; i < Integer.MAX_VALUE; i++) {
try { try {
executorService.execute(() -> { executorService.execute(() -> {

Loading…
Cancel
Save