locust 2.27.1.dev12__py3-none-any.whl → 2.27.1.dev27__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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.27.1.dev12'
16
- __version_tuple__ = version_tuple = (2, 27, 1, 'dev12')
15
+ __version__ = version = '2.27.1.dev27'
16
+ __version_tuple__ = version_tuple = (2, 27, 1, 'dev27')
locust/argument_parser.py CHANGED
@@ -9,6 +9,7 @@ import atexit
9
9
  import os
10
10
  import platform
11
11
  import socket
12
+ import ssl
12
13
  import sys
13
14
  import tempfile
14
15
  import textwrap
@@ -705,7 +706,7 @@ Typically ONLY these options (and --locustfile) need to be specified on workers,
705
706
  "-V",
706
707
  action="version",
707
708
  help="Show program's version number and exit",
708
- version=f"locust {version} from {os.path.dirname(__file__)} (python {platform.python_version()})",
709
+ version=f"locust {version} from {os.path.dirname(__file__)} (Python {platform.python_version()}, {' '.join(ssl.OPENSSL_VERSION.split(' ')[0:2])})",
709
710
  )
710
711
  other_group.add_argument(
711
712
  "--exit-code-on-error",
locust/html.py CHANGED
@@ -10,7 +10,7 @@ from jinja2 import Environment, FileSystemLoader
10
10
 
11
11
  from . import stats as stats_module
12
12
  from .runners import STATE_STOPPED, STATE_STOPPING, MasterRunner
13
- from .stats import sort_stats
13
+ from .stats import sort_stats, update_stats_history
14
14
  from .user.inspectuser import get_ratio
15
15
 
16
16
  PERCENTILES_FOR_HTML_REPORT = [0.50, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1.0]
@@ -54,6 +54,7 @@ def get_html_report(
54
54
  {**exc, "nodes": ", ".join(exc["nodes"])} for exc in environment.runner.exceptions.values()
55
55
  ]
56
56
 
57
+ update_stats_history(environment.runner)
57
58
  history = stats.history
58
59
 
59
60
  static_js = []
locust/main.py CHANGED
@@ -434,7 +434,9 @@ See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-numb
434
434
  try:
435
435
  options.run_time = parse_timespan(options.run_time)
436
436
  except ValueError:
437
- logger.error("Valid --run-time formats are: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
437
+ logger.error(
438
+ f"Invalid --run-time argument ({options.run_time}), accepted formats are for example 120, 120s, 2m, 3h, 3h30m10s."
439
+ )
438
440
  sys.exit(1)
439
441
 
440
442
  if options.csv_prefix:
locust/stats.py CHANGED
@@ -907,28 +907,32 @@ def sort_stats(stats: dict[Any, S]) -> list[S]:
907
907
  return [stats[key] for key in sorted(stats.keys())]
908
908
 
909
909
 
910
+ def update_stats_history(runner: Runner) -> None:
911
+ stats = runner.stats
912
+ current_response_time_percentiles = {
913
+ f"response_time_percentile_{percentile}": stats.total.get_current_response_time_percentile(percentile) or 0
914
+ for percentile in PERCENTILES_TO_CHART
915
+ }
916
+
917
+ r = {
918
+ **current_response_time_percentiles,
919
+ "time": datetime.datetime.now(tz=datetime.timezone.utc).strftime("%H:%M:%S"),
920
+ "current_rps": stats.total.current_rps or 0,
921
+ "current_fail_per_sec": stats.total.current_fail_per_sec or 0,
922
+ "total_avg_response_time": stats.total.avg_response_time,
923
+ "user_count": runner.user_count or 0,
924
+ }
925
+ stats.history.append(r)
926
+
927
+
910
928
  def stats_history(runner: Runner) -> None:
911
929
  """Save current stats info to history for charts of report."""
912
930
  while True:
913
- stats = runner.stats
914
- if not stats.total.use_response_times_cache:
931
+ if not runner.stats.total.use_response_times_cache:
915
932
  break
916
933
  if runner.state != "stopped":
917
- current_response_time_percentiles = {
918
- f"response_time_percentile_{percentile}": stats.total.get_current_response_time_percentile(percentile)
919
- or 0
920
- for percentile in PERCENTILES_TO_CHART
921
- }
922
-
923
- r = {
924
- **current_response_time_percentiles,
925
- "time": datetime.datetime.now(tz=datetime.timezone.utc).strftime("%H:%M:%S"),
926
- "current_rps": stats.total.current_rps or 0,
927
- "current_fail_per_sec": stats.total.current_fail_per_sec or 0,
928
- "total_avg_response_time": stats.total.avg_response_time,
929
- "user_count": runner.user_count or 0,
930
- }
931
- stats.history.append(r)
934
+ update_stats_history(runner)
935
+
932
936
  gevent.sleep(HISTORY_STATS_INTERVAL_SEC)
933
937
 
934
938
 
locust/web.py CHANGED
@@ -211,11 +211,14 @@ class WebUI:
211
211
  for key, value in request.form.items():
212
212
  if key == "user_count": # if we just renamed this field to "users" we wouldn't need this
213
213
  user_count = int(value)
214
+ parsed_options_dict["users"] = user_count
214
215
  elif key == "spawn_rate":
215
216
  spawn_rate = float(value)
217
+ parsed_options_dict[key] = spawn_rate
216
218
  elif key == "host":
217
219
  # Replace < > to guard against XSS
218
220
  environment.host = str(request.form["host"]).replace("<", "").replace(">", "")
221
+ parsed_options_dict[key] = environment.host
219
222
  elif key == "user_classes":
220
223
  # Set environment.parsed_options.user_classes to the selected user_classes
221
224
  parsed_options_dict[key] = request.form.getlist("user_classes")
@@ -224,6 +227,7 @@ class WebUI:
224
227
  continue
225
228
  try:
226
229
  run_time = parse_timespan(value)
230
+ parsed_options_dict[key] = run_time
227
231
  except ValueError:
228
232
  err_msg = "Valid run_time formats are : 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc."
229
233
  logger.error(err_msg)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: locust
3
- Version: 2.27.1.dev12
4
- Summary: Developer friendly load testing framework
3
+ Version: 2.27.1.dev27
4
+ Summary: Developer-friendly load testing framework
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/locustio/locust
7
7
  Project-URL: Documentation, https://docs.locust.io/
@@ -32,7 +32,7 @@ Requires-Dist: Werkzeug >=2.0.0
32
32
  Requires-Dist: requests >=2.26.0
33
33
  Requires-Dist: msgpack >=1.0.0
34
34
  Requires-Dist: pyzmq >=25.0.0
35
- Requires-Dist: geventhttpclient ==2.2.1
35
+ Requires-Dist: geventhttpclient >=2.3.1
36
36
  Requires-Dist: ConfigArgParse >=1.5.5
37
37
  Requires-Dist: psutil >=5.9.1
38
38
  Requires-Dist: Flask-Login >=0.6.3
@@ -49,7 +49,7 @@ Requires-Dist: tomli >=1.1.0 ; python_version < "3.11"
49
49
  [![GitHub contributors](https://img.shields.io/github/contributors/locustio/locust.svg)](https://github.com/locustio/locust/graphs/contributors)
50
50
  [![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine)
51
51
 
52
- Locust is an open source performance/load testing tool for HTTP and other protocols. Its developer friendly approach lets you to define your tests in regular Python code.
52
+ Locust is an open source performance/load testing tool for HTTP and other protocols. Its developer-friendly approach lets you define your tests in regular Python code.
53
53
 
54
54
  Locust tests can be run from command line or using its web-based UI. Throughput, response times and errors can be viewed in real time and/or exported for later analysis.
55
55
 
@@ -1,22 +1,22 @@
1
1
  locust/__init__.py,sha256=g6oA-Ba_hs3gLWVf5MKJ1mvfltI8MFnDWG8qslqm8yg,1402
2
2
  locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
3
- locust/_version.py,sha256=SlnucZxuZwPMo0dXRQRXbQyCOSzZlMSwDLvlzPQdW8U,428
4
- locust/argument_parser.py,sha256=5gUvJ6zLTscX1fUP25oAj_VemKl11Hm2aTm86cIlzWs,28680
3
+ locust/_version.py,sha256=ZfhxeGI7BeaEjI8vSaW9qeadu0mXts250HS8QDLvA-g,428
4
+ locust/argument_parser.py,sha256=w4-Ue1XAFPwG3sLyXrpdV9ejKjTUOpcSsPBbCKwRbiQ,28740
5
5
  locust/clients.py,sha256=YKuAyMAbxs8_-w7XJw0hc67KFBNNLxibsw6FwiS01Q8,14781
6
6
  locust/debug.py,sha256=We6Z9W0btkKSc7PxWmrZx-xMynvOOsKhG6jmDgQin0g,5134
7
7
  locust/dispatch.py,sha256=vYh0QEDFgJ3hY0HgSk-EiNO7IP9ffzXF_Et8wB9JvsI,16995
8
8
  locust/env.py,sha256=SLtUQCYaiv_oq_Nz1xaB0OD8RkTdESt2b71vz_qohpo,12452
9
9
  locust/event.py,sha256=xgNKbcejxy1TNUfIdgV75KgD2_BOwQmvjrJ4hWuydRw,7740
10
10
  locust/exception.py,sha256=jGgJ32ubuf4pWdlaVOkbh2Y0LlG0_DHi-lv3ib8ppOE,1791
11
- locust/html.py,sha256=Qz3Php454f5QwIdJyP2ckJ2L9aNkdZQCVahFELfMBIc,3983
11
+ locust/html.py,sha256=C-RvShjgRRqzzYGdOGCelobm_SlEGjp8TutvHou1er0,4050
12
12
  locust/input_events.py,sha256=ZIyePyAMuA_YFYWg18g_pE4kwuQV3RbEB250MzXRwjY,3314
13
13
  locust/log.py,sha256=cqLt7nnxnQuM4vWFB5EpJpNUTxGBVEkUJuaJPI1S7_Y,3186
14
- locust/main.py,sha256=snmuyKutaCYbjrhHDuPjbeqNAtWcC9wkPa0AnJswMGY,27780
14
+ locust/main.py,sha256=NGjL5QqakU5aeyUzwu2Fh00xVZfC3eoBE3DtfOmRtcM,27854
15
15
  locust/py.typed,sha256=gkWLl8yD4mIZnNYYAIRM8g9VarLvWmTAFeUfEbxJLBw,65
16
16
  locust/runners.py,sha256=Go8b8fpOAfFy6JuNcot7KyguHuExA6eoPHVmcgx3RoI,67813
17
17
  locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
18
- locust/stats.py,sha256=dulIckrNr3t01LSOFvpr7LdBHj1YXHlEoK7q3b79z0A,45581
19
- locust/web.py,sha256=_7uelOUgnBJA80ZKjcIQ67zSxz0uEH5hoQDcZ8mP6XU,26720
18
+ locust/stats.py,sha256=-kI5fTGgs6w5FSaFYGhBAE2PnnCQWuBqmhYPTGPctTA,45558
19
+ locust/web.py,sha256=x12v0Raz8b3KaDr-WTLzsi9zxcbRutxUljKxNwQKtPU,26964
20
20
  locust/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  locust/contrib/fasthttp.py,sha256=vByPepw35DF84qZ2xK89yHgjOA_8btV0wig_rSR6p4g,26757
22
22
  locust/rpc/__init__.py,sha256=nVGoHWFQxZjnhCDWjbgXIbmFbN9sizAjkhvSs9_642c,58
@@ -70,9 +70,9 @@ locust/webui/dist/report.html,sha256=sOdZZVgZbqgu86BBCSQf3uQUYXgmgSnXF32JpnyAII8
70
70
  locust/webui/dist/assets/favicon.ico,sha256=IUl-rYqfpHdV38e-s0bkmFIeLS-n3Ug0DQxk-h202hI,8348
71
71
  locust/webui/dist/assets/index-941b6e82.js,sha256=G3n5R81Svt0HzbWaV3AV20jLWGLr4X50UZ-Adu2KcxU,1645614
72
72
  locust/webui/dist/assets/logo.png,sha256=EIVPqr6wE_yqguHaqFHIsH0ZACLSrvNWyYO7PbyIj4w,19299
73
- locust-2.27.1.dev12.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
74
- locust-2.27.1.dev12.dist-info/METADATA,sha256=ZvElRnyCJOLhjqaI3iCzRQf5d3ap45u11yVozFvBHoQ,7267
75
- locust-2.27.1.dev12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
76
- locust-2.27.1.dev12.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
77
- locust-2.27.1.dev12.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
78
- locust-2.27.1.dev12.dist-info/RECORD,,
73
+ locust-2.27.1.dev27.dist-info/LICENSE,sha256=78XGpIn3fHVBfaxlPNUfjVufSN7QsdhpJMRJHv2AFpo,1095
74
+ locust-2.27.1.dev27.dist-info/METADATA,sha256=PpLQq4SgtWqqTm1ksFuwguXzi-uj602xCawu5p-HCKk,7264
75
+ locust-2.27.1.dev27.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
76
+ locust-2.27.1.dev27.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
77
+ locust-2.27.1.dev27.dist-info/top_level.txt,sha256=XSsjgPA8Ggf9TqKVbkwSqZFuPlZ085X13M9orDycE20,7
78
+ locust-2.27.1.dev27.dist-info/RECORD,,