Skip to content

Commit 6bb7648

Browse files
ZhouyihaiDingmenghanl
authored andcommitted
add MaxConcurrentStreams to benchmark_test when start the server (#1271)
1 parent bb37286 commit 6bb7648

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benchmark/benchmark_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
func runUnary(b *testing.B, maxConcurrentCalls int) {
1717
s := stats.AddStats(b, 38)
1818
b.StopTimer()
19-
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"})
19+
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"}, grpc.MaxConcurrentStreams(uint32(maxConcurrentCalls+1)))
2020
defer stopper()
2121
conn := NewClientConn(target, grpc.WithInsecure())
2222
tc := testpb.NewBenchmarkServiceClient(conn)
@@ -59,7 +59,7 @@ func runUnary(b *testing.B, maxConcurrentCalls int) {
5959
func runStream(b *testing.B, maxConcurrentCalls int) {
6060
s := stats.AddStats(b, 38)
6161
b.StopTimer()
62-
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"})
62+
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"}, grpc.MaxConcurrentStreams(uint32(maxConcurrentCalls+1)))
6363
defer stopper()
6464
conn := NewClientConn(target, grpc.WithInsecure())
6565
tc := testpb.NewBenchmarkServiceClient(conn)

0 commit comments

Comments
 (0)