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 Mongodb test example #2903

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Add Mongodb test example #2903

merged 3 commits into from
Sep 17, 2024

Conversation

guel-codes
Copy link
Contributor

@guel-codes guel-codes commented Sep 14, 2024

This is a resubmission/continuation of #2882.

Additions:

  • examples/mongodb/README.md
  • examples/mongodb/locustfile.py
  • locust/contrib/mongodb.py

Updates:



class MongoDBUser(MongoDBUser):
conn_string = os.getenv("MONGODB_URI")
Copy link
Collaborator

@cyberw cyberw Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe leave this as a hardcoded string? reading from env isn't really key to this example :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call😊

@@ -0,0 +1,45 @@
from gevent import monkey

_ = monkey.patch_all()
Copy link
Collaborator

@cyberw cyberw Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importing locust should run patching? No need to do it yourself...

@cyberw
Copy link
Collaborator

cyberw commented Sep 16, 2024

Ignore the build error, its a github thing and I have fixed it in master...

@cyberw cyberw merged commit bf797b8 into locustio:master Sep 17, 2024
16 checks passed
@cyberw
Copy link
Collaborator

cyberw commented Sep 17, 2024

thx!

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.

2 participants