locust 2.32.11.dev9__py3-none-any.whl → 2.32.11.dev11__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- locust/_version.py +2 -2
- locust/argument_parser.py +4 -1
- locust/html.py +19 -0
- locust/main.py +2 -1
- {locust-2.32.11.dev9.dist-info → locust-2.32.11.dev11.dist-info}/METADATA +1 -1
- {locust-2.32.11.dev9.dist-info → locust-2.32.11.dev11.dist-info}/RECORD +9 -9
- {locust-2.32.11.dev9.dist-info → locust-2.32.11.dev11.dist-info}/WHEEL +0 -0
- {locust-2.32.11.dev9.dist-info → locust-2.32.11.dev11.dist-info}/entry_points.txt +0 -0
- {locust-2.32.11.dev9.dist-info → locust-2.32.11.dev11.dist-info}/licenses/LICENSE +0 -0
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.32.11.
|
16
|
-
__version_tuple__ = version_tuple = (2, 32, 11, '
|
15
|
+
__version__ = version = '2.32.11.dev11'
|
16
|
+
__version_tuple__ = version_tuple = (2, 32, 11, 'dev11')
|
locust/argument_parser.py
CHANGED
@@ -208,6 +208,9 @@ Usage: locust [options] [UserClass ...]
|
|
208
208
|
|
209
209
|
locust --headless -u 100 -t 20m --processes 4 MyHttpUser AnotherUser
|
210
210
|
|
211
|
+
locust --headless -u 100 -r 10 -t 50 --print-stats --html "test_report_{u}_{r}_{t}.html" -H https://www.example.com
|
212
|
+
(The above run would generate an html file with the name "test_report_100_10_50.html")
|
213
|
+
|
211
214
|
See documentation for more details, including how to set options using a file or environment variables: https://docs.locust.io/en/stable/configuration.html""",
|
212
215
|
)
|
213
216
|
parser.add_argument(
|
@@ -754,7 +757,7 @@ Typically ONLY these options (and --locustfile) need to be specified on workers,
|
|
754
757
|
"--html",
|
755
758
|
metavar="<filename>",
|
756
759
|
dest="html_file",
|
757
|
-
help="Store HTML report to file path specified",
|
760
|
+
help="Store HTML report to file path specified. Able to parse certain tags - {u}, {r}, {t} and convert them to number of users, spawn rate and run time respectively.",
|
758
761
|
env_var="LOCUST_HTML",
|
759
762
|
)
|
760
763
|
stats_group.add_argument(
|
locust/html.py
CHANGED
@@ -15,6 +15,25 @@ PERCENTILES_FOR_HTML_REPORT = [0.50, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99, 1.0]
|
|
15
15
|
DEFAULT_BUILD_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "webui", "dist")
|
16
16
|
|
17
17
|
|
18
|
+
def process_html_filename(options) -> None:
|
19
|
+
num_users = options.num_users
|
20
|
+
spawn_rate = options.spawn_rate
|
21
|
+
run_time = options.run_time
|
22
|
+
|
23
|
+
option_mapping = {
|
24
|
+
"{u}": num_users,
|
25
|
+
"{r}": spawn_rate,
|
26
|
+
"{t}": run_time,
|
27
|
+
}
|
28
|
+
|
29
|
+
html_filename = options.html_file
|
30
|
+
|
31
|
+
for option_term, option_value in option_mapping.items():
|
32
|
+
html_filename = html_filename.replace(option_term, str(int(option_value)))
|
33
|
+
|
34
|
+
options.html_file = html_filename
|
35
|
+
|
36
|
+
|
18
37
|
def render_template_from(file, build_path=DEFAULT_BUILD_PATH, **kwargs):
|
19
38
|
env = JinjaEnvironment(loader=FileSystemLoader(build_path))
|
20
39
|
template = env.get_template(file)
|
locust/main.py
CHANGED
@@ -20,7 +20,7 @@ import gevent
|
|
20
20
|
from . import log, stats
|
21
21
|
from .argument_parser import parse_locustfile_option, parse_options
|
22
22
|
from .env import Environment
|
23
|
-
from .html import get_html_report
|
23
|
+
from .html import get_html_report, process_html_filename
|
24
24
|
from .input_events import input_listener
|
25
25
|
from .log import greenlet_exception_logger, setup_logging
|
26
26
|
from .stats import (
|
@@ -651,6 +651,7 @@ See https://github.com/locustio/locust/wiki/Installation#increasing-maximum-numb
|
|
651
651
|
|
652
652
|
def save_html_report():
|
653
653
|
html_report = get_html_report(environment, show_download_link=False)
|
654
|
+
process_html_filename(options)
|
654
655
|
logger.info("writing html report to file: %s", options.html_file)
|
655
656
|
with open(options.html_file, "w", encoding="utf-8") as file:
|
656
657
|
file.write(html_report)
|
@@ -1,17 +1,17 @@
|
|
1
1
|
locust/__init__.py,sha256=aWeuBPUxONjwNm1xp4v8L4BO14SuYLjscIiwJVX1Ui4,1746
|
2
2
|
locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
|
3
|
-
locust/_version.py,sha256=
|
4
|
-
locust/argument_parser.py,sha256=
|
3
|
+
locust/_version.py,sha256=vSQVh6adPMxEznBeq-vjv1hd4cd83k7ANcvvw1QKSwI,430
|
4
|
+
locust/argument_parser.py,sha256=ruSJcY4ouERwVopHvHDK-obQD6nlRKDqjLLwje2SH9k,32806
|
5
5
|
locust/clients.py,sha256=XK-xabq2_5GZKMEjebDobvEjeBTtCs8h2EelL7s68Qs,19346
|
6
6
|
locust/debug.py,sha256=7CCm8bIg44uGH2wqBlo1rXBzV2VzwPicLxLewz8r5CQ,5099
|
7
7
|
locust/dispatch.py,sha256=prdwtb9EoN4A9klgiKgWuwQmvFB8hEuFHOK6ot62AJI,16202
|
8
8
|
locust/env.py,sha256=UgR85CbbMXjhsbrMO8cx--ubdzEwuM2WZtY8DFMHHho,13065
|
9
9
|
locust/event.py,sha256=AWoeG2q11Vpupv1eW9Rf2N0EI4dDDAldKe6zY1ajC7I,8717
|
10
10
|
locust/exception.py,sha256=jGgJ32ubuf4pWdlaVOkbh2Y0LlG0_DHi-lv3ib8ppOE,1791
|
11
|
-
locust/html.py,sha256=
|
11
|
+
locust/html.py,sha256=vaRC-g5xzDwHRvzB1-YuqTNyfCekfpGDHi_g5yF_THg,4120
|
12
12
|
locust/input_events.py,sha256=ZIyePyAMuA_YFYWg18g_pE4kwuQV3RbEB250MzXRwjY,3314
|
13
13
|
locust/log.py,sha256=5E2ZUOa3V4sfCqa-470Gle1Ik9L5nxYitsjEB9tRwE0,3455
|
14
|
-
locust/main.py,sha256=
|
14
|
+
locust/main.py,sha256=kkZ2uY-rE9Os_OCDxbikjZMe0fbI463iFtdhmlVk3H8,27989
|
15
15
|
locust/py.typed,sha256=gkWLl8yD4mIZnNYYAIRM8g9VarLvWmTAFeUfEbxJLBw,65
|
16
16
|
locust/runners.py,sha256=6qmIl2eWOsx40Pf_xq0apR1XTKL1eGAZYTfvTHmYIvg,70615
|
17
17
|
locust/shape.py,sha256=t-lwBS8LOjWcKXNL7j2U3zroIXJ1b0fazUwpRYQOKXw,1973
|
@@ -50,8 +50,8 @@ locust/webui/dist/assets/graphs-light.png,sha256=7L6pOehXqCojQclzeP91l-LskFQAw_n
|
|
50
50
|
locust/webui/dist/assets/index-DnScW665.js,sha256=wGpn9anGhaCOR9lDkKJtEvLqrNujbWOS31mlPdRsFhU,1680695
|
51
51
|
locust/webui/dist/assets/testruns-dark.png,sha256=np6MvpgJ2gkKQ66SOmukLtjsMtHqTSr5dNfza-2XtCo,267621
|
52
52
|
locust/webui/dist/assets/testruns-light.png,sha256=iLAxBZh3kRsfGkcB1-1KSAbFgGji43IqiUrYuJlUoPk,276839
|
53
|
-
locust-2.32.11.
|
54
|
-
locust-2.32.11.
|
55
|
-
locust-2.32.11.
|
56
|
-
locust-2.32.11.
|
57
|
-
locust-2.32.11.
|
53
|
+
locust-2.32.11.dev11.dist-info/METADATA,sha256=WAecZLmzvNW-5PoPGEiEdDlRFOMvx6QJEJ6yxStXkhg,9639
|
54
|
+
locust-2.32.11.dev11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
55
|
+
locust-2.32.11.dev11.dist-info/entry_points.txt,sha256=RAdt8Ku-56m7bFjmdj-MBhbF6h4NX7tVODR9QNnOg0E,44
|
56
|
+
locust-2.32.11.dev11.dist-info/licenses/LICENSE,sha256=5hnz-Vpj0Z3kSCQl0LzV2hT1TLc4LHcbpBp3Cy-EuyM,1110
|
57
|
+
locust-2.32.11.dev11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|