Skip to content

Commit 0a51086

Browse files
authored
Fix grpc h2load go gRPC clients (#1515)
1 parent 4d084d7 commit 0a51086

File tree

6 files changed

+24
-2
lines changed

6 files changed

+24
-2
lines changed

build/grpc-v2-scenarios.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ steps:
9797
messageBody: |
9898
{
9999
"name": "benchmarksdriver2",
100-
"args": [ "--application.aspnetcoreversion Latest --table GrpcBenchmarks --sql SQL_CONNECTION_STRING --session $(session) --profile ${{ parameters.profile }} --no-metadata --no-measurements --load.variables.duration ${{ parameters.duration }} --load.variables.warmup ${{ parameters.warmup }} ${{ s.arguments }} ${{ protocol.arguments }} ${{ stream.arguments }} --property scenario=unary --property payload=0" ]
100+
"args": [ "--application.aspnetcoreversion Latest --table GrpcBenchmarks --sql SQL_CONNECTION_STRING --session $(session) --profile ${{ parameters.profile }} --no-metadata --no-measurements --load.variables.duration ${{ parameters.duration }} --load.variables.warmup ${{ parameters.warmup }} ${{ s.arguments }} ${{ protocol.arguments }} ${{ stream.arguments }} --property scenario=unary --property payload=0 --variable body=AAAAAAcKBVdvcmxk --variable path=/grpc.testing.BenchmarkService/UnaryCall" ]
101101
}
102102
- ${{ each s in parameters.scenarios }}:
103103
- ${{ each callType in parameters.callTypes }}:

src/BenchmarksApps/Grpc/GoClient/grpc-go-client.yml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
dockerContextDirectory: src/BenchmarksApps/Grpc/GoClient/
88
dockerFile: src/BenchmarksApps/Grpc/GoClient/Dockerfile
99
readyStateText: gRPC Client
10+
waitForExit: true
1011
variables:
1112
connections: 1
1213
warmup: 5
@@ -27,5 +28,7 @@ jobs:
2728
WARMUP: '{{warmup}}'
2829
REQUEST_SIZE: '{{requestSize}}'
2930
RESPONSE_SIZE: '{{responseSize}}'
31+
#GRPC_GO_LOG_VERBOSITY_LEVEL: 99
32+
#GRPC_GO_LOG_SEVERITY_LEVEL: info
3033
options:
3134
requiredOperatingSystem: linux

src/BenchmarksApps/Grpc/GoClient/main.go

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ func main() {
8686
opts = append(opts, grpc.WithInsecure())
8787
}
8888

89+
opts = append(opts, grpc.WithBlock())
90+
8991
// Create connections and related collections
9092
buildConnections(context.Background(), opts)
9193

@@ -115,6 +117,8 @@ func main() {
115117
runWithConn(connectionID, cc)
116118
}
117119
// Wait for caller threads to finish
120+
121+
fmt.Print("Waiting for caller threads to finish\n")
118122
finishedWg.Wait()
119123

120124
fmt.Print("Caller threads finished\n")

src/BenchmarksDriver2/benchmarks.grpc.yml

+6
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,22 @@ scenarios:
7878
job: grpcAspNetCoreServer
7979
load:
8080
job: h2LoadClient
81+
variables:
82+
presetHeaders: grpc
8183
grpccoreserver-h2loadclient:
8284
application:
8385
job: grpcCoreServer
8486
load:
8587
job: h2LoadClient
88+
variables:
89+
presetHeaders: grpc
8690
grpcgoserver-h2loadclient:
8791
application:
8892
job: grpcGoServer
8993
load:
9094
job: h2LoadClient
95+
variables:
96+
presetHeaders: grpc
9197

9298
profiles:
9399
aspnet-physical-lin:

src/H2LoadClient/Program.cs

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ static async Task Main(string[] args)
6464
Console.WriteLine($"Header: {key}={value}");
6565
}
6666

67+
if (Headers.Count == 0)
68+
{
69+
Console.WriteLine("No headers");
70+
}
71+
6772
if (optionBody.HasValue())
6873
{
6974
var requestBody = Convert.FromBase64String(optionBody.Value());
@@ -77,11 +82,14 @@ static async Task Main(string[] args)
7782
}
7883

7984
var process = StartProcess();
85+
86+
Console.WriteLine("Waiting for process exit");
8087
process.WaitForExit();
8188

8289
// Wait for all Output messages to be flushed and available in Output
8390
await Task.Delay(100);
8491

92+
Console.WriteLine("Parsing output");
8593
ParseOutput();
8694
});
8795

src/H2LoadClient/h2load.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
duration: 15
2323
warmup: 5
2424
protocol: h2c
25+
body: ''
2526
presetHeaders: none
26-
arguments: "-c {{connections}} -t {{threads}} -m {{streams}} -d {{duration}} -w {{warmup}} -u {{serverUri}}:{{serverPort}}{{path}} -p {{ protocol }} {{headers[presetHeaders]}} {% if body != null %} --body {{ body }} {% endif %}"
27+
arguments: "-c {{connections}} -t {{threads}} -m {{streams}} -d {{duration}} -w {{warmup}} -u {{serverUri}}:{{serverPort}}{{path}} -p {{ protocol }} {{headers[presetHeaders]}} {% if body != '' %} --body {{ body }} {% endif %}"
2728
options:
2829
requiredOperatingSystem: linux

0 commit comments

Comments
 (0)