From 4bb2d97ab6a8e07191b182a718b870328aa341e5 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Tue, 2 Nov 2021 16:23:57 +0100 Subject: [PATCH] Documentation: clarify request event stuff --- docs/extending-locust.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/extending-locust.rst b/docs/extending-locust.rst index d2c4097d0c..e8f5817b9c 100644 --- a/docs/extending-locust.rst +++ b/docs/extending-locust.rst @@ -23,8 +23,9 @@ For example, here's how to set up an event listener that will trigger after a re In the above example the wildcard keyword argument (\**kwargs) will be empty, because we're handling all arguments, but it is prevents the code from breaking if new arguments are added in some future version of Locust. - It is entirely possible to implement a client that does not support all parameters - (some non-HTTP protocols might not have a concept of `response_length` or `response` object). + Also, it is entirely possible to implement a client that does not supply all parameters for this event. + For example, non-HTTP protocols might not even have the a concept of `url` or `response` object. + Remove any such missing field from your listener function definition or use default arguments. When running locust in distributed mode, it may be useful to do some setup on worker nodes before running your tests. You can check to ensure you aren't running on the master node by checking the type of the node's :py:attr:`runner `::