benchmarks: Use correct ELG type for TransportBenchmark NETTY_LOCAL test (#5492)

Netty LocalChannels are meant to be used with the DefaultEventLoopGroup, but the gRPC channel/server builders use NioEventLoopGroups by default.
This commit is contained in:
Nick Hill 2019-03-25 10:22:29 -07:00 committed by Jihun Cho
parent f4a31ec62d
commit c8ffa8a8db
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import io.grpc.netty.NettyChannelBuilder;
import io.grpc.netty.NettyServerBuilder;
import io.grpc.okhttp.OkHttpChannelBuilder;
import io.netty.channel.Channel;
import io.netty.channel.DefaultEventLoopGroup;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.ServerChannel;
import io.netty.channel.local.LocalAddress;
@ -95,9 +96,13 @@ public class TransportBenchmark {
{
String name = "bench" + Math.random();
LocalAddress address = new LocalAddress(name);
EventLoopGroup group = new DefaultEventLoopGroup();
serverBuilder = NettyServerBuilder.forAddress(address)
.bossEventLoopGroup(group)
.workerEventLoopGroup(group)
.channelType(LocalServerChannel.class);
channelBuilder = NettyChannelBuilder.forAddress(address)
.eventLoopGroup(group)
.channelType(LocalChannel.class)
.negotiationType(NegotiationType.PLAINTEXT);
break;