change arthas threads to be daemon #1346

This commit is contained in:
hengyunabc
2020-07-17 20:53:17 +08:00
parent 927adc9ab5
commit cee21c049c
4 changed files with 12 additions and 2 deletions
@@ -122,7 +122,7 @@ public class ArthasBootstrap {
executorService = Executors.newScheduledThreadPool(1, new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r, "as-command-execute-daemon");
final Thread t = new Thread(r, "arthas-command-execute");
t.setDaemon(true);
return t;
}
@@ -153,6 +153,7 @@ public class ShellServerImpl extends ShellServer {
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r, "arthas-shell-server");
t.setDaemon(true);
return t;
}
});
@@ -111,6 +111,7 @@ public class SessionManagerImpl implements SessionManager {
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r, "arthas-shell-server");
t.setDaemon(true);
return t;
}
});
@@ -9,6 +9,7 @@ import java.net.URLEncoder;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
/**
* Arthas 使用情况统计
@@ -16,7 +17,14 @@ import java.util.concurrent.Executors;
* Created by zhuyong on 15/11/12.
*/
public class UserStatUtil {
private static final ExecutorService executorService = Executors.newSingleThreadExecutor();
private static final ExecutorService executorService = Executors.newSingleThreadExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r, "arthas-UserStat");
t.setDaemon(true);
return t;
}
});
private static final String ip = IPUtils.getLocalIP();
private static final String version = URLEncoder.encode(ArthasBanner.version().replace("\n", ""));