locust-cloud 1.5.1__py3-none-any.whl → 1.5.2__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/cloud.py CHANGED
@@ -173,6 +173,13 @@ parser.add_argument(
173
173
  action="store_true",
174
174
  help="Delete a running cluster. Useful if locust-cloud was killed/disconnected or if there was an error.",
175
175
  )
176
+ parser.add_argument(
177
+ "--image-tag",
178
+ type=str,
179
+ env_var="LOCUST_CLOUD_IMAGE_TAG",
180
+ default="latest",
181
+ help=configargparse.SUPPRESS, # overrides the locust-cloud docker image tag. for internal use
182
+ )
176
183
 
177
184
  options, locust_options = parser.parse_known_args()
178
185
  options: Namespace
@@ -289,6 +296,7 @@ def main() -> None:
289
296
  *locust_env_variables,
290
297
  ],
291
298
  "worker_count": worker_count,
299
+ "image_tag": options.image_tag,
292
300
  }
293
301
  headers = {
294
302
  "Authorization": f"Bearer {cognito_client_id_token}",
@@ -99,13 +99,15 @@ class Exporter:
99
99
  def write_samples_to_db(self, samples):
100
100
  try:
101
101
  with self.pool.connection() as conn:
102
- conn.cursor().executemany(
103
- """
104
- INSERT INTO requests (time,run_id,greenlet_id,loadgen,name,request_type,response_time,success,response_length,exception,pid,url,context)
105
- VALUES (%(time)s, %(run_id)s, %(greenlet_id)s, %(loadgen)s, %(name)s, %(request_type)s, %(response_time)s, %(success)s, %(response_length)s, %(exception)s, %(pid)s, %(url)s, %(context)s)
106
- """,
107
- samples,
108
- )
102
+ conn: psycopg.connection.Connection
103
+ with conn.cursor() as cur:
104
+ cur.executemany(
105
+ """
106
+ INSERT INTO requests (time,run_id,greenlet_id,loadgen,name,request_type,response_time,success,response_length,exception,pid,url,context)
107
+ VALUES (%(time)s, %(run_id)s, %(greenlet_id)s, %(loadgen)s, %(name)s, %(request_type)s, %(response_time)s, %(success)s, %(response_length)s, %(exception)s, %(pid)s, %(url)s, %(context)s)
108
+ """,
109
+ samples,
110
+ )
109
111
  except psycopg.Error as error:
110
112
  logging.error("Failed to write samples to Postgresql timescale database: " + repr(error))
111
113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: locust-cloud
3
- Version: 1.5.1
3
+ Version: 1.5.2
4
4
  Summary: Locust Cloud
5
5
  Project-URL: Homepage, https://locust.cloud
6
6
  Requires-Python: >=3.11
@@ -1,9 +1,9 @@
1
1
  locust_cloud/__init__.py,sha256=HbH2uFv-zdVS3PeX1D1RmplyXDGe0rWPmVhbQcmJrdY,2613
2
2
  locust_cloud/auth.py,sha256=K57DQ25tfzr97lRbqEH1lz6GITSTXRtXO4JzK4vbVVk,3203
3
- locust_cloud/cloud.py,sha256=mZJxWClcRod596En1vo_rwJAVZ_nWsSY4vmZFR3AAUY,15732
3
+ locust_cloud/cloud.py,sha256=VSXv5EzIIcmkdbMB-YfMIW0fk9EVZooB1vDxvFQURiM,15991
4
4
  locust_cloud/constants.py,sha256=YGgIEnaOT9cAA8F8a8Z8lOmlI78D2fXiVpP0RF213MA,167
5
5
  locust_cloud/credential_manager.py,sha256=JbuS22RTGAmngVB9DFLxHIgaonCSImemMGvtWnxBZRE,5515
6
- locust_cloud/timescale/exporter.py,sha256=iojCxuV9H9yg5O9y3lDdXUq0gOgklUD6JOfV2Pe8hXU,10808
6
+ locust_cloud/timescale/exporter.py,sha256=tx4TPp2gfl0ggA-2CrRTfRlg9ZG1Y31NOXcqiXzqkEw,10921
7
7
  locust_cloud/timescale/queries.py,sha256=TjcmWDB9PZSslnKLbUs3o6R9NZ61zV3BSu36XKNensk,5863
8
8
  locust_cloud/timescale/query.py,sha256=Ab3tAZSAeAH2SPBhreVxCNOiVbpq_eKb5xMiCrlsRwk,2078
9
9
  locust_cloud/webui/.eslintrc,sha256=huuuTZNwbBGkhfelEOMhLQ-tgC9OYnnX0DRYgBn83Ig,1146
@@ -17,7 +17,7 @@ locust_cloud/webui/vite.config.ts,sha256=cqxPMkbwEA3H9mGGbuPulQUhIHCosUqm_1usxzs
17
17
  locust_cloud/webui/yarn.lock,sha256=6BC6sHV1ufQeg1s3HoLHC2SwYs6zEVE-NHVg_1kSuVI,227118
18
18
  locust_cloud/webui/dist/index.html,sha256=ceT6hvFOq5tHWJGjwPVhlfOgvDzj8kJ1SudRmXQBggc,664
19
19
  locust_cloud/webui/dist/assets/index-B-CH83Zq.js,sha256=CbLgdiLRCwxAqGNKyHOQjmll_al3lrXaPPsisboc0S4,2806387
20
- locust_cloud-1.5.1.dist-info/METADATA,sha256=NyeE-MoDvpaTrvkNHs126aNF0v2SN3n1L3Jmdz3eIRs,1663
21
- locust_cloud-1.5.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
22
- locust_cloud-1.5.1.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
23
- locust_cloud-1.5.1.dist-info/RECORD,,
20
+ locust_cloud-1.5.2.dist-info/METADATA,sha256=u1T_pJTb1vBru95DDkZWtOTySjK7WkMgyW7K97ozGKA,1663
21
+ locust_cloud-1.5.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
22
+ locust_cloud-1.5.2.dist-info/entry_points.txt,sha256=PGyAb4e3aTsGS3N3VGShDl6VzJaXy7QwsEgsLOC7V00,57
23
+ locust_cloud-1.5.2.dist-info/RECORD,,