locust-cloud 1.0.5__py3-none-any.whl → 1.0.7__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/__init__.py CHANGED
@@ -12,6 +12,8 @@ PG_PASSWORD = os.environ.get("PG_PASSWORD")
12
12
  PG_DATABASE = os.environ.get("PG_DATABASE")
13
13
  PG_PORT = os.environ.get("PG_PORT", 5432)
14
14
 
15
+ os.environ["LOCUST_BUILD_PATH"] = os.path.join(os.path.dirname(__file__), "webui/dist")
16
+
15
17
 
16
18
  @events.init_command_line_parser.add_listener
17
19
  def add_arguments(parser: LocustArgumentParser):
@@ -38,8 +40,6 @@ def add_arguments(parser: LocustArgumentParser):
38
40
 
39
41
  @events.init.add_listener
40
42
  def on_locust_init(environment, **args):
41
- os.environ["LOCUST_BUILD_PATH"] = os.path.join(os.path.dirname(__file__), "webui/dist")
42
-
43
43
  if environment.parsed_options.exporter:
44
44
  Timescale(
45
45
  environment,
locust_cloud/cloud.py CHANGED
@@ -15,6 +15,7 @@ from botocore.exceptions import ClientError
15
15
  LAMBDA = "https://deployer.locust.cloud/1"
16
16
  DEFAULT_CLUSTER_NAME = "locust"
17
17
  DEFAULT_REGION_NAME = "eu-north-1"
18
+ LOCUST_ENV_VARIABLE_IGNORE_LIST = ["LOCUST_BUILD_PATH", "LOCUST_SKIP_MONKEY_PATCH"]
18
19
 
19
20
 
20
21
  class LocustTomlConfigParser(configargparse.TomlConfigParser):
@@ -275,7 +276,7 @@ def deploy(
275
276
  locust_env_variables = [
276
277
  {"name": env_variable, "value": str(os.environ[env_variable])}
277
278
  for env_variable in os.environ
278
- if env_variable.startswith("LOCUST_")
279
+ if env_variable.startswith("LOCUST_") and env_variable not in LOCUST_ENV_VARIABLE_IGNORE_LIST
279
280
  ]
280
281
 
281
282
  response = requests.post(
@@ -25,7 +25,7 @@ def safe_serialize(obj):
25
25
  class Timescale:
26
26
  def __init__(self, environment: locust.env.Environment, pg_user, pg_host, pg_password, pg_database, pg_port):
27
27
  self.env = environment
28
- self._run_id = ""
28
+ self._run_id = None
29
29
  self._samples: list[dict] = []
30
30
  self._background = gevent.spawn(self._run)
31
31
  self._hostname = socket.gethostname()
@@ -75,7 +75,7 @@ class Timescale:
75
75
 
76
76
  def on_test_start(self, environment: locust.env.Environment):
77
77
  if not self.env.parsed_options or not self.env.parsed_options.worker:
78
- environment._run_id = datetime.now(UTC) # type: ignore
78
+ self._run_id = environment._run_id = datetime.now(UTC) # type: ignore
79
79
  msg = environment._run_id.strftime("%Y-%m-%d, %H:%M:%S.%f") # type: ignore
80
80
  if environment.runner is not None:
81
81
  logging.debug(f"about to send run_id to workers: {msg}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: locust-cloud
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: Locust Cloud
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: blessed==1.20.0
@@ -1,7 +1,7 @@
1
- locust_cloud/__init__.py,sha256=JNMaCykjuDy6HQoqokF-nr6gZegFXZy0Le12W8HILnQ,1484
1
+ locust_cloud/__init__.py,sha256=ZpA79bNf7scS9qM45j7YNHRYQqAd9MzrQKreYU0OmzE,1480
2
2
  locust_cloud/auth.py,sha256=5cIhUgaENeYSe_GxNp3v7rLhB4_Pj9URFrLYYsRG-n8,3042
3
- locust_cloud/cloud.py,sha256=hsnLCjY_9WwgYu8uH_1p8zgPKUX-w7-ERhwuC6ErgEM,12584
4
- locust_cloud/timescale/exporter.py,sha256=jxLeRa_rAbzsO36mXKviOUsUyGCoS0dbd0PuvLsBUF4,11111
3
+ locust_cloud/cloud.py,sha256=_TnyFaQG4rhd4msIs2I6QhAWOUDeRmcZXGzH4cEx2aI,12724
4
+ locust_cloud/timescale/exporter.py,sha256=j1K-czMUdOLFt5Sop0PTF6TL52vYdngEEI5OEM3Xl60,11128
5
5
  locust_cloud/webui/.eslintrc,sha256=huuuTZNwbBGkhfelEOMhLQ-tgC9OYnnX0DRYgBn83Ig,1146
6
6
  locust_cloud/webui/.gitignore,sha256=i8EHIqDlVm1-Dkvf_GTZmP_Wu99GE7ABfbYzHXOU734,54
7
7
  locust_cloud/webui/.prettierrc,sha256=qZpzAJPlHUQ3--NHYK8WXgc_TlIqq-eoz4pbkTKK3nk,167
@@ -13,7 +13,7 @@ locust_cloud/webui/vite.config.ts,sha256=cqxPMkbwEA3H9mGGbuPulQUhIHCosUqm_1usxzs
13
13
  locust_cloud/webui/yarn.lock,sha256=yysZ-wROYB43fp1k_YC4zhLBjJKWr3_C6vKWM4rx0b4,216553
14
14
  locust_cloud/webui/dist/index.html,sha256=WiAeD-vj6jDZ1Q3-odnAPyM9hmc5pT6gvcq9YI65U9o,664
15
15
  locust_cloud/webui/dist/assets/index-CCS97q-k.js,sha256=3-KSz2kFRL7YG3rMB1dUCffEByaK7Zny5cuzxSgn5x8,2795908
16
- locust_cloud-1.0.5.dist-info/METADATA,sha256=BLFEOcOxxPUE377hgX5Z7LVC6suYR7rwtJVlQaF8kEI,2162
17
- locust_cloud-1.0.5.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
18
- locust_cloud-1.0.5.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
19
- locust_cloud-1.0.5.dist-info/RECORD,,
16
+ locust_cloud-1.0.7.dist-info/METADATA,sha256=zo39FGyY4bMlOwy7NW2aka7J-oo3H-tRhqDdqKxZ7aM,2162
17
+ locust_cloud-1.0.7.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
18
+ locust_cloud-1.0.7.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
19
+ locust_cloud-1.0.7.dist-info/RECORD,,