-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
interop client: provide new flag, --soak_min_time_ms_between_rpcs #5421
Conversation
interop/test_utils.go
Outdated
@@ -747,6 +751,14 @@ func DoSoakTest(tc testgrpc.TestServiceClient, serverAddr string, dopts []grpc.D | |||
continue | |||
} | |||
fmt.Fprintf(os.Stderr, "soak iteration: %d elapsed_ms: %d succeeded\n", i, latencyMs) | |||
if t != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a time.Ticker
above, could you consider doing the following here?
if minTimeBetweenRPCs != 0 {
<-time.After(minTimeBetweenRPCs)
}
With this approach, you wouldn't have to worry about stopping the ticker below.
Also, I'm not quite sure if time.After()
returns immediately if it is passed a duration of 0
. If that is the case, you would need to check if the duration is non-zero either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, nice cleanup!
I made a slight change to your comment, which is to create the time.After channel before performing the RPC, and then wait on it after. This is because the flag is meant to control min time between RPC starts, rather than between finishes and starts.
Could you please resolve the conflicts and re-assign it to me. I will merge it then. Thanks. |
@easwars I've fixed merge conflicts, thanks |
Looks like you need to run |
Done, thanks for catching |
This flag already exists in the C++ client, and is described under https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md#rpc_soak.
Adding this flag helps to use this client in some tests where we want to run RPCs at a certain QPS.
RELEASE NOTES: none