locust 2.31.2.dev10__py3-none-any.whl → 2.31.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
locust/_version.py CHANGED
@@ -14,7 +14,7 @@ __version_tuple__: VERSION_TUPLE
14
14
  version_tuple: VERSION_TUPLE
15
15
 
16
16
 
17
- __version__ = "2.31.2.dev10"
17
+ __version__ = "2.31.3"
18
18
  version = __version__
19
- __version_tuple__ = (2, 31, 2, "dev10")
19
+ __version_tuple__ = (2, 31, 3)
20
20
  version_tuple = __version_tuple__
locust/main.py CHANGED
@@ -391,9 +391,17 @@ See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-numb
391
391
  ensure_user_class_name(user_config)
392
392
 
393
393
  environment.update_user_class(user_config)
394
- except Exception as e:
394
+ except json.decoder.JSONDecodeError as e:
395
395
  logger.error(f"The --config-users argument must be in valid JSON string or file: {e}")
396
396
  sys.exit(-1)
397
+ except KeyError as e:
398
+ logger.error(
399
+ f"Error applying user config, probably you tried to specify config for a User not present in your locustfile: {e}"
400
+ )
401
+ sys.exit(-1)
402
+ except Exception as e:
403
+ logger.exception(e)
404
+ sys.exit(-1)
397
405
 
398
406
  if (
399
407
  shape_class
locust/stats.py CHANGED
@@ -904,18 +904,22 @@ def sort_stats(stats: dict[Any, S]) -> list[S]:
904
904
 
905
905
  def update_stats_history(runner: Runner) -> None:
906
906
  stats = runner.stats
907
+ timestamp = format_utc_timestamp(time.time())
907
908
  current_response_time_percentiles = {
908
- f"response_time_percentile_{percentile}": stats.total.get_current_response_time_percentile(percentile) or 0
909
+ f"response_time_percentile_{percentile}": [
910
+ timestamp,
911
+ stats.total.get_current_response_time_percentile(percentile) or 0,
912
+ ]
909
913
  for percentile in PERCENTILES_TO_CHART
910
914
  }
911
915
 
912
916
  r = {
913
917
  **current_response_time_percentiles,
914
- "time": format_utc_timestamp(time.time()),
915
- "current_rps": stats.total.current_rps or 0,
916
- "current_fail_per_sec": stats.total.current_fail_per_sec or 0,
917
- "total_avg_response_time": proper_round(stats.total.avg_response_time, digits=2),
918
- "user_count": runner.user_count or 0,
918
+ "current_rps": [timestamp, stats.total.current_rps or 0],
919
+ "current_fail_per_sec": [timestamp, stats.total.current_fail_per_sec or 0],
920
+ "total_avg_response_time": [timestamp, proper_round(stats.total.avg_response_time, digits=2)],
921
+ "user_count": [timestamp, runner.user_count or 0],
922
+ "time": timestamp,
919
923
  }
920
924
  stats.history.append(r)
921
925
 
locust/web.py CHANGED
@@ -564,7 +564,7 @@ class WebUI:
564
564
  try:
565
565
  return login_required(view_func)(*args, **kwargs)
566
566
  except Exception as e:
567
- return f"Locust auth exception: {e} See https://docs.locust.io/en/stable/extending-locust.html#authentication for configuring authentication."
567
+ return f"Locust auth exception: {e} See https://docs.locust.io/en/stable/extending-locust.html#adding-authentication-to-the-web-ui for configuring authentication."
568
568
  else:
569
569
  return view_func(*args, **kwargs)
570
570
 
@@ -618,8 +618,6 @@ class WebUI:
618
618
  else None
619
619
  )
620
620
 
621
- start_time = format_utc_timestamp(stats.start_time)
622
-
623
621
  self.template_args = {
624
622
  "locustfile": self.environment.locustfile,
625
623
  "state": self.environment.runner.state,
@@ -637,7 +635,6 @@ class WebUI:
637
635
  and not (self.userclass_picker_is_active or self.environment.shape_class.use_common_options)
638
636
  ),
639
637
  "stats_history_enabled": options and options.stats_history_enabled,
640
- "start_time": start_time,
641
638
  "tasks": dumps({}),
642
639
  "extra_options": extra_options,
643
640
  "run_time": options and options.run_time,
Binary file