locust 2.20.1.dev26__tar.gz → 2.20.2__tar.gz

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.
Files changed (345) hide show
  1. {locust-2.20.1.dev26 → locust-2.20.2}/.git-blame-ignore-revs +6 -0
  2. {locust-2.20.1.dev26 → locust-2.20.2}/.github/workflows/tests.yml +2 -3
  3. {locust-2.20.1.dev26 → locust-2.20.2}/.gitignore +3 -1
  4. locust-2.20.2/.vscode/extensions.json +6 -0
  5. {locust-2.20.1.dev26 → locust-2.20.2}/.vscode/settings.json +2 -1
  6. {locust-2.20.1.dev26 → locust-2.20.2}/CHANGELOG.md +18 -0
  7. {locust-2.20.1.dev26/locust.egg-info → locust-2.20.2}/PKG-INFO +2 -2
  8. {locust-2.20.1.dev26 → locust-2.20.2}/benchmarks/dispatch.py +6 -6
  9. {locust-2.20.1.dev26 → locust-2.20.2}/docs/changelog.rst +7 -0
  10. {locust-2.20.1.dev26 → locust-2.20.2}/docs/conf.py +3 -2
  11. {locust-2.20.1.dev26 → locust-2.20.2}/docs/configuration.rst +43 -2
  12. {locust-2.20.1.dev26 → locust-2.20.2}/docs/developing-locust.rst +17 -27
  13. {locust-2.20.1.dev26 → locust-2.20.2}/docs/extending-locust.rst +23 -0
  14. {locust-2.20.1.dev26 → locust-2.20.2}/docs/requirements.txt +1 -1
  15. {locust-2.20.1.dev26 → locust-2.20.2}/docs/running-distributed.rst +29 -21
  16. {locust-2.20.1.dev26 → locust-2.20.2}/docs/what-is-locust.rst +1 -3
  17. {locust-2.20.1.dev26 → locust-2.20.2}/examples/add_command_line_argument.py +1 -1
  18. {locust-2.20.1.dev26 → locust-2.20.2}/examples/basic.py +1 -1
  19. {locust-2.20.1.dev26 → locust-2.20.2}/examples/browse_docs_sequence_test.py +3 -1
  20. {locust-2.20.1.dev26 → locust-2.20.2}/examples/browse_docs_test.py +3 -1
  21. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_messages.py +1 -1
  22. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_shape/double_wave.py +2 -2
  23. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_shape/stages.py +1 -2
  24. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_shape/staging_user_classes.py +1 -2
  25. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_shape/step_load.py +2 -2
  26. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_shape/wait_user_count.py +4 -5
  27. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_wait_function.py +1 -0
  28. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_xmlrpc_client/xmlrpc_locustfile.py +3 -3
  29. {locust-2.20.1.dev26 → locust-2.20.2}/examples/debugging.py +1 -1
  30. {locust-2.20.1.dev26 → locust-2.20.2}/examples/debugging_advanced.py +1 -1
  31. {locust-2.20.1.dev26 → locust-2.20.2}/examples/dynamic_user_credentials.py +1 -1
  32. {locust-2.20.1.dev26 → locust-2.20.2}/examples/events.py +1 -2
  33. {locust-2.20.1.dev26 → locust-2.20.2}/examples/extend_modern_web_ui.py +6 -4
  34. {locust-2.20.1.dev26 → locust-2.20.2}/examples/extend_web_ui/extend.py +5 -3
  35. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/grpc_user.py +4 -2
  36. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/hello_pb2.py +2 -2
  37. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/hello_pb2_grpc.py +0 -1
  38. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/hello_server.py +5 -4
  39. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/locustfile.py +2 -1
  40. {locust-2.20.1.dev26 → locust-2.20.2}/examples/locustfile.py +2 -1
  41. {locust-2.20.1.dev26 → locust-2.20.2}/examples/manual_stats_reporting.py +4 -4
  42. {locust-2.20.1.dev26 → locust-2.20.2}/examples/multiple_hosts.py +3 -3
  43. {locust-2.20.1.dev26 → locust-2.20.2}/examples/nested_inline_tasksets.py +1 -1
  44. {locust-2.20.1.dev26 → locust-2.20.2}/examples/rest.py +3 -2
  45. {locust-2.20.1.dev26 → locust-2.20.2}/examples/sdk_session_patching/session_patch_locustfile.py +1 -0
  46. {locust-2.20.1.dev26 → locust-2.20.2}/examples/semaphore_wait.py +1 -1
  47. {locust-2.20.1.dev26 → locust-2.20.2}/examples/stop_on_threshold.py +4 -2
  48. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/plan/basic.py +2 -1
  49. {locust-2.20.1.dev26 → locust-2.20.2}/examples/test_data_management.py +5 -4
  50. {locust-2.20.1.dev26 → locust-2.20.2}/examples/use_as_lib.py +5 -3
  51. locust-2.20.2/examples/web_ui_auth.py +80 -0
  52. {locust-2.20.1.dev26 → locust-2.20.2}/examples/worker_index.py +2 -1
  53. {locust-2.20.1.dev26 → locust-2.20.2}/locust/__init__.py +7 -7
  54. {locust-2.20.1.dev26 → locust-2.20.2}/locust/_version.py +2 -2
  55. {locust-2.20.1.dev26 → locust-2.20.2}/locust/argument_parser.py +35 -18
  56. {locust-2.20.1.dev26 → locust-2.20.2}/locust/clients.py +7 -6
  57. {locust-2.20.1.dev26 → locust-2.20.2}/locust/contrib/fasthttp.py +42 -37
  58. {locust-2.20.1.dev26 → locust-2.20.2}/locust/debug.py +14 -8
  59. {locust-2.20.1.dev26 → locust-2.20.2}/locust/dispatch.py +25 -25
  60. {locust-2.20.1.dev26 → locust-2.20.2}/locust/env.py +45 -37
  61. {locust-2.20.1.dev26 → locust-2.20.2}/locust/event.py +13 -10
  62. {locust-2.20.1.dev26 → locust-2.20.2}/locust/exception.py +0 -9
  63. {locust-2.20.1.dev26 → locust-2.20.2}/locust/html.py +9 -8
  64. {locust-2.20.1.dev26 → locust-2.20.2}/locust/input_events.py +7 -5
  65. {locust-2.20.1.dev26 → locust-2.20.2}/locust/main.py +95 -47
  66. {locust-2.20.1.dev26 → locust-2.20.2}/locust/rpc/protocol.py +4 -2
  67. {locust-2.20.1.dev26 → locust-2.20.2}/locust/rpc/zmqrpc.py +6 -4
  68. {locust-2.20.1.dev26 → locust-2.20.2}/locust/runners.py +69 -76
  69. {locust-2.20.1.dev26 → locust-2.20.2}/locust/shape.py +7 -4
  70. {locust-2.20.1.dev26 → locust-2.20.2}/locust/stats.py +73 -71
  71. {locust-2.20.1.dev26 → locust-2.20.2}/locust/templates/index.html +8 -23
  72. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/mock_logging.py +7 -5
  73. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_dispatch.py +10 -9
  74. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_env.py +30 -1
  75. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_fasthttp.py +9 -8
  76. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_http.py +4 -3
  77. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_load_locustfile.py +6 -5
  78. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_locust_class.py +11 -5
  79. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_log.py +5 -4
  80. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_main.py +37 -7
  81. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_parser.py +11 -15
  82. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_runners.py +22 -21
  83. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_sequential_taskset.py +3 -2
  84. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_stats.py +16 -18
  85. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_tags.py +3 -2
  86. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_taskratio.py +3 -3
  87. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_users.py +3 -3
  88. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_util.py +3 -2
  89. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_wait_time.py +3 -3
  90. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_web.py +142 -27
  91. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_zmqrpc.py +5 -3
  92. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/util.py +6 -7
  93. locust-2.20.2/locust/user/__init__.py +2 -0
  94. {locust-2.20.1.dev26 → locust-2.20.2}/locust/user/inspectuser.py +6 -5
  95. {locust-2.20.1.dev26 → locust-2.20.2}/locust/user/sequential_taskset.py +3 -1
  96. {locust-2.20.1.dev26 → locust-2.20.2}/locust/user/task.py +22 -27
  97. {locust-2.20.1.dev26 → locust-2.20.2}/locust/user/users.py +17 -7
  98. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/deprecation.py +0 -1
  99. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/load_locustfile.py +4 -2
  100. {locust-2.20.1.dev26 → locust-2.20.2}/locust/web.py +102 -53
  101. locust-2.20.2/locust/webui/auth.html +19 -0
  102. locust-2.20.2/locust/webui/dist/assets/auth-5e21717c.js.map +1 -0
  103. locust-2.20.1.dev26/locust/webui/dist/assets/index-01afe4fa.js → locust-2.20.2/locust/webui/dist/assets/index-a83a5dd9.js +85 -84
  104. locust-2.20.2/locust/webui/dist/assets/index-a83a5dd9.js.map +1 -0
  105. locust-2.20.2/locust/webui/dist/auth.html +20 -0
  106. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/dist/index.html +1 -1
  107. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/package.json +1 -1
  108. locust-2.20.2/locust/webui/src/auth.tsx +103 -0
  109. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Form/Form.tsx +7 -0
  110. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Form/Select.tsx +1 -1
  111. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Form/tests/Form.test.tsx +12 -0
  112. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Modal/Modal.tsx +1 -1
  113. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StatsTable/StatsTable.tsx +28 -8
  114. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmCharts/SwarmCharts.tsx +6 -4
  115. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/SwarmEditForm.tsx +5 -5
  116. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/SwarmForm.tsx +32 -13
  117. locust-2.20.2/locust/webui/src/components/SwarmForm/SwarmUserClassPicker.tsx +186 -0
  118. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/tests/SwarmForm.test.tsx +49 -4
  119. locust-2.20.2/locust/webui/src/components/SwarmForm/tests/SwarmUserClassPicker.test.tsx +173 -0
  120. locust-2.20.2/locust/webui/src/components/ViewColumnSelector/ViewColumnSelector.test.tsx +57 -0
  121. locust-2.20.2/locust/webui/src/components/ViewColumnSelector/ViewColumnSelector.tsx +61 -0
  122. locust-2.20.2/locust/webui/src/constants/swarm.tsx +17 -0
  123. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/global.d.ts +2 -0
  124. locust-2.20.2/locust/webui/src/hooks/tests/useSelecteViewColumns.test.tsx +59 -0
  125. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/tests/useSwarmUi.test.tsx +7 -7
  126. locust-2.20.2/locust/webui/src/hooks/useSelectViewColumns.ts +28 -0
  127. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/index.tsx +15 -2
  128. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/api/swarm.ts +8 -0
  129. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/swarm.slice.ts +5 -2
  130. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/ui.slice.ts +2 -2
  131. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/test/mocks/statsRequest.mock.ts +8 -8
  132. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/test/mocks/swarmState.mock.ts +5 -1
  133. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/test/setup.ts +5 -1
  134. locust-2.20.2/locust/webui/src/types/auth.types.ts +11 -0
  135. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/types/swarm.types.ts +8 -0
  136. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/types/ui.types.ts +1 -2
  137. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/vite.config.ts +14 -0
  138. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/yarn.lock +15 -15
  139. {locust-2.20.1.dev26 → locust-2.20.2/locust.egg-info}/PKG-INFO +2 -2
  140. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/SOURCES.txt +15 -1
  141. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/requires.txt +1 -1
  142. {locust-2.20.1.dev26 → locust-2.20.2}/pyproject.toml +23 -6
  143. {locust-2.20.1.dev26 → locust-2.20.2}/scripts/locustfile.py +2 -3
  144. {locust-2.20.1.dev26 → locust-2.20.2}/tox.ini +9 -18
  145. locust-2.20.1.dev26/locust/user/__init__.py +0 -2
  146. locust-2.20.1.dev26/locust/webui/src/constants/swarm.tsx +0 -13
  147. {locust-2.20.1.dev26 → locust-2.20.2}/.coveragerc +0 -0
  148. {locust-2.20.1.dev26 → locust-2.20.2}/.dockerignore +0 -0
  149. {locust-2.20.1.dev26 → locust-2.20.2}/.gitattributes +0 -0
  150. {locust-2.20.1.dev26 → locust-2.20.2}/.github/CONTRIBUTING.md +0 -0
  151. {locust-2.20.1.dev26 → locust-2.20.2}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  152. {locust-2.20.1.dev26 → locust-2.20.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  153. {locust-2.20.1.dev26 → locust-2.20.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  154. {locust-2.20.1.dev26 → locust-2.20.2}/.github/workflows/stale.yml +0 -0
  155. {locust-2.20.1.dev26 → locust-2.20.2}/.readthedocs.yaml +0 -0
  156. {locust-2.20.1.dev26 → locust-2.20.2}/.vscode/launch.json +0 -0
  157. {locust-2.20.1.dev26 → locust-2.20.2}/.vscode/launch_locust.json +0 -0
  158. {locust-2.20.1.dev26 → locust-2.20.2}/Dockerfile +0 -0
  159. {locust-2.20.1.dev26 → locust-2.20.2}/LICENSE +0 -0
  160. {locust-2.20.1.dev26 → locust-2.20.2}/MANIFEST.in +0 -0
  161. {locust-2.20.1.dev26 → locust-2.20.2}/Makefile +0 -0
  162. {locust-2.20.1.dev26 → locust-2.20.2}/README +0 -0
  163. {locust-2.20.1.dev26 → locust-2.20.2}/README.md +0 -0
  164. {locust-2.20.1.dev26 → locust-2.20.2}/SECURITY.md +0 -0
  165. {locust-2.20.1.dev26 → locust-2.20.2}/Vagrantfile +0 -0
  166. {locust-2.20.1.dev26 → locust-2.20.2}/docs/_static/theme-overrides.css +0 -0
  167. {locust-2.20.1.dev26 → locust-2.20.2}/docs/api.rst +0 -0
  168. {locust-2.20.1.dev26 → locust-2.20.2}/docs/custom-load-shape.rst +0 -0
  169. {locust-2.20.1.dev26 → locust-2.20.2}/docs/further-reading.rst +0 -0
  170. {locust-2.20.1.dev26 → locust-2.20.2}/docs/history.rst +0 -0
  171. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/modern-webui-splash-screenshot.png +0 -0
  172. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/number_of_users.png +0 -0
  173. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/response_times.png +0 -0
  174. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/total_requests_per_second.png +0 -0
  175. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/userclass_picker_example.png +0 -0
  176. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/webui-running-statistics.png +0 -0
  177. {locust-2.20.1.dev26 → locust-2.20.2}/docs/images/webui-splash-screenshot.png +0 -0
  178. {locust-2.20.1.dev26 → locust-2.20.2}/docs/increase-performance.rst +0 -0
  179. {locust-2.20.1.dev26 → locust-2.20.2}/docs/index.rst +0 -0
  180. {locust-2.20.1.dev26 → locust-2.20.2}/docs/installation.rst +0 -0
  181. {locust-2.20.1.dev26 → locust-2.20.2}/docs/logging.rst +0 -0
  182. {locust-2.20.1.dev26 → locust-2.20.2}/docs/quickstart.rst +0 -0
  183. {locust-2.20.1.dev26 → locust-2.20.2}/docs/retrieving-stats.rst +0 -0
  184. {locust-2.20.1.dev26 → locust-2.20.2}/docs/running-cloud-integration.rst +0 -0
  185. {locust-2.20.1.dev26 → locust-2.20.2}/docs/running-in-debugger.rst +0 -0
  186. {locust-2.20.1.dev26 → locust-2.20.2}/docs/running-in-docker.rst +0 -0
  187. {locust-2.20.1.dev26 → locust-2.20.2}/docs/running-without-web-ui.rst +0 -0
  188. {locust-2.20.1.dev26 → locust-2.20.2}/docs/tasksets.rst +0 -0
  189. {locust-2.20.1.dev26 → locust-2.20.2}/docs/testing-other-systems.rst +0 -0
  190. {locust-2.20.1.dev26 → locust-2.20.2}/docs/use-as-lib.rst +0 -0
  191. {locust-2.20.1.dev26 → locust-2.20.2}/docs/writing-a-locustfile.rst +0 -0
  192. {locust-2.20.1.dev26 → locust-2.20.2}/examples/custom_xmlrpc_client/server.py +0 -0
  193. {locust-2.20.1.dev26 → locust-2.20.2}/examples/docker-compose/docker-compose.yml +0 -0
  194. {locust-2.20.1.dev26 → locust-2.20.2}/examples/extend_web_ui/static/custom-stats-table.css +0 -0
  195. {locust-2.20.1.dev26 → locust-2.20.2}/examples/extend_web_ui/static/extend.js +0 -0
  196. {locust-2.20.1.dev26 → locust-2.20.2}/examples/extend_web_ui/templates/extend.html +0 -0
  197. {locust-2.20.1.dev26 → locust-2.20.2}/examples/fast_http_locust.py +0 -0
  198. {locust-2.20.1.dev26 → locust-2.20.2}/examples/grpc/hello.proto +0 -0
  199. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/README.md +0 -0
  200. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/data_subnet.tf +0 -0
  201. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/main.tf +0 -0
  202. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/output.tf +0 -0
  203. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/provisioner.tf +0 -0
  204. {locust-2.20.1.dev26 → locust-2.20.2}/examples/terraform/aws/variables.tf +0 -0
  205. {locust-2.20.1.dev26 → locust-2.20.2}/examples/vagrant/README.md +0 -0
  206. {locust-2.20.1.dev26 → locust-2.20.2}/examples/vagrant/supervisord.conf +0 -0
  207. {locust-2.20.1.dev26 → locust-2.20.2}/generate_changelog.py +1 -1
  208. {locust-2.20.1.dev26 → locust-2.20.2}/locust/__main__.py +0 -0
  209. {locust-2.20.1.dev26 → locust-2.20.2}/locust/contrib/__init__.py +0 -0
  210. {locust-2.20.1.dev26 → locust-2.20.2}/locust/log.py +0 -0
  211. {locust-2.20.1.dev26 → locust-2.20.2}/locust/py.typed +0 -0
  212. {locust-2.20.1.dev26 → locust-2.20.2}/locust/rpc/__init__.py +0 -0
  213. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/chart.js +0 -0
  214. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/css/application.css +0 -0
  215. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/css/application.css.map +0 -0
  216. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/css/tables.css +0 -0
  217. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/css/tables.css.map +0 -0
  218. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/echarts.common.min.js +0 -0
  219. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/favicon.ico +0 -0
  220. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/logo.png +0 -0
  221. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/ui-screenshot-charts.png +0 -0
  222. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/ui-screenshot-start-test.png +0 -0
  223. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/ui-screenshot-stats.png +0 -0
  224. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/img/ui-screenshot-workers.png +0 -0
  225. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/jquery-1.11.3.min.js +0 -0
  226. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/jquery.jqote2.min.js +0 -0
  227. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/jquery.tools.min.js +0 -0
  228. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/locust.js +0 -0
  229. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/sass/_base.sass +0 -0
  230. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/sass/_mixins.sass +0 -0
  231. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/sass/application.sass +0 -0
  232. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/sass/tables.sass +0 -0
  233. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/tasks.js +0 -0
  234. {locust-2.20.1.dev26 → locust-2.20.2}/locust/static/vintage.js +0 -0
  235. {locust-2.20.1.dev26 → locust-2.20.2}/locust/templates/report.html +0 -0
  236. {locust-2.20.1.dev26 → locust-2.20.2}/locust/templates/stats_data.html +0 -0
  237. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/__init__.py +0 -0
  238. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/fake_module1_for_env_test.py +0 -0
  239. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/fake_module2_for_env_test.py +0 -0
  240. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/mock_locustfile.py +0 -0
  241. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_debugging.py +4 -4
  242. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_interruptable_task.py +4 -4
  243. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/test_old_wait_api.py +0 -0
  244. {locust-2.20.1.dev26 → locust-2.20.2}/locust/test/testcases.py +7 -7
  245. {locust-2.20.1.dev26 → locust-2.20.2}/locust/user/wait_time.py +0 -0
  246. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/__init__.py +0 -0
  247. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/cache.py +0 -0
  248. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/exception_handler.py +1 -1
  249. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/rounding.py +0 -0
  250. {locust-2.20.1.dev26 → locust-2.20.2}/locust/util/timespan.py +0 -0
  251. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/.eslintrc +0 -0
  252. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/.gitignore +0 -0
  253. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/.prettierrc +0 -0
  254. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/dev.html +0 -0
  255. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/dist/assets/favicon.ico +0 -0
  256. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/dist/assets/logo.png +0 -0
  257. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/dist/report.html +0 -0
  258. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/index.html +0 -0
  259. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/public/assets/favicon.ico +0 -0
  260. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/public/assets/logo.png +0 -0
  261. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/public/report.html +0 -0
  262. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/App.tsx +0 -0
  263. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/Report.tsx +0 -0
  264. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/DataTable/DataTable.test.tsx +0 -0
  265. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/DataTable/DataTable.tsx +0 -0
  266. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/ExceptionsTable/ExceptionsTable.tsx +0 -0
  267. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/FailuresTable/FailuresTable.tsx +0 -0
  268. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Form/tests/Select.test.tsx +0 -0
  269. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Footer/About.tsx +0 -0
  270. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Footer/Footer.tsx +0 -0
  271. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Layout.tsx +0 -0
  272. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Navbar/DarkLightToggle.tsx +0 -0
  273. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Navbar/Navbar.tsx +0 -0
  274. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Navbar/SwarmMonitor.test.tsx +0 -0
  275. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Layout/Navbar/SwarmMonitor.tsx +0 -0
  276. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LineChart/LineChart.test.tsx +0 -0
  277. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LineChart/LineChart.tsx +0 -0
  278. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LogViewer/LogViewer.tsx +0 -0
  279. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LogViewer/tests/LogViewer.test.tsx +0 -0
  280. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LogViewer/tests/useLogViewer.test.tsx +0 -0
  281. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/LogViewer/useLogViewer.ts +0 -0
  282. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Reports/Reports.test.tsx +0 -0
  283. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Reports/Reports.tsx +0 -0
  284. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/ResponseTimeTable/ResponseTimeTable.test.tsx +0 -0
  285. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/ResponseTimeTable/ResponseTimeTable.tsx +0 -0
  286. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/EditButton.tsx +0 -0
  287. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/NewTestButton.tsx +0 -0
  288. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/ResetButton.tsx +0 -0
  289. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/StateButtons.tsx +0 -0
  290. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/StopButton.tsx +0 -0
  291. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/tests/ResetButton.test.tsx +0 -0
  292. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/tests/StateButtons.test.tsx +0 -0
  293. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/StateButtons/tests/StopButton.test.tsx +0 -0
  294. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/SwarmCustomParameters.tsx +0 -0
  295. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/tests/SwarmCustomParameters.test.tsx +0 -0
  296. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmForm/tests/SwarmEditForm.test.tsx +0 -0
  297. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmRatios/SwarmRatios.test.tsx +0 -0
  298. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/SwarmRatios/SwarmRatios.tsx +0 -0
  299. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Table/Table.test.tsx +0 -0
  300. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Table/Table.tsx +0 -0
  301. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Tabs/Tabs.constants.tsx +0 -0
  302. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Tabs/Tabs.test.tsx +0 -0
  303. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/Tabs/Tabs.tsx +0 -0
  304. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/components/WorkersTable/WorkersTable.tsx +0 -0
  305. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/constants/theme.ts +0 -0
  306. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/tests/useNotifications.test.tsx +0 -0
  307. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/tests/useSortByField.test.tsx +0 -0
  308. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/useInterval.ts +0 -0
  309. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/useNotifications.ts +0 -0
  310. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/useSortByField.ts +0 -0
  311. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/hooks/useSwarmUi.ts +0 -0
  312. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/hooks.ts +0 -0
  313. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/logViewer.slice.ts +0 -0
  314. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/notification.slice.ts +0 -0
  315. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/root.slice.ts +0 -0
  316. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/tests/ui.slice.test.ts +0 -0
  317. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/theme.slice.ts +0 -0
  318. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/slice/url.slice.ts +0 -0
  319. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/store.ts +0 -0
  320. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/redux/utils.ts +0 -0
  321. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/styles/theme.ts +0 -0
  322. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/test/constants.ts +0 -0
  323. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/test/testUtils.tsx +0 -0
  324. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/types/tab.types.ts +0 -0
  325. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/types/table.types.ts +0 -0
  326. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/number.ts +0 -0
  327. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/object.ts +0 -0
  328. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/string.ts +0 -0
  329. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/tests/number.test.ts +0 -0
  330. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/tests/object.test.ts +0 -0
  331. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/tests/string.test.ts +0 -0
  332. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/tests/url.test.ts +0 -0
  333. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/src/utils/url.ts +0 -0
  334. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/tsconfig.json +0 -0
  335. {locust-2.20.1.dev26 → locust-2.20.2}/locust/webui/vitest.config.ts +0 -0
  336. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/dependency_links.txt +0 -0
  337. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/entry_points.txt +0 -0
  338. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/not-zip-safe +0 -0
  339. {locust-2.20.1.dev26 → locust-2.20.2}/locust.egg-info/top_level.txt +0 -0
  340. {locust-2.20.1.dev26 → locust-2.20.2}/package.json +0 -0
  341. {locust-2.20.1.dev26 → locust-2.20.2}/scripts/run-disributed-headless.sh +0 -0
  342. {locust-2.20.1.dev26 → locust-2.20.2}/scripts/run-disributed-web.sh +0 -0
  343. {locust-2.20.1.dev26 → locust-2.20.2}/scripts/run-local-headless.sh +0 -0
  344. {locust-2.20.1.dev26 → locust-2.20.2}/scripts/run-local-web.sh +0 -0
  345. {locust-2.20.1.dev26 → locust-2.20.2}/setup.cfg +0 -0
@@ -5,3 +5,9 @@
5
5
  6ec972f4dbb880bf0c7a11809e6c1ba194c9784c
6
6
  # upgrade code style to use f-strings using flynt
7
7
  313b80f27f525441c449593a3aeaf38389f63c13
8
+ # upgrade typing annotations using fix-future-annotations
9
+ b5324820b299b1fe7da0608f0cc8ec47f58b1e40
10
+ # upgrade code style to 3.8 using pyupgrade
11
+ 60f3bceacc4ab9567433d40ae3ed280750f55ff1
12
+ # sort imports using ruff
13
+ f99e9df700a8020e4c1967eb42dcb37ddd26e296
@@ -16,8 +16,7 @@ jobs:
16
16
  include:
17
17
  #- {name: Windows, python: '3.9', os: windows-latest, tox: py39}
18
18
  #- {name: Mac, python: '3.9', os: macos-latest, tox: py39}
19
- - { name: "flake8", python: "3.11", os: ubuntu-latest, tox: "flake8" }
20
- - { name: "black", python: "3.11", os: ubuntu-latest, tox: "black" }
19
+ - { name: "ruff", python: "3.11", os: ubuntu-latest, tox: "ruff" }
21
20
  - { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy" }
22
21
  # run some integration tests and abort immediately if they fail, for faster feedback
23
22
  - { name: "fail_fast_test_main", python: "3.12", os: ubuntu-latest, tox: fail_fast_test_main }
@@ -48,7 +47,7 @@ jobs:
48
47
  - run: python -m pip install tox
49
48
  - run: python -m tox -e ${{ matrix.tox }}
50
49
 
51
- lint_typecheck_webui:
50
+ lint_typecheck_test_webui:
52
51
  runs-on: ubuntu-latest
53
52
  steps:
54
53
  - uses: actions/checkout@v3
@@ -25,4 +25,6 @@ docs/env-options.rst
25
25
  __pycache__
26
26
  .pytest_cache
27
27
  .sass-cache/
28
- .env
28
+ .env
29
+ yarn-error.log
30
+ .venv
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "charliermarsh.ruff",
4
+ "ms-python.mypy-type-checker"
5
+ ]
6
+ }
@@ -36,6 +36,7 @@
36
36
  },
37
37
  "restructuredtext.confPath": "${workspaceFolder}/docs",
38
38
  "[python]": {
39
- "editor.defaultFormatter": "ms-python.black-formatter"
39
+ "editor.formatOnSave": true,
40
+ "editor.defaultFormatter": "charliermarsh.ruff"
40
41
  },
41
42
  }
@@ -1,6 +1,24 @@
1
1
  # Detailed changelog
2
2
  The most important changes can also be found in [the documentation](https://docs.locust.io/en/latest/changelog.html).
3
3
 
4
+ ## [2.20.1](https://github.com/locustio/locust/tree/2.20.1) (2024-01-03)
5
+
6
+ [Full Changelog](https://github.com/locustio/locust/compare/2.20.0...2.20.1)
7
+
8
+ **Fixed bugs:**
9
+
10
+ - Vite-version needs to be updated [\#2528](https://github.com/locustio/locust/issues/2528)
11
+ - Issue of 100% CPU usage when closing WebSocket connections. [\#2516](https://github.com/locustio/locust/issues/2516)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Update Vite to 4.5.1 [\#2530](https://github.com/locustio/locust/pull/2530) ([cyberw](https://github.com/cyberw))
16
+ - Bump vite from 4.4.9 to 4.4.12 in /locust/webui [\#2527](https://github.com/locustio/locust/pull/2527) ([dependabot[bot]](https://github.com/apps/dependabot))
17
+ - update docker actions to get rid of node12 deprecation warnings [\#2524](https://github.com/locustio/locust/pull/2524) ([mgor](https://github.com/mgor))
18
+ - Support IPv6 for zmq connection between master and worker [\#2521](https://github.com/locustio/locust/pull/2521) ([simonwu-sn](https://github.com/simonwu-sn))
19
+ - run\_single\_user improvements [\#2519](https://github.com/locustio/locust/pull/2519) ([cyberw](https://github.com/cyberw))
20
+ - Bump Requests to 2.26.0, remove explicit dependency on charset\_normalizer [\#2518](https://github.com/locustio/locust/pull/2518) ([cyberw](https://github.com/cyberw))
21
+
4
22
  ## [2.20.0](https://github.com/locustio/locust/tree/2.20.0) (2023-12-13)
5
23
 
6
24
  [Full Changelog](https://github.com/locustio/locust/compare/2.19.1...2.20.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: locust
3
- Version: 2.20.1.dev26
3
+ Version: 2.20.2
4
4
  Summary: Developer friendly load testing framework
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://locust.io/
@@ -36,7 +36,7 @@ Requires-Dist: pyzmq>=25.0.0
36
36
  Requires-Dist: geventhttpclient>=2.0.11
37
37
  Requires-Dist: ConfigArgParse>=1.5.5
38
38
  Requires-Dist: psutil>=5.9.1
39
- Requires-Dist: Flask-BasicAuth>=0.2.0
39
+ Requires-Dist: Flask-Login>=0.6.3
40
40
  Requires-Dist: Flask-Cors>=3.0.10
41
41
  Requires-Dist: roundrobin>=0.0.2
42
42
  Requires-Dist: pywin32; platform_system == "Windows"
@@ -5,16 +5,16 @@ for calculating the distribution of users on each workers. This benchmark is to
5
5
  by people working on Locust's development.
6
6
  """
7
7
 
8
+ from locust import User
9
+ from locust.dispatch import UsersDispatcher
10
+ from locust.runners import WorkerNode
11
+
8
12
  import itertools
9
13
  import statistics
10
14
  import time
11
15
 
12
16
  from prettytable import PrettyTable
13
17
 
14
- from locust import User
15
- from locust.dispatch import UsersDispatcher
16
- from locust.runners import WorkerNode
17
-
18
18
 
19
19
  class User1(User):
20
20
  weight = 5
@@ -632,8 +632,8 @@ if __name__ == "__main__":
632
632
  print()
633
633
  print(table)
634
634
 
635
- with open(f"results-dispatch-benchmarks-{int(now)}.txt", "wt") as file:
635
+ with open(f"results-dispatch-benchmarks-{int(now)}.txt", "w") as file:
636
636
  file.write(table.get_string())
637
637
 
638
- with open(f"results-dispatch-benchmarks-{int(now)}.json", "wt") as file:
638
+ with open(f"results-dispatch-benchmarks-{int(now)}.json", "w") as file:
639
639
  file.write(table.get_json_string())
@@ -4,6 +4,13 @@ Changelog Highlights
4
4
 
5
5
  For full details of the Locust changelog, please see https://github.com/locustio/locust/blob/master/CHANGELOG.md
6
6
 
7
+ 2.20.1
8
+ ======
9
+ * run_single_user improvements https://github.com/locustio/locust/pull/2519
10
+ * Support IPv6 for zmq connection between master and worker https://github.com/locustio/locust/pull/2521
11
+ * Modern UI: Update Vite to 4.5.1 https://github.com/locustio/locust/pull/2530
12
+ * Other tiny fixes
13
+
7
14
  2.20.0
8
15
  ======
9
16
  * Add event.measure context manager for simpler firing of request event (experimental) https://github.com/locustio/locust/pull/2511
@@ -7,11 +7,12 @@
7
7
  # All configuration values have a default value; values that are commented out
8
8
  # serve to show the default value.
9
9
 
10
+ from locust.argument_parser import get_empty_argument_parser, setup_parser_arguments
11
+
10
12
  import os
11
13
  import subprocess
12
- import sphinx_rtd_theme
13
14
 
14
- from locust.argument_parser import get_empty_argument_parser, setup_parser_arguments
15
+ import sphinx_rtd_theme
15
16
 
16
17
 
17
18
  # Run command `locust --help` and store output in cli-help-output.txt which is included in the docs
@@ -164,6 +164,44 @@ The Web UI will display:
164
164
 
165
165
  |
166
166
 
167
+ With the new ``--modern-ui``, the class picker will addtionally allow for configuring any settings for each selected user.
168
+ This includes selecting tasks, configuring the weight or fixed count, and configuring the host.
169
+
170
+ It is even possible to add custom arguments that you wish to be configurable for each user. Simply add a ``json`` classethod
171
+ to your user:
172
+
173
+ .. code-block:: python
174
+ class Example(HttpUser):
175
+ @task
176
+ def example_task(self):
177
+ self.client.get(f"/example/{self.some_custom_arg}")
178
+
179
+ @classmethod
180
+ def json(self):
181
+ return {
182
+ "host": self.host,
183
+ "some_custom_arg": "example"
184
+ }
185
+
186
+ Configuration for the User classes
187
+ ==================================
188
+
189
+ You can configure any settings you may wish for each user on the command line, the same as you may in the modern UI.
190
+ Using the ``--config-users`` argument, you may pass a JSON string or file with your user configuration. To configure
191
+ multiple users you pass multiple arguments to ``--config-users`` or use a JSON Array.
192
+
193
+ Each user settings object must contain a key ``user_class_name``. This key corresponds to the class that you wish
194
+ to configure.
195
+
196
+ Example:
197
+
198
+ .. code-block:: console
199
+
200
+ $ locust --config-users '{"user_class_name": "Example", "fixed_count": 1}'
201
+ $ locust --config-users '[{"user_class_name": "Example", "fixed_count": 1}, {"user_class_name": "ExampleTwo", "fixed_count": 2}]'
202
+ $ locust --config-users '{"user_class_name": "Example", "fixed_count": 1}' '{"user_class_name": "ExampleTwo", "fixed_count": 2}'
203
+ $ locust --config-users config_users.json
204
+
167
205
  Custom arguments
168
206
  ================
169
207
 
@@ -199,8 +237,11 @@ The list of statistics parameters that can be modified is:
199
237
  | CURRENT_RESPONSE_TIME_PERCENTILE_WINDOW | Window size/resolution - in seconds - when calculating the current response |
200
238
  | | time percentile |
201
239
  +-------------------------------------------+--------------------------------------------------------------------------------------+
202
- | PERCENTILES_TO_REPORT | The list of response time percentiles to be calculated & reported |
240
+ | PERCENTILES_TO_REPORT | List of response time percentiles to be calculated & reported |
241
+ +-------------------------------------------+--------------------------------------------------------------------------------------+
242
+ | PERCENTILES_TO_CHART | List of response time percentiles in the screen of chart for Web UI |
203
243
  +-------------------------------------------+--------------------------------------------------------------------------------------+
204
- | PERCENTILES_TO_CHART | The list of response time percentiles for response time chart |
244
+ | PERCENTILES_TO_STATISTICS | List of response time percentiles in the screen of statistics for Web UI |
245
+ | | This parameter supports only modern UI |
205
246
  +-------------------------------------------+--------------------------------------------------------------------------------------+
206
247
 
@@ -31,11 +31,11 @@ We use `tox <https://tox.readthedocs.io/en/stable/>`_ to automate tests across m
31
31
 
32
32
  $ pip3 install tox
33
33
  $ tox
34
- py37 create: /home/myuser/git/locust/.tox/py37
35
- py37 installdeps: mock, retry, pyquery, cryptography
36
34
  ...
37
- Successfully installed ConfigArgParse-1.5.3 Flask-BasicAuth-0.2.0 Flask-Cors-3.0.10 Jinja2-3.1.2 MarkupSafe-2.1.1 Six-1.16.0 Werkzeug-2.2.2 brotli-1.0.9 click-8.1.3 flask-2.2.2 gevent-22.10.1 geventhttpclient-2.0.8 greenlet-1.1.3.post0 itsdangerous-2.1.2 locust-2.12.2 msgpack-1.0.4 psutil-5.9.2 pyzmq-24.0.1 roundrobin-0.0.4 typing-extensions-4.4.0 zope.event-4.5.0 zope.interface-5.5.0
38
- py37 run-test: commands[1] | python3 -m coverage run -m unittest discover
35
+ py38: install_deps> python -I -m pip install cryptography mock pyquery retry
36
+ py38: commands[0]> python3 -m pip install .
37
+ ...
38
+ py38: commands[1]> python3 -m unittest discover
39
39
  ...
40
40
 
41
41
  To only run a specific suite or specific test you can call `pytest <https://docs.pytest.org/>`_ directly:
@@ -44,38 +44,28 @@ To only run a specific suite or specific test you can call `pytest <https://docs
44
44
 
45
45
  $ pytest locust/test/test_main.py::DistributedIntegrationTests::test_distributed_tags
46
46
 
47
- Format code
48
- ===========
47
+ Formatting and linting
48
+ ======================
49
49
 
50
- Locust follows the `black <https://github.com/psf/black>`_ formatting standard, and the build will fail if code does not adhere to it. If you run vscode it will automatically run every time you save a file, but if your editor doesn't support it you can run it manually:
50
+ Locust uses `ruff <https://github.com/astral-sh/ruff/>`_ for formatting and linting. The build will fail if code does not adhere to it. If you run vscode it will automatically run every time you save a file, but if your editor doesn't support it you can run it manually:
51
51
 
52
52
  .. code-block:: console
53
53
 
54
- $ pip3 install black
55
- $ python -m black <file_to_be_formatted>
54
+ $ pip3 install ruff
55
+ $ python -m ruff --fix <file_or_folder_to_be_formatted>
56
+ $ python -m ruff format <file_or_folder_to_be_formatted>
56
57
 
57
58
  You can validate the whole project using tox:
58
59
 
59
60
  .. code-block:: console
60
61
 
61
- $ tox -e black
62
- black installed: black==22.8.0,click==8.1.3,mypy-extensions==0.4.3,pathspec==0.10.1,platformdirs==2.5.2,tomli==2.0.1,typing_extensions==4.4.0
63
- black run-test-pre: PYTHONHASHSEED='3136620079'
64
- black run-test: commands[0] | black --check .
65
- All done! 🍰 ✨
66
- 99 files would be left unchanged.
67
-
68
- Linting
69
- =======
70
-
71
- Our code is checked using `flake8 <https://flake8.pycqa.org/en/latest/flake8>`_:
72
-
73
- .. code-block:: console
74
-
75
- $ tox -e flake8
76
- flake8 installed: flake8==5.0.4,mccabe==0.7.0,pycodestyle==2.9.1,pyflakes==2.5.0
77
- flake8 run-test-pre: PYTHONHASHSEED='1517754253'
78
- flake8 run-test: commands[0] | flake8 . --count --show-source --statistics
62
+ $ tox -e ruff
63
+ ruff: install_deps> python -I -m pip install ruff==0.1.13
64
+ ruff: commands[0]> ruff check .
65
+ ruff: commands[1]> ruff format --check
66
+ 104 files already formatted
67
+ ruff: OK (1.41=setup[1.39]+cmd[0.01,0.01] seconds)
68
+ congratulations :) (1.47 seconds)
79
69
 
80
70
  Build documentation
81
71
  ===================
@@ -128,6 +128,29 @@ source code.
128
128
 
129
129
 
130
130
 
131
+ Adding Authentication to the Web UI
132
+ ===================================
133
+
134
+ Locust uses `Flask-Login <https://pypi.org/project/Flask-Login/>`_ to handle authentication. The ``login_manager`` is
135
+ exposed on ``environment.web_ui.app``, allowing the flexibility for you to implement any kind of auth that you would like!
136
+
137
+ To use username / password authentication, simply provide a ``username_password_callback`` to the ``environment.web_ui.auth_args``.
138
+ You are responsible for defining the route for the callback and implementing the authentication.
139
+
140
+ Authentication providers can additionally be configured to allow authentication from 3rd parties such as GitHub or an SSO.
141
+ Simply provide a list of desired ``auth_providers``. You may specify the ``label`` and ``icon`` for display on the button.
142
+ The ``callback_url`` will be the url that the button directs to. You will be responsible for defining the callback route as
143
+ well as the authentication with the 3rd party.
144
+
145
+ Whether you are using username / password authentication, an auth provider, or both, a ``user_loader`` needs to be proivded
146
+ to the ``login_manager``. The ``user_loader`` should return ``None`` to deny authentication or return a User object when
147
+ authentication to the app should be granted.
148
+
149
+ A full example can be seen `in the auth example <https://github.com/locustio/locust/tree/master/examples/web_ui_auth.py>`_.
150
+
151
+
152
+
153
+
131
154
  Run a background greenlet
132
155
  =========================
133
156
 
@@ -1,6 +1,6 @@
1
1
  sphinx==4.3.2
2
2
  sphinx-rtd-theme==0.5.2
3
- readthedocs-sphinx-search==0.1.2
3
+ readthedocs-sphinx-search==0.3.2
4
4
  Sphinx-Substitution-Extensions==2020.9.30.0
5
5
  Pygments==2.16.1
6
6
  alabaster==0.7.13
@@ -4,29 +4,24 @@
4
4
  Distributed load generation
5
5
  ===========================
6
6
 
7
- A single process running Locust can simulate a reasonably high throughput. For a simple test plan it should be able to make many hundreds of requests per second, thousands if you use :ref:`FastHttpUser <increase-performance>`.
7
+ A single process running Locust can simulate a reasonably high throughput. For a simple test plan and small payloads it can make more than a thousand requests per second, possibly over ten thousand if you use :ref:`FastHttpUser <increase-performance>`.
8
8
 
9
- But if your test plan is complex or you want to run even more load, you'll need to scale out to multiple processes, maybe even multiple machines. Because Python cannot fully utilize more than one core per process (see `GIL <https://realpython.com/python-gil/>`_), you may need to run **one worker instance per processor core** in order to have access to all your computing power.
9
+ But if your test plan is complex or you want to run even more load, you'll need to scale out to multiple processes, maybe even multiple machines. Fortunately, Locust supports distributed runs out of the box.
10
10
 
11
- To do this, you start one instance of Locust in master mode using the ``--master`` flag and multiple worker instances using the ``--worker`` flag. If the workers are not on the same machine as the master you use ``--master-host`` to point them to the IP/hostname of the machine running the master.
11
+ To do this, you start one instance of Locust with the ``--master`` flag and one or more using the ``--worker`` flag. The master instance runs Locust's web interface, and tells the workers when to spawn/stop Users. The worker instances run your Users and send statistics back to the master. The master instance doesn't run any Users itself.
12
12
 
13
- To make this easier, you can use the ``--processes`` flag to launch multiple instances. By default it will launch a master process and the specified number of worker processes. Used in combination with ``--worker`` it will only launch the workers.
13
+ To simplify startup, you can use the ``--processes`` flag. It will launch a master process and the specified number of worker processes. It can also be used in combination with ``--worker``, then it will only launch workers. This feature relies on `fork() <https://linux.die.net/man/3/fork>`_ so it doesn't work on Windows.
14
14
 
15
15
  .. note::
16
- ``--processes`` was introduced in Locust 2.19 and is somewhat experimental. Child processes are launched using fork, which is not available in Windows.
17
-
18
- The master instance runs Locust's web interface, and tells the workers when to spawn/stop Users. The worker instances run your Users and send statistics back to the master. The master instance doesn't run any Users itself.
19
-
20
- Both the master and worker machines must have a copy of the locustfile when running Locust distributed.
16
+ Because Python cannot fully utilize more than one core per process (see `GIL <https://realpython.com/python-gil/>`_), you need to run one worker instance per processor core in order to have access to all your computing power.
21
17
 
22
18
  .. note::
23
- There is almost no limit to how many *Users* you can run per worker. Locust/gevent can run thousands or even tens of thousands of Users per process just fine, as long as their total request rate (RPS) is not too high.
19
+ There is almost no limit to how many Users you can run per worker. Locust/gevent can run thousands or even tens of thousands of Users per process just fine, as long as their total request rate (RPS) is not too high.
24
20
 
25
- .. note::
26
- If Locust is getting close to running out of CPU resources, it will log a warning. If there is no warning, you can be pretty sure your test is not limited by load generator CPU.
21
+ If Locust *is* getting close to running out of CPU resources, it will log a warning. If there is no warning but you are still unable to generate the expected load, then the problem must be `something else <https://github.com/locustio/locust/wiki/FAQ#increase-my-request-raterps>`_.
27
22
 
28
- Example 1: Everything on one machine
29
- ====================================
23
+ Single machine
24
+ ==============
30
25
 
31
26
  It is really simple to launch a master and 4 worker processes::
32
27
 
@@ -36,21 +31,34 @@ You can even auto-detect the number of cores in your machine and launch one work
36
31
 
37
32
  locust --processes -1
38
33
 
39
- Example 2: Multiple machines
40
- ============================
34
+ Multiple machines
35
+ =================
41
36
 
42
37
  Start locust in master mode on one machine::
43
38
 
44
39
  locust -f my_locustfile.py --master
45
40
 
46
- And then on each worker machine::
41
+ And then on each worker machine (make sure they also have a copy of the locustfile):
42
+
43
+ .. code-block:: bash
47
44
 
48
45
  locust -f my_locustfile.py --worker --master-host <your master's address> --processes 4
49
46
 
50
- Note that both master and worker nodes need access to the locustfile, it is not sent from master to worker automatically. But you can use `locust-swarm <https://github.com/SvenskaSpel/locust-swarm>`_ to automate that.
47
+ Multiple machines, using locust-swarm
48
+ =====================================
49
+
50
+ Both worker and master need access to the locustfile, and when you make changes to it you'll need to restart all Locust processes. `locust-swarm <https://github.com/SvenskaSpel/locust-swarm>`_ automates this for you. It also solves the issue of firewall/network access from workers to master using SSH tunnels (this is often a problem if the master is running on your workstation and workers are running in some datacenter).
51
+
52
+ .. code-block:: bash
53
+
54
+ pip install locust-swarm
55
+
56
+ swarm -f my_locustfile.py --loadgen-list worker-server1,worker-server2 <any other regular locust parameters>
57
+
58
+ See `locust-swarm <https://github.com/SvenskaSpel/locust-swarm>`_ for more details.
51
59
 
52
- Options
53
- =======
60
+ Options for distributed load generation
61
+ =======================================
54
62
 
55
63
  ``--master-host <hostname or ip>``
56
64
  ----------------------------------
@@ -85,7 +93,7 @@ Communicating across nodes
85
93
  =============================================
86
94
 
87
95
  When running Locust in distributed mode, you may want to communicate between master and worker nodes in
88
- order to coordinate data. This can be easily accomplished with custom messages using the built in messaging hooks:
96
+ order to coordinate the test. This can be easily accomplished with custom messages using the built in messaging hooks:
89
97
 
90
98
  .. code-block:: python
91
99
 
@@ -52,9 +52,7 @@ load against a dynamic website where most pages had different content for differ
52
52
  verbose configuration files to declare the tests. In Locust we took a different approach. Instead of configuration formats or UIs
53
53
  you'd get a python framework that would let you define the behaviour of your users using Python code.
54
54
 
55
- `Locust <https://en.wikipedia.org/wiki/Locust>`_ takes its name from the grasshopper species, known for their swarming behaviour.
56
-
57
- Previous versions of Locust used terminology borrowed from nature (swarming, hatching, attacking etc), but now employs more industry standard naming.
55
+ Locust takes its name from the `grasshopper species <https://en.wikipedia.org/wiki/Locust>`_, known for their swarming behaviour.
58
56
 
59
57
  :ref:`history`
60
58
 
@@ -1,4 +1,4 @@
1
- from locust import HttpUser, task, events
1
+ from locust import HttpUser, events, task
2
2
 
3
3
 
4
4
  @events.init_command_line_parser.add_listener
@@ -1,4 +1,4 @@
1
- from locust import HttpUser, TaskSet, task, between
1
+ from locust import HttpUser, TaskSet, between, task
2
2
 
3
3
 
4
4
  def index(l):
@@ -1,8 +1,10 @@
1
1
  # This locust test script example will simulate a user
2
2
  # browsing the Locust documentation on https://docs.locust.io/
3
3
 
4
+ from locust import HttpUser, SequentialTaskSet, between, task
5
+
4
6
  import random
5
- from locust import HttpUser, SequentialTaskSet, task, between
7
+
6
8
  from pyquery import PyQuery
7
9
 
8
10
 
@@ -1,8 +1,10 @@
1
1
  # This locust test script example will simulate a user
2
2
  # browsing the Locust documentation on https://docs.locust.io/
3
3
 
4
+ from locust import HttpUser, TaskSet, between, task
5
+
4
6
  import random
5
- from locust import HttpUser, TaskSet, task, between
7
+
6
8
  from pyquery import PyQuery
7
9
 
8
10
 
@@ -1,4 +1,4 @@
1
- from locust import HttpUser, task, events, between
1
+ from locust import HttpUser, between, events, task
2
2
  from locust.runners import MasterRunner, WorkerRunner
3
3
 
4
4
  usernames = []
@@ -1,6 +1,6 @@
1
+ from locust import HttpUser, LoadTestShape, TaskSet, constant, task
2
+
1
3
  import math
2
- from locust import HttpUser, TaskSet, task, constant
3
- from locust import LoadTestShape
4
4
 
5
5
 
6
6
  class UserTasks(TaskSet):
@@ -1,5 +1,4 @@
1
- from locust import HttpUser, TaskSet, task, constant
2
- from locust import LoadTestShape
1
+ from locust import HttpUser, LoadTestShape, TaskSet, constant, task
3
2
 
4
3
 
5
4
  class UserTasks(TaskSet):
@@ -1,5 +1,4 @@
1
- from locust import HttpUser, TaskSet, task, constant
2
- from locust import LoadTestShape
1
+ from locust import HttpUser, LoadTestShape, TaskSet, constant, task
3
2
 
4
3
 
5
4
  class UserTasks(TaskSet):
@@ -1,6 +1,6 @@
1
+ from locust import HttpUser, LoadTestShape, TaskSet, constant, task
2
+
1
3
  import math
2
- from locust import HttpUser, TaskSet, task, constant
3
- from locust import LoadTestShape
4
4
 
5
5
 
6
6
  class UserTasks(TaskSet):
@@ -1,10 +1,9 @@
1
- from collections import namedtuple
1
+ from locust import HttpUser, LoadTestShape, TaskSet, constant, task
2
+
2
3
  import math
3
- import time
4
4
  import random
5
-
6
- from locust import HttpUser, TaskSet, task, constant
7
- from locust import LoadTestShape
5
+ import time
6
+ from collections import namedtuple
8
7
 
9
8
 
10
9
  class UserTasks(TaskSet):
@@ -1,4 +1,5 @@
1
1
  from locust import HttpUser, TaskSet, task
2
+
2
3
  import random
3
4
 
4
5
 
@@ -1,8 +1,8 @@
1
- import time
2
- from xmlrpc.client import ServerProxy, Fault
3
-
4
1
  from locust import User, task
5
2
 
3
+ import time
4
+ from xmlrpc.client import Fault, ServerProxy
5
+
6
6
 
7
7
  class XmlRpcClient(ServerProxy):
8
8
  """
@@ -1,4 +1,4 @@
1
- from locust import HttpUser, task, run_single_user
1
+ from locust import HttpUser, run_single_user, task
2
2
 
3
3
 
4
4
  class QuickstartUser(HttpUser):
@@ -1,4 +1,4 @@
1
- from locust import HttpUser, task, run_single_user
1
+ from locust import HttpUser, run_single_user, task
2
2
  from locust.exception import StopUser
3
3
 
4
4
 
@@ -1,6 +1,6 @@
1
1
  # locustfile.py
2
2
 
3
- from locust import HttpUser, TaskSet, task, between
3
+ from locust import HttpUser, TaskSet, between, task
4
4
 
5
5
  USER_CREDENTIALS = [
6
6
  ("user1", "password"),
@@ -3,8 +3,7 @@ This is an example of a locustfile that uses Locust's built in event hooks to
3
3
  track the sum of the content-length header in all successful HTTP responses
4
4
  """
5
5
 
6
- from locust import HttpUser, TaskSet, task, web, between
7
- from locust import events
6
+ from locust import HttpUser, TaskSet, between, events, task, web
8
7
 
9
8
 
10
9
  class MyTaskSet(TaskSet):
@@ -4,12 +4,14 @@ UI extension hooks to track the sum of the content-length header in all
4
4
  successful HTTP responses and display them in the web UI.
5
5
  """
6
6
 
7
- import os
7
+ from locust import HttpUser, TaskSet, between, events, task, web
8
+
8
9
  import json
9
- from time import time
10
+ import os
10
11
  from html import escape
11
- from locust import HttpUser, TaskSet, task, web, between, events
12
- from flask import Blueprint, render_template, jsonify, make_response, request
12
+ from time import time
13
+
14
+ from flask import Blueprint, jsonify, make_response, render_template, request
13
15
 
14
16
 
15
17
  class MyTaskSet(TaskSet):
@@ -4,11 +4,13 @@ UI extension hooks to track the sum of the content-length header in all
4
4
  successful HTTP responses and display them in the web UI.
5
5
  """
6
6
 
7
+ from locust import HttpUser, TaskSet, between, events, task, web
8
+
7
9
  import os
8
- from time import time
9
10
  from html import escape
10
- from locust import HttpUser, TaskSet, task, web, between, events
11
- from flask import Blueprint, render_template, jsonify, make_response
11
+ from time import time
12
+
13
+ from flask import Blueprint, jsonify, make_response, render_template
12
14
 
13
15
 
14
16
  class MyTaskSet(TaskSet):