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

Error Logging in FastHttpUser #2937

Open
cyberw opened this issue Oct 10, 2024 Discussed in #2936 · 8 comments
Open

Error Logging in FastHttpUser #2937

cyberw opened this issue Oct 10, 2024 Discussed in #2936 · 8 comments
Assignees
Labels
hacktoberfest See https://hacktoberfest.digitalocean.com for more info

Comments

@cyberw
Copy link
Collaborator

cyberw commented Oct 10, 2024

Discussed in https://github.com/orgs/locustio/discussions/2936

Originally posted by swaalt October 10, 2024
Hi, I am using FastHttpUser and when I receive a 404 the fail is registered like this, this happens because the geventhttpclient saves in the exception the badstatuscode text the url of the request I made, which is dynamic and appears separated by each one,
I need that either I take the “name” or simply do not place anything, just place the badstatuscode 404, can this be addressed with the locust as it is now or do I have to modify something?

fails

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 10, 2024

PR:s welcome (I'll look at it myself, but no guarantees on the timing)

@cyberw cyberw added the hacktoberfest See https://hacktoberfest.digitalocean.com for more info label Oct 10, 2024
@jayantp2003
Copy link

I would like to work on this issue. Please assign me this issue.

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 12, 2024

Ideally, make it work the same as HttpUser.

@swaalt
Copy link
Contributor

swaalt commented Oct 15, 2024

I made this change to make the URL parameter optional by modifying the repository for geventhttpuser, then modified the use of that class in the Locust repository by removing the use of the url parameter in the "LocustUserAgent" class in fasthttp.py.

geventhttpclient:swaalt/geventhttpclient@94253d4

fasthttp:swaalt@ef4d4c3

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 16, 2024

Interesting. But maybe even better/easier to subclass the ConnectionError class (in locust) and override the __repr__ method there? Such a PR would be most welcome!

@swaalt
Copy link
Contributor

swaalt commented Oct 16, 2024

Would that be okay?
swaalt@c9192ac

@cyberw
Copy link
Collaborator Author

cyberw commented Oct 16, 2024

Looks great! PR it? Maybe add a test case for it? (ignore any other errors, the tests are a bit flaky atm)

@swaalt
Copy link
Contributor

swaalt commented Oct 16, 2024

Attach the PR : #2944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest See https://hacktoberfest.digitalocean.com for more info
Projects
None yet
Development

No branches or pull requests

3 participants