Skip to content

Commit

Permalink
fail early if we try to log a sample with no run_id
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed May 15, 2023
1 parent 6f3124b commit e331a61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions locust_plugins/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ def on_request(
# (which will be horribly wrong if users spend a lot of time in a with/catch_response-block)
time = datetime.now(timezone.utc) - timedelta(milliseconds=response_time or 0)
greenlet_id = getattr(greenlet.getcurrent(), "minimal_ident", 0) # if we're debugging there is no greenlet
assert self._run_id
sample = {
"time": time,
"run_id": self._run_id,
Expand Down

0 comments on commit e331a61

Please sign in to comment.