locust-cloud 1.21.5.dev2__py3-none-any.whl → 1.21.6__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_cloud/actions.py +22 -0
- locust_cloud/args.py +29 -3
- locust_cloud/cloud.py +1 -19
- locust_cloud/docs/1-first-run.rst +1 -1
- {locust_cloud-1.21.5.dev2.dist-info → locust_cloud-1.21.6.dist-info}/METADATA +1 -1
- {locust_cloud-1.21.5.dev2.dist-info → locust_cloud-1.21.6.dist-info}/RECORD +9 -8
- {locust_cloud-1.21.5.dev2.dist-info → locust_cloud-1.21.6.dist-info}/WHEEL +0 -0
- {locust_cloud-1.21.5.dev2.dist-info → locust_cloud-1.21.6.dist-info}/entry_points.txt +0 -0
- {locust_cloud-1.21.5.dev2.dist-info → locust_cloud-1.21.6.dist-info}/licenses/LICENSE +0 -0
locust_cloud/actions.py
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
import logging
|
2
|
+
|
3
|
+
logger = logging.getLogger(__name__)
|
4
|
+
|
5
|
+
|
6
|
+
def delete(session):
|
7
|
+
try:
|
8
|
+
logger.info("Tearing down Locust cloud...")
|
9
|
+
response = session.delete(
|
10
|
+
"/teardown",
|
11
|
+
)
|
12
|
+
|
13
|
+
if response.status_code == 200:
|
14
|
+
logger.debug(f"Response message from teardown: {response.json()['message']}")
|
15
|
+
else:
|
16
|
+
logger.info(
|
17
|
+
f"Could not automatically tear down Locust Cloud: HTTP {response.status_code}/{response.reason} - Response: {response.text} - URL: {response.request.url}"
|
18
|
+
)
|
19
|
+
except KeyboardInterrupt:
|
20
|
+
pass # don't show nasty callstack
|
21
|
+
except Exception as e:
|
22
|
+
logger.error(f"Could not automatically tear down Locust Cloud: {e.__class__.__name__}:{e}")
|
locust_cloud/args.py
CHANGED
@@ -8,6 +8,10 @@ import shutil
|
|
8
8
|
import sys
|
9
9
|
import tempfile
|
10
10
|
|
11
|
+
from locust_cloud.actions import delete
|
12
|
+
from locust_cloud.apisession import ApiSession
|
13
|
+
from locust_cloud.web_login import logout, web_login
|
14
|
+
|
11
15
|
if sys.version_info >= (3, 11):
|
12
16
|
import tomllib
|
13
17
|
else:
|
@@ -162,20 +166,42 @@ class MergeToTransferEncodedZipFlat(MergeToTransferEncodedZip):
|
|
162
166
|
setattr(namespace, self.dest, value)
|
163
167
|
|
164
168
|
|
169
|
+
class WebLogin(argparse.Action):
|
170
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
171
|
+
web_login()
|
172
|
+
parser.exit()
|
173
|
+
|
174
|
+
|
175
|
+
class WebLogout(argparse.Action):
|
176
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
177
|
+
logout()
|
178
|
+
parser.exit()
|
179
|
+
|
180
|
+
|
181
|
+
class StackTeardown(argparse.Action):
|
182
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
183
|
+
session = ApiSession(namespace.non_interactive)
|
184
|
+
delete(session)
|
185
|
+
parser.exit()
|
186
|
+
|
187
|
+
|
165
188
|
cloud_parser = configargparse.ArgumentParser(add_help=False)
|
166
189
|
cloud_parser.add_argument(
|
167
190
|
"--login",
|
168
|
-
|
191
|
+
nargs=0,
|
192
|
+
action=WebLogin,
|
169
193
|
help="Launch an interactive session to authenticate your user.\nOnce completed your credentials will be stored and automatically refreshed for quite a long time.\nOnce those expire you will be prompted to perform another login.",
|
170
194
|
)
|
171
195
|
cloud_parser.add_argument(
|
172
196
|
"--logout",
|
173
|
-
|
197
|
+
nargs=0,
|
198
|
+
action=WebLogout,
|
174
199
|
help="Removes the authentication credentials",
|
175
200
|
)
|
176
201
|
cloud_parser.add_argument(
|
177
202
|
"--delete",
|
178
|
-
|
203
|
+
nargs=0,
|
204
|
+
action=StackTeardown,
|
179
205
|
help="Delete a running cluster. Useful if locust-cloud was killed/disconnected or if there was an error.",
|
180
206
|
)
|
181
207
|
cloud_parser.add_argument(
|
locust_cloud/cloud.py
CHANGED
@@ -5,6 +5,7 @@ import webbrowser
|
|
5
5
|
from threading import Thread
|
6
6
|
|
7
7
|
import requests
|
8
|
+
from locust_cloud.actions import delete
|
8
9
|
from locust_cloud.apisession import ApiSession
|
9
10
|
from locust_cloud.args import combined_cloud_parser
|
10
11
|
from locust_cloud.common import __version__
|
@@ -176,22 +177,3 @@ def main():
|
|
176
177
|
finally:
|
177
178
|
logger.debug("Shutting down websocket")
|
178
179
|
websocket.shutdown()
|
179
|
-
|
180
|
-
|
181
|
-
def delete(session):
|
182
|
-
try:
|
183
|
-
logger.info("Tearing down Locust cloud...")
|
184
|
-
response = session.delete(
|
185
|
-
"/teardown",
|
186
|
-
)
|
187
|
-
|
188
|
-
if response.status_code == 200:
|
189
|
-
logger.debug(f"Response message from teardown: {response.json()['message']}")
|
190
|
-
else:
|
191
|
-
logger.info(
|
192
|
-
f"Could not automatically tear down Locust Cloud: HTTP {response.status_code}/{response.reason} - Response: {response.text} - URL: {response.request.url}"
|
193
|
-
)
|
194
|
-
except KeyboardInterrupt:
|
195
|
-
pass # don't show nasty callstack
|
196
|
-
except Exception as e:
|
197
|
-
logger.error(f"Could not automatically tear down Locust Cloud: {e.__class__.__name__}:{e}")
|
@@ -23,7 +23,7 @@ Then you can launch a distributed test using Locust Cloud:
|
|
23
23
|
[2025-05-13 12:30:58,252] INFO: Deploying (us-east-1, 1.21.5)
|
24
24
|
[2025-05-13 12:31:06,366] INFO: Waiting for load generators to be ready...
|
25
25
|
[2025-05-13 10:31:11,119] master-lsdhr-8hwhs/INFO/locust.main: Starting Locust 2.37.1 (locust_exporter 1.18.4)
|
26
|
-
[2025-05-13 10:31:11,120] master-lsdhr-8hwhs/INFO/locust.main: Starting web interface at https://us-east-1.webui.locust.cloud/
|
26
|
+
[2025-05-13 10:31:11,120] master-lsdhr-8hwhs/INFO/locust.main: Starting web interface at https://us-east-1.webui.locust.cloud/your_company, press enter to open your default browser.
|
27
27
|
[2025-05-13 10:31:11,760] master-lsdhr-8hwhs/INFO/locust.runners: worker-jdnf6-jl8qq_a45c04a8d925448ea647fdcda2e8cf80 (index 0) reported as ready. 1 workers connected.
|
28
28
|
[2025-05-13 10:31:11,765] master-lsdhr-8hwhs/INFO/locust.runners: worker-jdnf6-pk8cl_6749cd6c0d244b3a9611d6a4e0a8d30b (index 1) reported as ready. 2 workers connected.
|
29
29
|
...
|
@@ -1,18 +1,19 @@
|
|
1
1
|
locust_cloud/__init__.py,sha256=6z2hE5rUP9WJyYgr-7XC2GhIV-05m8XxjOsnb8ae1WY,56
|
2
|
+
locust_cloud/actions.py,sha256=lMxKZCwfcsbYf9t5ti20QP60gKt8HHwyz8yjYm0H-a8,762
|
2
3
|
locust_cloud/apisession.py,sha256=fz3mJsHbS-LdlVcuaJurf4_nq_Oa_XdBTZ7sVpux_mA,4376
|
3
|
-
locust_cloud/args.py,sha256
|
4
|
-
locust_cloud/cloud.py,sha256=
|
4
|
+
locust_cloud/args.py,sha256=-JvkvbkjL6wsu4HZzQiSqOXxUXFC75qnPEIyFtnMXyY,10625
|
5
|
+
locust_cloud/cloud.py,sha256=HzaJ9BK-b3ksGNAHFNAPSoTz-LTgojkHs_ERUdobWRw,5694
|
5
6
|
locust_cloud/common.py,sha256=GVKkWcbbqd9n8oU-fHZRVZw3jGtuIVGSCLD2ZizeEo0,1160
|
6
7
|
locust_cloud/input_events.py,sha256=MyxccgboHByICuK6VpQCCJhZQqTZAacNmkSpw-gxBEw,3420
|
7
8
|
locust_cloud/web_login.py,sha256=UTwuRJBCkdsGkzHmzwW_s03GKABR22gScq-nBMmqcag,2557
|
8
9
|
locust_cloud/websocket.py,sha256=9Q7nTFuAwVhgW74DlJNcHTZXOQ1drsXi8hX9ciZhWlQ,8998
|
9
10
|
locust_cloud/docs/.gitignore,sha256=ghNPcjYkjQXNS_eVmu2hQFhq6FIUliAD1O2CJhulS2o,10
|
10
|
-
locust_cloud/docs/1-first-run.rst,sha256=
|
11
|
+
locust_cloud/docs/1-first-run.rst,sha256=GfMI2MqMfErhhwVyGt0J3_3w12gK36fXu7Phk9ongew,1638
|
11
12
|
locust_cloud/docs/2-examples.rst,sha256=p3xKYUskgxY6c219Xm_i8iDq_38qyUxmcOSeM9YJqZQ,9715
|
12
13
|
locust_cloud/docs/locust-cloud.rst,sha256=q0WSBOJI0LR3zxuaE9Lor0_bzv4AOKr3aCz9VC6sIzs,137
|
13
14
|
locust_cloud/docs/images/locust-cloud-screenshot.png,sha256=ag0IxBi-40VexC84MApol1GCgRCL2h-l8NQDTMaeTyE,477350
|
14
|
-
locust_cloud-1.21.
|
15
|
-
locust_cloud-1.21.
|
16
|
-
locust_cloud-1.21.
|
17
|
-
locust_cloud-1.21.
|
18
|
-
locust_cloud-1.21.
|
15
|
+
locust_cloud-1.21.6.dist-info/METADATA,sha256=yDiICjpVnqRxkIQYH5DCDIj3M3416rdM-b2DvgM_rmE,783
|
16
|
+
locust_cloud-1.21.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
17
|
+
locust_cloud-1.21.6.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
|
18
|
+
locust_cloud-1.21.6.dist-info/licenses/LICENSE,sha256=Ow6fY6ta4KIjdlWalmxGvRP8yLmetvkbkl-SdHMjPIs,1093
|
19
|
+
locust_cloud-1.21.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|