From f01fcd42f65ba3d9fa3bf23edcb7f9791ccedc27 Mon Sep 17 00:00:00 2001 From: dantagg Date: Wed, 25 Mar 2015 00:59:54 +0000 Subject: [PATCH] changed how request_meta["method"] is set method was set against the request response method. In the case of a POST request being redirected to GET, common on success of POSTs for login and registration. The request is incorrectly logged against the GET method for the original URL. Closes locustio/locust#236 --- locust/clients.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locust/clients.py b/locust/clients.py index 87cb8a1dde..307d267cb1 100644 --- a/locust/clients.py +++ b/locust/clients.py @@ -107,6 +107,7 @@ def request(self, method, url, name=None, catch_response=False, **kwargs): request_meta = {} # set up pre_request hook for attaching meta data to the request object + request_meta["method"] = method request_meta["start_time"] = time.time() response = self._send_request_safe_mode(method, url, **kwargs) @@ -114,7 +115,7 @@ def request(self, method, url, name=None, catch_response=False, **kwargs): # record the consumed time request_meta["response_time"] = int((time.time() - request_meta["start_time"]) * 1000) - request_meta["method"] = response.request.method + request_meta["name"] = name or (response.history and response.history[0] or response).request.path_url # get the length of the content, but if the argument stream is set to True, we take