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

Add gRPC load test example #1755

Merged
merged 2 commits into from May 5, 2021
Merged

Conversation

beandrad
Copy link

@beandrad beandrad commented May 4, 2021

This PR has two commits:

This allows to use an overridden `stop()` method when the Locust
runner stops the user, which allows for more flexibility without
introducing additional complexity.

One of the use cases is being able to close a gRPC channel before
killing the user greenlet.
@beandrad beandrad force-pushed the ia.grpc-example branch 3 times, most recently from 3822a9a to 2bc1f81 Compare May 4, 2021 16:39
@cyberw
Copy link
Collaborator

cyberw commented May 5, 2021

Looks good! Just auto-format the files using Black and I can merge.

Due to two main reason: (1) grpcio needs to be "patched" to use `gevent`
and (2) the existing patch has a bug (see
(grpc#15880)[grpc/grpc#15880]) implementing
gRPC load tests using Locust is not immediately obvious.

This example showcases how to implement a simple load test against
a gPRC server making sure that the requests are asynchronous.
@cyberw cyberw merged commit ac88fdc into locustio:master May 5, 2021
@cyberw
Copy link
Collaborator

cyberw commented May 5, 2021

thanks!

@Liuyanzhi
Copy link

@beandrad Please ask weather support grpc BidirectStrem interface? I used Generator to grpc stream method, but the test case was stuck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants