Error Logging in FastHttpUser
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?
PR:s welcome (I'll look at it myself, but no guarantees on the timing)
I would like to work on this issue. Please assign me this issue.
Ideally, make it work the same as HttpUser.
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:https://github.com/swaalt/geventhttpclient/commit/94253d42d6c33f0c09fadd82ecf1821f81dbaf59
fasthttp:https://github.com/swaalt/locust/commit/ef4d4c3188985fb461cc5a0604fe89a3e5e8a12f
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!
Would that be okay? https://github.com/swaalt/locust/commit/c9192ac0a0ec7a58c70d57b5bc112b3c7e9f9152
Looks great! PR it? Maybe add a test case for it? (ignore any other errors, the tests are a bit flaky atm)
Attach the PR : https://github.com/locustio/locust/pull/2944