-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Updated request event with context and deprecate request_failure/success #1750
Conversation
Will also add kwargs handling to request events.
…led requests. The old request_success and request_failed still exists but should probably be removed at some point.
Got some errors in the build there, but other than that (and my comments) it looks good. Oh, and dont forget to update the xmlrpc example (both in examples/ and in extending-locust.rst) |
Oh, and write something clever in changelog.rst |
Will allow getting the calling user in the request event.
Context returned from this method is forwarded in requests performed with httpSession and fastHttpSession. Allows context to be connected to a User.
@@ -322,6 +315,7 @@ def __init__(self, environment): | |||
max_redirects=self.max_redirects, | |||
max_retries=self.max_retries, | |||
insecure=self.insecure, | |||
user=self, |
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.
fudge. seems like we might as well be passing only self
docs/testing-other-systems.rst
Outdated
@@ -32,7 +31,7 @@ using ``abstract = True`` which means that Locust will not try to create simulat | |||
|
|||
The ``XmlRpcClient`` is a wrapper around the standard | |||
library's :py:class:`xmlrpc.client.ServerProxy`. It basically just proxies the function calls, but with the | |||
important addition of firing :py:attr:`locust.event.Events.request_success` and :py:attr:`locust.event.Events.request_failure` | |||
important addition of firing :py:attr:`locust.event.Events.request` | |||
events, which will record all calls in Locust's statistics. |
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.
event, not events :)
… little bit to the discussion in #1750
Add a single event thats triggered both on request succes/failure #1724
This new event can contain metadata (called context) which can be specified when performing the request.