Skip to content

Commit

Permalink
Merge pull request #1754 from locustio/remove-accidentally-added-star…
Browse files Browse the repository at this point in the history
…t_time-parameter-to-request-event

remove accidentally added start_time parameter to request event
  • Loading branch information
cyberw authored May 4, 2021
2 parents c8fca2d + 1d2644c commit 23c69da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion locust/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def request(self, method, url, name=None, catch_response=False, context={}, **kw
# store meta data that is used when reporting the request to locust's statistics
request_meta = {
"request_type": method,
"start_time": start_time,
"response_time": (time.monotonic() - start_time) * 1000,
"name": name or (response.history and response.history[0] or response).request.path_url,
"context": context,
Expand Down
5 changes: 2 additions & 3 deletions locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def request(
# store meta data that is used when reporting the request to locust's statistics
request_meta = {
"request_type": method,
"start_time": start_time,
"name": name or path,
"context": context,
"exception": None,
Expand Down Expand Up @@ -209,7 +208,7 @@ def request(
try:
request_meta["response_length"] = len(response.content or "")
except HTTPParseError as e:
request_meta["response_time"] = int((default_timer() - request_meta["start_time"]) * 1000)
request_meta["response_time"] = int((default_timer() - start_time) * 1000)
request_meta["response_length"] = 0
request_meta["exception"] = e
self.environment.events.request.fire(**request_meta)
Expand All @@ -218,7 +217,7 @@ def request(
# Record the consumed time
# Note: This is intentionally placed after we record the content_size above, since
# we'll then trigger fetching of the body (unless stream=True)
request_meta["response_time"] = int((default_timer() - request_meta["start_time"]) * 1000)
request_meta["response_time"] = int((default_timer() - start_time) * 1000)

if catch_response:
return ResponseContextManager(response, environment=self.environment, request_meta=request_meta)
Expand Down

0 comments on commit 23c69da

Please sign in to comment.