定时任务调度多线程任务修改
` ExecutorService executorService = new ThreadPoolExecutor(6, 6,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue
.setNameFormat("assetMonitorExtractor---%d").build(), new ThreadPoolExecutor.AbortPolicy());//Executors.newFixedThreadPool(6);
List<Runnable> tasks = Arrays.asList(
() -> {
// 被动资产实时
sparkService.monitorAssetPids();
}, () -> {
// 被动资产定时
sparkService.monitorDayPids();
}, () -> {
// 告警实时
sparkService.monitorAlarmPids();
}, () -> {
// 异常流实时
sparkService.monitorEventPids();
}, () -> {
// spark监控
sparkService.monitorSparkPids();
}, () -> {
// 一拖N实时
sparkService.tractorSparkPids();
});
tasks.forEach(executorService::submit);
executorService.shutdown();`
借助arthas进行线程和内存的定位。