add MaxConcurrentStreams to benchmark_test when start the server (#1271)
This commit is contained in:
committed by
Menghan Li
parent
bb3728664d
commit
6bb76488de
@ -16,7 +16,7 @@ import (
|
|||||||
func runUnary(b *testing.B, maxConcurrentCalls int) {
|
func runUnary(b *testing.B, maxConcurrentCalls int) {
|
||||||
s := stats.AddStats(b, 38)
|
s := stats.AddStats(b, 38)
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"})
|
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"}, grpc.MaxConcurrentStreams(uint32(maxConcurrentCalls+1)))
|
||||||
defer stopper()
|
defer stopper()
|
||||||
conn := NewClientConn(target, grpc.WithInsecure())
|
conn := NewClientConn(target, grpc.WithInsecure())
|
||||||
tc := testpb.NewBenchmarkServiceClient(conn)
|
tc := testpb.NewBenchmarkServiceClient(conn)
|
||||||
@ -59,7 +59,7 @@ func runUnary(b *testing.B, maxConcurrentCalls int) {
|
|||||||
func runStream(b *testing.B, maxConcurrentCalls int) {
|
func runStream(b *testing.B, maxConcurrentCalls int) {
|
||||||
s := stats.AddStats(b, 38)
|
s := stats.AddStats(b, 38)
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"})
|
target, stopper := StartServer(ServerInfo{Addr: "localhost:0", Type: "protobuf"}, grpc.MaxConcurrentStreams(uint32(maxConcurrentCalls+1)))
|
||||||
defer stopper()
|
defer stopper()
|
||||||
conn := NewClientConn(target, grpc.WithInsecure())
|
conn := NewClientConn(target, grpc.WithInsecure())
|
||||||
tc := testpb.NewBenchmarkServiceClient(conn)
|
tc := testpb.NewBenchmarkServiceClient(conn)
|
||||||
|
|||||||
Reference in New Issue
Block a user