locust 2.32.3.dev9__py3-none-any.whl → 2.32.3.dev13__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 +2 -2
- locust/argument_parser.py +13 -0
- locust/main.py +12 -5
- locust/web.py +1 -0
- locust/webui/dist/assets/{index-DzzqypJO.js → index-BXPhYgcX.js} +2 -2
- locust/webui/dist/auth.html +1 -1
- locust/webui/dist/index.html +1 -1
- {locust-2.32.3.dev9.dist-info → locust-2.32.3.dev13.dist-info}/METADATA +1 -1
- {locust-2.32.3.dev9.dist-info → locust-2.32.3.dev13.dist-info}/RECORD +12 -12
- {locust-2.32.3.dev9.dist-info → locust-2.32.3.dev13.dist-info}/LICENSE +0 -0
- {locust-2.32.3.dev9.dist-info → locust-2.32.3.dev13.dist-info}/WHEEL +0 -0
- {locust-2.32.3.dev9.dist-info → locust-2.32.3.dev13.dist-info}/entry_points.txt +0 -0
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.32.3.
|
17
|
+
__version__ = "2.32.3.dev13"
|
18
18
|
version = __version__
|
19
|
-
__version_tuple__ = (2, 32, 3, "
|
19
|
+
__version_tuple__ = (2, 32, 3, "dev13")
|
20
20
|
version_tuple = __version_tuple__
|
locust/argument_parser.py
CHANGED
@@ -59,15 +59,18 @@ class LocustArgumentParser(configargparse.ArgumentParser):
|
|
59
59
|
Arguments:
|
60
60
|
include_in_web_ui: If True (default), the argument will show in the UI.
|
61
61
|
is_secret: If True (default is False) and include_in_web_ui is True, the argument will show in the UI with a password masked text input.
|
62
|
+
is_required: If True (default is False) and include_in_web_ui is True, the argument will show in the UI as a required form field.
|
62
63
|
|
63
64
|
Returns:
|
64
65
|
argparse.Action: the new argparse action
|
65
66
|
"""
|
66
67
|
include_in_web_ui = kwargs.pop("include_in_web_ui", True)
|
67
68
|
is_secret = kwargs.pop("is_secret", False)
|
69
|
+
is_required = kwargs.pop("is_required", False)
|
68
70
|
action = super().add_argument(*args, **kwargs)
|
69
71
|
action.include_in_web_ui = include_in_web_ui
|
70
72
|
action.is_secret = is_secret
|
73
|
+
action.is_required = is_required
|
71
74
|
return action
|
72
75
|
|
73
76
|
@property
|
@@ -82,6 +85,14 @@ class LocustArgumentParser(configargparse.ArgumentParser):
|
|
82
85
|
if a.dest in self.args_included_in_web_ui and hasattr(a, "is_secret") and a.is_secret
|
83
86
|
}
|
84
87
|
|
88
|
+
@property
|
89
|
+
def required_args_included_in_web_ui(self) -> dict[str, configargparse.Action]:
|
90
|
+
return {
|
91
|
+
a.dest: a
|
92
|
+
for a in self._actions
|
93
|
+
if a.dest in self.args_included_in_web_ui and hasattr(a, "is_required") and a.is_required
|
94
|
+
}
|
95
|
+
|
85
96
|
|
86
97
|
class LocustTomlConfigParser(configargparse.TomlConfigParser):
|
87
98
|
def parse(self, stream):
|
@@ -798,6 +809,7 @@ def default_args_dict() -> dict:
|
|
798
809
|
class UIExtraArgOptions(NamedTuple):
|
799
810
|
default_value: str
|
800
811
|
is_secret: bool
|
812
|
+
is_required: bool
|
801
813
|
help_text: str
|
802
814
|
choices: list[str] | None = None
|
803
815
|
|
@@ -813,6 +825,7 @@ def ui_extra_args_dict(args=None) -> dict[str, dict[str, Any]]:
|
|
813
825
|
k: UIExtraArgOptions(
|
814
826
|
default_value=v,
|
815
827
|
is_secret=k in parser.secret_args_included_in_web_ui,
|
828
|
+
is_required=k in parser.required_args_included_in_web_ui,
|
816
829
|
help_text=parser.args_included_in_web_ui[k].help,
|
817
830
|
choices=parser.args_included_in_web_ui[k].choices,
|
818
831
|
)._asdict()
|
locust/main.py
CHANGED
@@ -587,11 +587,18 @@ See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-numb
|
|
587
587
|
logger.error("Gave up waiting for workers to connect")
|
588
588
|
runner.quit()
|
589
589
|
sys.exit(1)
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
590
|
+
if time.monotonic() - start_time > 5:
|
591
|
+
logging.info(
|
592
|
+
"Waiting for workers to be ready, %s of %s connected",
|
593
|
+
len(runner.clients.ready),
|
594
|
+
options.expect_workers,
|
595
|
+
)
|
596
|
+
else:
|
597
|
+
logging.debug(
|
598
|
+
"Waiting for workers to be ready, %s of %s connected",
|
599
|
+
len(runner.clients.ready),
|
600
|
+
options.expect_workers,
|
601
|
+
)
|
595
602
|
# TODO: Handle KeyboardInterrupt and send quit signal to workers that are started.
|
596
603
|
# Right now, if the user sends a ctrl+c, the master will not gracefully
|
597
604
|
# shutdown resulting in all the already started workers to stay active.
|