locust-cloud 1.21.10.dev1__py3-none-any.whl → 1.21.10.dev4__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/args.py CHANGED
@@ -230,6 +230,14 @@ cloud_parser.add_argument(
230
230
  default=None,
231
231
  help=configargparse.SUPPRESS, # overrides the locust-cloud docker image tag. for internal use
232
232
  )
233
+ cloud_parser.add_argument(
234
+ "--local-instance",
235
+ action="store_true",
236
+ default=False,
237
+ help=configargparse.SUPPRESS,
238
+ # for internal use. Assumes you've started locust/exporter with something like:
239
+ # LOCUSTCLOUD_SESSION_ID=valid-session-id LOCUST_WEB_LOGIN=1 LOCUST_LOGLEVEL=DEBUG python -m bootstrap
240
+ )
233
241
  cloud_parser.add_argument(
234
242
  "--mock-server",
235
243
  action="store_true",
locust_cloud/cloud.py CHANGED
@@ -106,6 +106,14 @@ def main():
106
106
  payload["extra_packages"] = options.extra_packages
107
107
 
108
108
  for attempt in range(1, 16):
109
+ if options.local_instance:
110
+ response = requests.Response()
111
+ response.status_code = 200
112
+ js = {
113
+ "log_ws_url": f"ws://localhost:1095{os.environ.get('LOCUST_WEB_BASE_PATH', '')}/socket-logs",
114
+ "session_id": "valid-session-id",
115
+ }
116
+ break
109
117
  try:
110
118
  response = session.post("/deploy", json=payload)
111
119
  js = response.json()
@@ -154,7 +162,10 @@ def main():
154
162
 
155
163
  except KeyboardInterrupt:
156
164
  logger.debug("Interrupted by user")
157
- delete(session)
165
+ if options.local_instance:
166
+ os.system("pkill -TERM -f bootstrap")
167
+ else:
168
+ delete(session)
158
169
  try:
159
170
  websocket.wait(timeout=True)
160
171
  except (WebsocketTimeout, SessionMismatchError) as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust-cloud
3
- Version: 1.21.10.dev1
3
+ Version: 1.21.10.dev4
4
4
  Summary: Locust Cloud
5
5
  Project-URL: homepage, https://locust.cloud
6
6
  Project-URL: repository, https://github.com/locustcloud/locust-cloud
@@ -1,8 +1,8 @@
1
1
  locust_cloud/__init__.py,sha256=6z2hE5rUP9WJyYgr-7XC2GhIV-05m8XxjOsnb8ae1WY,56
2
2
  locust_cloud/actions.py,sha256=lMxKZCwfcsbYf9t5ti20QP60gKt8HHwyz8yjYm0H-a8,762
3
3
  locust_cloud/apisession.py,sha256=JkXiGEtJCBxOW11P0KGr0AUc_AmfqAlO5SijC0zf85w,4368
4
- locust_cloud/args.py,sha256=KqVOQ8IJE4XR31ulsq0sPkS77yWeZc_Gc1Vm_NLJPPw,10668
5
- locust_cloud/cloud.py,sha256=Djj2NJ0ZahPdY4LR4uhtYfWE6PrlcqGJP-wQfofvNr4,5686
4
+ locust_cloud/args.py,sha256=Kr1plMq79KGni3xogmY1FBe6qtdvncM3CJ8in2HijAk,10990
5
+ locust_cloud/cloud.py,sha256=LhPpn_6n59ofAFNj5NgxJ6KpUH6MvBdV6qktE0WjR-0,6149
6
6
  locust_cloud/common.py,sha256=GVKkWcbbqd9n8oU-fHZRVZw3jGtuIVGSCLD2ZizeEo0,1160
7
7
  locust_cloud/input_events.py,sha256=MyxccgboHByICuK6VpQCCJhZQqTZAacNmkSpw-gxBEw,3420
8
8
  locust_cloud/web_login.py,sha256=2RC2NHczVdlz2bzmcPDDOR5UbL5ymBK2DUeo_5V6gY0,2553
@@ -12,8 +12,8 @@ locust_cloud/docs/1-first-run.rst,sha256=4CyEoreZfbuon30bRocx7mmKWEso-pVQeWqPiRW
12
12
  locust_cloud/docs/2-examples.rst,sha256=45s-gwExNwzbmpzleUENZK4WuHBO7fJ_lGzeukQdWrg,10128
13
13
  locust_cloud/docs/locust-cloud.rst,sha256=KwolrGHH4RtU7VvzO6-QRAJu-ekPPR6XVzdf8i9qZGM,156
14
14
  locust_cloud/docs/images/locust-cloud-screenshot.png,sha256=ag0IxBi-40VexC84MApol1GCgRCL2h-l8NQDTMaeTyE,477350
15
- locust_cloud-1.21.10.dev1.dist-info/METADATA,sha256=sBOwaJ1giiNNpLWsmPG38J-FoPFTe7WChRBIVDRy-K0,789
16
- locust_cloud-1.21.10.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- locust_cloud-1.21.10.dev1.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
18
- locust_cloud-1.21.10.dev1.dist-info/licenses/LICENSE,sha256=Ow6fY6ta4KIjdlWalmxGvRP8yLmetvkbkl-SdHMjPIs,1093
19
- locust_cloud-1.21.10.dev1.dist-info/RECORD,,
15
+ locust_cloud-1.21.10.dev4.dist-info/METADATA,sha256=WEjPThvzgtWgUgBe6ue-X9xbyxpLHz0o3gjOFsqOqaE,789
16
+ locust_cloud-1.21.10.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ locust_cloud-1.21.10.dev4.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
18
+ locust_cloud-1.21.10.dev4.dist-info/licenses/LICENSE,sha256=Ow6fY6ta4KIjdlWalmxGvRP8yLmetvkbkl-SdHMjPIs,1093
19
+ locust_cloud-1.21.10.dev4.dist-info/RECORD,,