arthas thread with name

This commit is contained in:
hengyunabc
2020-07-17 20:27:28 +08:00
parent 73e8fcc820
commit eacc5081fd
3 changed files with 6 additions and 3 deletions
@@ -55,6 +55,7 @@ import com.taobao.arthas.core.util.LogUtil;
import com.taobao.arthas.core.util.UserStatUtil;
import io.netty.channel.ChannelFuture;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.EventExecutorGroup;
@@ -314,7 +315,7 @@ public class ArthasBootstrap {
resolvers.add(builtinCommands);
//worker group
workerGroup = new NioEventLoopGroup(8);
workerGroup = new NioEventLoopGroup(new DefaultThreadFactory("arthas-TermServer", true));
// TODO: discover user provided command resolver
if (configure.getTelnetPort() > 0) {
@@ -10,6 +10,7 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.EventExecutorGroup;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
@@ -58,7 +59,7 @@ public class NettyWebsocketTtyBootstrap {
}
public void start(Consumer<TtyConnection> handler, final Consumer<Throwable> doneHandler) {
group = new NioEventLoopGroup();
group = new NioEventLoopGroup(new DefaultThreadFactory("arthas-NettyWebsocketTtyBootstrap", true));
ServerBootstrap b = new ServerBootstrap();
b.group(group).channel(NioServerSocketChannel.class).handler(new LoggingHandler(LogLevel.INFO))
@@ -11,6 +11,7 @@ import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.concurrent.EventExecutorGroup;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
@@ -33,7 +34,7 @@ public class NettyHttpTelnetBootstrap extends TelnetBootstrap {
public NettyHttpTelnetBootstrap(EventExecutorGroup workerGroup) {
this.workerGroup = workerGroup;
this.group = new NioEventLoopGroup();
this.group = new NioEventLoopGroup(new DefaultThreadFactory("arthas-NettyHttpTelnetBootstrap", true));
this.channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE);
}