|
|
@@ -3,6 +3,11 @@ package com.ningdatech.pmapi.sys.manage; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.LinkedBlockingDeque; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Classname CpuManage |
|
|
|
* @Description |
|
|
@@ -17,6 +22,21 @@ public class CpuManage { |
|
|
|
|
|
|
|
private int[][] matrix = new int[1][1]; |
|
|
|
|
|
|
|
private static ExecutorService executorService = null; |
|
|
|
|
|
|
|
private static Integer THREAD_MAX = 10; |
|
|
|
|
|
|
|
private static Integer THREAD_IDLE = 20; |
|
|
|
|
|
|
|
private static Integer THREAD_CAPACITY = 30; |
|
|
|
|
|
|
|
// static { |
|
|
|
// executorService = new ThreadPoolExecutor(THREAD_MAX,THREAD_MAX, |
|
|
|
// THREAD_IDLE, TimeUnit.SECONDS, |
|
|
|
// new LinkedBlockingDeque<>(THREAD_CAPACITY), |
|
|
|
// null,null); |
|
|
|
// } |
|
|
|
|
|
|
|
public void open(int i){ |
|
|
|
Double pow = Math.pow(10, i); |
|
|
|
matrix = new int[pow.intValue()][pow.intValue()]; |
|
|
|