Write scalable load tests in plain Python 🚗💨
671 matches across 13 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/web.py | 381 | def _download_csv_suggest_file_name(suggest_filename_prefix: str) -> str: |
| LOW | locust/web.py | 419 | def request_stats_full_history_csv() -> Response: |
| LOW | locust/env.py | 255 | def _remove_user_classes_with_weight_zero(self) -> None: |
| LOW | locust/env.py | 290 | def _validate_user_class_name_uniqueness(self): |
| LOW | locust/env.py | 299 | def _validate_shape_class_instance(self): |
| LOW | locust/log.py | 88 | def greenlet_exception_logger(logger, level=logging.CRITICAL): |
| LOW | locust/dispatch.py | 129 | def dispatch_iteration_durations(self) -> list[float]: |
| LOW | locust/dispatch.py | 271 | def _wait_between_dispatch_iteration_context(self) -> Generator[None]: |
| LOW | locust/dispatch.py | 313 | def _remove_users_from_workers(self) -> dict[str, dict[str, int]]: |
| LOW | locust/dispatch.py | 391 | def _fast_users_on_workers_copy(users_on_workers: dict[str, dict[str, int]]) -> dict[str, dict[str, int]]: |
| LOW | locust/opentelemetry.py | 142 | def _setup_auto_instrumentation(): |
| LOW | locust/stats.py | 161 | def calculate_response_time_percentile(response_times: dict[int, int], num_requests: int, percent: float) -> int: |
| LOW | locust/stats.py | 600 | def get_response_time_percentile(self, percent: float) -> int: |
| LOW | locust/stats.py | 609 | def get_current_response_time_percentile(self, percent: float) -> int | None: |
| LOW | locust/stats.py | 824 | def setup_distributed_stats_event_listeners(events: Events, stats: RequestStats) -> None: |
| LOW | locust/stats.py | 901 | def get_percentile_stats_summary(stats: RequestStats) -> list[str]: |
| LOW | locust/stats.py | 1266 | def validate_stats_configuration() -> None: |
| LOW | locust/clients.py | 533 | def build_connection_pool_key_attributes(self, request, verify, cert=None): |
| LOW | locust/runners.py | 851 | def _wait_for_workers_report_after_ramp_up(self) -> float: |
| LOW | locust/runners.py | 1191 | def reported_user_classes_count(self) -> dict[str, int]: |
| LOW | locust/runners.py | 1340 | def heartbeat_timeout_checker(self) -> NoReturn: |
| LOW | locust/runners.py | 1519 | def _format_user_classes_count_for_log(user_classes_count: dict[str, int]) -> str: |
| LOW | locust/runners.py | 1526 | def _aggregate_dispatched_users(d: dict[str, dict[str, int]]) -> dict[str, int]: |
| LOW | locust/main.py | 86 | def merge_locustfiles_content( |
| LOW | locust/main.py | 513 | def spawn_run_time_quit_greenlet(): |
| LOW | locust/argument_parser.py | 96 | def secret_args_included_in_web_ui(self) -> dict[str, configargparse.Action]: |
| LOW | locust/argument_parser.py | 104 | def required_args_included_in_web_ui(self) -> dict[str, configargparse.Action]: |
| LOW | locust/argument_parser.py | 112 | def multiple_args_included_in_web_ui(self) -> dict[str, configargparse.Action]: |
| LOW | locust/argument_parser.py | 192 | def download_locustfile_from_url(url: str) -> str: |
| LOW | locust/argument_parser.py | 219 | def get_empty_argument_parser(add_help=True, default_config_files=DEFAULT_CONFIG_FILES) -> LocustArgumentParser: |
| LOW | locust/argument_parser.py | 263 | def download_locustfile_from_master(master_host: str, master_port: int) -> str: |
| LOW | locust/argument_parser.py | 370 | def parse_locustfiles_from_master(locustfile_sources) -> list[str]: |
| LOW | locust/argument_parser.py | 388 | def retrieve_locustfiles_from_master(options) -> list[str]: |
| LOW | locust/argument_parser.py | 403 | def raise_argument_type_error(err_msg): |
| LOW | locust/test/test_parser.py | 38 | def test_parse_options_from_conf_file(self): |
| LOW | locust/test/test_parser.py | 433 | def test_find_locustfiles_with_multiple_locustfiles(self): |
| LOW | locust/test/test_parser.py | 443 | def test_find_locustfiles_error_for_invalid_file_extension(self): |
| LOW | locust/test/test_parser.py | 450 | def test_find_locustfiles_error_if_multiple_values_for_directory(self): |
| LOW | locust/test/test_parser.py | 60 | def test_parse_two_line_conf_file(self): # there was an issue with conf files identified as toml |
| LOW | locust/test/test_parser.py | 70 | def test_parse_options_from_toml_file(self): |
| LOW | locust/test/test_parser.py | 135 | def test_parse_options_from_env(self): |
| LOW | locust/test/test_parser.py | 194 | def test_parse_locustfile_multiple_files(self): |
| LOW | locust/test/test_parser.py | 208 | def test_parse_locustfile_with_directory(self): |
| LOW | locust/test/test_parser.py | 219 | def test_parse_locustfile_with_nested_directory(self): |
| LOW | locust/test/test_parser.py | 243 | def test_parse_locustfile_with_directory_ignores_invalid_filenames(self): |
| LOW | locust/test/test_parser.py | 258 | def test_parse_locustfile_empty_directory_error(self): |
| LOW | locust/test/test_parser.py | 268 | def test_parse_locustfile_and_directory(self): |
| LOW | locust/test/test_parser.py | 282 | def test_parse_multiple_directories(self): |
| LOW | locust/test/test_parser.py | 295 | def test_parse_locustfile_invalid_directory_error(self): |
| LOW | locust/test/test_parser.py | 305 | def test_unknown_command_line_arg(self): |
| LOW | locust/test/test_parser.py | 352 | def test_custom_argument_help_message(self): |
| LOW | locust/test/test_parser.py | 371 | def test_custom_argument_included_in_web_ui(self): |
| LOW | locust/test/test_parser.py | 406 | def test_find_locustfiles_with_is_directory(self): |
| LOW | locust/test/test_parser.py | 417 | def test_find_locustfiles_error_if_directory_doesnt_exist(self): |
| LOW | locust/test/test_parser.py | 422 | def test_find_locustfiles_ignores_invalid_files_in_directory(self): |
| LOW | locust/test/test_dispatch.py | 1083 | # def test_ramp_down_users_on_workers_respecting_weight(self): |
| LOW | locust/test/test_dispatch.py | 787 | def test_users_are_distributed_evenly_across_hosts(self): |
| LOW | locust/test/test_dispatch.py | 851 | def test_implementation_of_dispatch_distribution_with_gcd(self): |
| LOW | locust/test/test_dispatch.py | 883 | def test_implementation_of_dispatch_distribution_with_gcd_float_weight(self): |
| LOW | locust/test/test_dispatch.py | 922 | def test_wait_between_dispatch(self): |
| 389 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | locust/shape.py | 0 | meta class for the main user class. it's used to allow user classes to specify task execution ratio using an {task:int} |
| HIGH | locust/user/task.py | 0 | meta class for the main user class. it's used to allow user classes to specify task execution ratio using an {task:int} |
| HIGH | locust/user/users.py | 0 | meta class for the main user class. it's used to allow user classes to specify task execution ratio using an {task:int} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_dispatch.py | 0 | final distribution should be {"user1": 3, "user2": 3, "user3": 3} |
| HIGH | locust/test/test_main.py | 0 | from locust import httpuser, task, constant class quickstartuser(httpuser): wait_time = constant(1) @task def hello_worl |
| HIGH | locust/test/test_main.py | 0 | from locust import httpuser, task, constant class quickstartuser(httpuser): wait_time = constant(1) @task def hello_worl |
| HIGH | locust/test/test_main.py | 0 | from locust import httpuser, task, constant class quickstartuser(httpuser): wait_time = constant(1) @task def hello_worl |
| HIGH | locust/test/test_main.py | 0 | from locust import httpuser, task, constant class quickstartuser(httpuser): wait_time = constant(1) @task def hello_worl |
| HIGH | locust/test/test_main.py | 0 | from locust import user, task, constant class user1(user): wait_time = constant(1) @task def t(self): pass |
| HIGH | locust/test/test_main.py | 0 | from locust import user, task, constant class user1(user): wait_time = constant(1) @task def t(self): pass |
| HIGH | locust/test/test_main.py | 0 | from locust import user, task, constant class user1(user): wait_time = constant(1) @task def t(self): pass |
| HIGH | locust/test/test_main.py | 0 | from locust import user, task, constant class user1(user): wait_time = constant(1) @task def t(self): pass |
| HIGH | examples/custom_wait_function.py | 0 | user class that does requests to the locust web server running on localhost |
| HIGH | examples/basic.py | 0 | user class that does requests to the locust web server running on localhost |
| HIGH | examples/multiple_hosts.py | 0 | user class that does requests to the locust web server running on localhost |
| HIGH | examples/grpc/hello_pb2_grpc.py | 0 | missing associated documentation comment in .proto file. |
| HIGH | examples/grpc/hello_pb2_grpc.py | 0 | missing associated documentation comment in .proto file. |
| HIGH | examples/grpc/hello_pb2_grpc.py | 0 | missing associated documentation comment in .proto file. |
| HIGH | examples/grpc/hello_pb2_grpc.py | 0 | missing associated documentation comment in .proto file. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | locust/test/test_csv_request_logger.py | 65 | # ------------------------------------------------------------------ |
| MEDIUM | locust/contrib/milvus.py | 269 | # ---------------------------------- |
| MEDIUM | locust/contrib/milvus.py | 271 | # ---------------------------------- |
| MEDIUM | locust/contrib/qdrant.py | 133 | # ---------------------------------- |
| MEDIUM | locust/contrib/qdrant.py | 135 | # ---------------------------------- |
| MEDIUM | locust/contrib/csv_request_logger.py | 108 | # ------------------------------------------------------------------ |
| MEDIUM | locust/contrib/csv_request_logger.py | 110 | # ------------------------------------------------------------------ |
| MEDIUM | locust/contrib/csv_request_logger.py | 135 | # ------------------------------------------------------------------ |
| MEDIUM | locust/contrib/csv_request_logger.py | 137 | # ------------------------------------------------------------------ |
| MEDIUM | docs/conf.py | 91 | # --------------------- |
| MEDIUM | docs/conf.py | 168 | # ----------------------- |
| MEDIUM | .github/workflows/tests.yml | 23 | #------------------------- |
| MEDIUM | .github/workflows/tests.yml | 25 | #------------------------- |
| MEDIUM | .github/workflows/tests.yml | 127 | #------------------------- |
| MEDIUM | .github/workflows/tests.yml | 129 | #------------------------- |
| MEDIUM | .github/workflows/tests.yml | 383 | # ------------------------- |
| MEDIUM | .github/workflows/tests.yml | 385 | # ------------------------- |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | pytest_locust/plugin.py | 7 | |
| LOW | locust/event.py | 1 | |
| LOW | locust/web.py | 1 | |
| LOW | locust/env.py | 1 | |
| LOW | locust/input_events.py | 1 | |
| LOW | locust/dispatch.py | 1 | |
| LOW | locust/__init__.py | 24 | |
| LOW | locust/__init__.py | 25 | |
| LOW | locust/__init__.py | 26 | |
| LOW | locust/__init__.py | 28 | |
| LOW | locust/__init__.py | 29 | |
| LOW | locust/__init__.py | 30 | |
| LOW | locust/__init__.py | 30 | |
| LOW | locust/__init__.py | 30 | |
| LOW | locust/__init__.py | 31 | |
| LOW | locust/__init__.py | 32 | |
| LOW | locust/__init__.py | 32 | |
| LOW | locust/__init__.py | 32 | |
| LOW | locust/__init__.py | 33 | |
| LOW | locust/__init__.py | 33 | |
| LOW | locust/__init__.py | 34 | |
| LOW | locust/__init__.py | 34 | |
| LOW | locust/__init__.py | 34 | |
| LOW | locust/__init__.py | 34 | |
| LOW | locust/__init__.py | 63 | |
| LOW | locust/__init__.py | 64 | |
| LOW | locust/__init__.py | 8 | |
| LOW | locust/debug.py | 1 | |
| LOW | locust/stats.py | 1 | |
| LOW | locust/clients.py | 1 | |
| LOW | locust/runners.py | 1 | |
| LOW | locust/shape.py | 1 | |
| LOW | locust/main.py | 1 | |
| LOW | locust/main.py | 37 | |
| LOW | locust/argument_parser.py | 1 | |
| LOW | locust/test/test_dispatch.py | 1 | |
| LOW | locust/test/mock_logging.py | 1 | |
| LOW | locust/test/test_web.py | 1 | |
| LOW | locust/test/test_runners.py | 1 | |
| LOW | locust/test/test_main.py | 1 | |
| LOW | locust/util/load_locustfile.py | 1 | |
| LOW | locust/user/task.py | 1 | |
| LOW | locust/user/users.py | 1 | |
| LOW | locust/user/__init__.py | 8 | |
| LOW | locust/user/__init__.py | 8 | |
| LOW | locust/user/__init__.py | 8 | |
| LOW | locust/user/__init__.py | 9 | |
| LOW | locust/user/__init__.py | 9 | |
| LOW | locust/user/inspectuser.py | 1 | |
| LOW | locust/user/wait_time.py | 7 | |
| LOW | locust/contrib/mqtt.py | 1 | |
| LOW | locust/contrib/fasthttp.py | 1 | |
| LOW | locust/contrib/fasthttp.py | 5 | |
| LOW | locust/contrib/csv_request_logger.py | 54 | |
| LOW | locust/rpc/protocol.py | 1 | |
| LOW | locust/rpc/__init__.py | 6 | |
| LOW | locust/rpc/__init__.py | 7 | |
| LOW | docs/_ext/llms_txt.py | 36 | |
| LOW | examples/test_data_management.py | 23 | |
| LOW | examples/web_ui_auth/custom_form.py | 11 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/event.py | 52 | except Exception: |
| LOW | locust/event.py | 85 | except Exception as e: |
| LOW | locust/web.py | 658 | except Exception as e: |
| LOW | locust/input_events.py | 114 | except Exception as e: |
| MEDIUM | locust/input_events.py | 99 | def input_listener_func(): |
| LOW | locust/runners.py | 387 | except Exception: |
| LOW | locust/runners.py | 985 | except Exception as error: |
| LOW | locust/runners.py | 1081 | except Exception as e: |
| LOW | locust/runners.py | 1177 | except Exception: |
| LOW | locust/main.py | 239 | except Exception: |
| LOW | locust/main.py | 367 | except Exception as e: |
| LOW | locust/main.py | 687 | except Exception: |
| LOW | locust/argument_parser.py | 124 | except Exception as e: |
| MEDIUM | locust/argument_parser.py | 121 | def parse(self, stream): |
| MEDIUM | locust/test/test_web.py | 204 | def test_reset_stats(self): |
| MEDIUM | locust/test/test_web.py | 227 | def test_exceptions(self): |
| MEDIUM | locust/test/test_web.py | 242 | def test_exceptions_csv(self): |
| MEDIUM | locust/test/test_web.py | 1059 | def test_report_exceptions(self): |
| LOW | locust/test/test_web.py | 207 | except Exception as e: |
| LOW | locust/test/test_web.py | 230 | except Exception as e: |
| LOW | locust/test/test_web.py | 245 | except Exception as e: |
| LOW | locust/test/test_web.py | 1062 | except Exception as e: |
| LOW | locust/test/__init__.py | 14 | except Exception: |
| LOW | locust/user/task.py | 375 | except Exception: |
| LOW | locust/user/task.py | 384 | except Exception: |
| LOW | locust/user/task.py | 387 | except Exception as e: |
| LOW | locust/user/users.py | 162 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 97 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 110 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 159 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 192 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 226 | except Exception: |
| LOW | locust/contrib/milvus.py | 248 | except Exception as e: |
| LOW | locust/contrib/milvus.py | 261 | except Exception as e: |
| LOW | locust/contrib/qdrant.py | 46 | except Exception as e: |
| LOW | locust/contrib/qdrant.py | 79 | except Exception as e: |
| LOW | locust/contrib/qdrant.py | 109 | except Exception as e: |
| LOW | locust/contrib/qdrant.py | 125 | except Exception as e: |
| LOW | locust/contrib/mqtt.py | 381 | except Exception: |
| LOW | locust/contrib/fasthttp.py | 491 | except Exception as e: |
| LOW | locust/contrib/postgres.py | 23 | except Exception as e: |
| LOW | locust/contrib/socketio.py | 29 | except Exception as e: |
| LOW | locust/contrib/socketio.py | 47 | except Exception as e: |
| MEDIUM | locust/rpc/zmqrpc.py | 72 | print(f"Error resolving address: {e}") |
| LOW | docs/_ext/llms_txt.py | 201 | except Exception as e: |
| LOW | examples/manual_stats_reporting.py | 32 | except Exception as e: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| CRITICAL | locust/test/test_runners.py | 374 | self.user.environment.events.request.fire( |
| CRITICAL | locust/test/test_runners.py | 400 | self.user.environment.events.request.fire( |
| CRITICAL | locust/user/task.py | 388 | self.user.environment.events.user_error.fire(user_instance=self, exception=e, tb=e.__traceback__) |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/web.py | 121 | |
| LOW | locust/web.py | 213 | |
| LOW | locust/env.py | 270 | |
| LOW | locust/input_events.py | 98 | |
| LOW | locust/input_events.py | 67 | |
| LOW | locust/input_events.py | 99 | |
| LOW | locust/opentelemetry.py | 46 | |
| LOW | locust/opentelemetry.py | 91 | |
| LOW | locust/runners.py | 247 | |
| LOW | locust/runners.py | 339 | |
| LOW | locust/runners.py | 466 | |
| LOW | locust/runners.py | 874 | |
| LOW | locust/runners.py | 926 | |
| LOW | locust/runners.py | 974 | |
| LOW | locust/runners.py | 1015 | |
| LOW | locust/main.py | 148 | |
| LOW | locust/main.py | 256 | |
| LOW | locust/argument_parser.py | 121 | |
| LOW | locust/test/test_dispatch.py | 1775 | |
| LOW | locust/test/test_dispatch.py | 2148 | |
| LOW | locust/test/test_dispatch.py | 3623 | |
| LOW | locust/test/test_runners.py | 1313 | |
| LOW | locust/test/test_runners.py | 1838 | |
| LOW | locust/test/test_runners.py | 4103 | |
| LOW | locust/test/test_main.py | 279 | |
| LOW | locust/test/test_main.py | 288 | |
| LOW | locust/test/test_main.py | 363 | |
| LOW | locust/test/test_main.py | 502 | |
| LOW | locust/test/test_main.py | 752 | |
| LOW | locust/test/test_main.py | 797 | |
| LOW | locust/test/test_main.py | 1469 | |
| LOW | locust/util/load_locustfile.py | 88 | |
| LOW | locust/user/task.py | 144 | |
| LOW | locust/user/task.py | 346 | |
| LOW | locust/user/users.py | 297 | |
| LOW | locust/user/sequential_taskset.py | 17 | |
| LOW | locust/contrib/milvus.py | 200 | |
| LOW | locust/contrib/fasthttp.py | 453 | |
| LOW | locust/contrib/fasthttp.py | 583 | |
| LOW | docs/_ext/llms_txt.py | 110 | |
| LOW | examples/response_validations.py | 21 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | locust/env.py | 159 | # Create a new RequestStats with use_response_times_cache set to False to save some memory |
| MEDIUM | locust/test/test_markov_taskset.py | 223 | # Define a class with abstract=True explicitly |
| MEDIUM | locust/test/test_main.py | 847 | # Define the input filename as well as the resulting filename within the temp directory |
| MEDIUM | docs/conf.py | 2 | # This file is execfile()d with the current directory set to its containing dir. |
| MEDIUM | docs/conf.py | 22 | # Define the canonical URL if you are using a custom domain on Read the Docs |
| MEDIUM | examples/grpc/hello_pb2_grpc.py | 46 | # This class is part of an EXPERIMENTAL API. |
| MEDIUM | examples/socketio/echo_server.py | 12 | # Create a Socket.IO server |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/runners.py | 361 | # to unexpected behaviours such as the one in the following example: |
| LOW | locust/test/test_dispatch.py | 1081 | self.assertTrue(0 <= delta <= _TOLERANCE, delta) |
| LOW | locust/test/test_dispatch.py | 1101 | # { |
| LOW | docs/conf.py | 1 | # |
| LOW | docs/conf.py | 141 | |
| LOW | docs/conf.py | 181 | |
| LOW | examples/open_closed_workload.py | 21 | # so if response times increase to the point where one task execution takes more than 10s, |
| LOW | examples/test_data_management.py | 1 | # This example shows the various ways to run things before/outside of the normal task execution flow, |
| LOW | examples/browse_docs_test.py | 41 | |
| LOW | examples/socketio/socketio_ex.py | 21 | # resp = self.client.post("/login", json={"username": "foo", "password": "bar"}) |
| LOW | benchmarks/dispatch.py | 21 | USER_CLASSES: list[type[User]] = [] |
| LOW | .github/workflows/tests.yml | 541 | with: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/contrib/oai.py | 11 | from openai import OpenAI # dont forget to install openai |
| MEDIUM | examples/test_data_management.py | 43 | # If you want to get something over HTTP at this time you can use `requests` directly: |
| MEDIUM | examples/test_data_management.py | 122 | # If you do not want the request logged, you can replace self.client.<method> with requests.<method> |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/test/test_web.py | 1128 | def do_something(self): |
| LOW | locust/user/task.py | 398 | def execute_task(self, task): |
| LOW | locust/user/task.py | 507 | def execute_task(self, task): |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | locust/argument_parser.py | 204 | # Check if response is valid python code |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | locust/contrib/fasthttp.py | 686 | """Override _urlopen() in order to make it use the response_type attribute""" |