Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bench test use grpc #6049

Merged
merged 2 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bench:
```yaml
cadence:
service: "cadence-frontend" # frontend service name
host: "127.0.0.1:7933" # frontend address
host: "127.0.0.1:7833" # frontend address
#metrics: ... # optional detailed client side metrics like workflow latency
```
- **Metrics**: metrics configuration. Similar to server metric emitter, only M3/Statsd/Prometheus is supported.
Expand Down
11 changes: 4 additions & 7 deletions bench/lib/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"go.uber.org/cadence/.gen/go/shared"
"go.uber.org/cadence/client"
"go.uber.org/yarpc"
"go.uber.org/yarpc/transport/tchannel"
"go.uber.org/yarpc/transport/grpc"
)

const workflowRetentionDays = 1
Expand Down Expand Up @@ -92,17 +92,14 @@ func NewCadenceClientForDomain(
domain string,
) (CadenceClient, error) {

ch, err := tchannel.NewChannelTransport(
tchannel.ServiceName(runtime.Bench.Name),
transport := grpc.NewTransport(
grpc.ServiceName(runtime.Bench.Name),
)
if err != nil {
return CadenceClient{}, fmt.Errorf("failed to create transport channel: %v", err)
}

dispatcher := yarpc.NewDispatcher(yarpc.Config{
Name: runtime.Bench.Name,
Outbounds: yarpc.Outbounds{
runtime.Cadence.ServiceName: {Unary: ch.NewSingleOutbound(runtime.Cadence.HostNameAndPort)},
runtime.Cadence.ServiceName: {Unary: transport.NewSingleOutbound(runtime.Cadence.HostNameAndPort)},
},
})

Expand Down
2 changes: 1 addition & 1 deletion config/bench/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bench:

cadence:
service: "cadence-frontend"
host: "${CADENCE_FRONTEND_ADDRESS:127.0.0.1:7933}"
host: "${CADENCE_FRONTEND_ADDRESS:127.0.0.1:7833}"

metrics:
statsd: ~
Expand Down
Loading