locust-plugins 4.3.1__tar.gz → 4.3.3__tar.gz

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.
Files changed (95) hide show
  1. locust-plugins-4.3.3/.github/workflows/stale.yml +26 -0
  2. {locust-plugins-4.3.1/locust_plugins.egg-info → locust-plugins-4.3.3}/PKG-INFO +3 -3
  3. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/__init__.py +1 -2
  4. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/_version.py +2 -2
  5. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/distributor.py +12 -7
  6. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/listeners/timescale.py +1 -0
  7. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/mongoreader.py +7 -4
  8. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/webdriver.py +2 -1
  9. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/wait_time.py +0 -7
  10. {locust-plugins-4.3.1 → locust-plugins-4.3.3/locust_plugins.egg-info}/PKG-INFO +3 -3
  11. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins.egg-info/SOURCES.txt +1 -0
  12. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins.egg-info/requires.txt +2 -2
  13. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/setup.py +1 -1
  14. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/test/test_cloudwatch_plugin.py +2 -1
  15. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/.github/workflows/tests.yml +0 -0
  16. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/.gitignore +0 -0
  17. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/.pylintrc +0 -0
  18. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/.vscode/launch.json +0 -0
  19. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/.vscode/settings.json +0 -0
  20. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/CONTRIBUTING.md +0 -0
  21. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/LICENSE +0 -0
  22. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/MANIFEST.in +0 -0
  23. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/Makefile +0 -0
  24. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/README.md +0 -0
  25. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/bin/locust-compose +0 -0
  26. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/appinsights_listener_ex.py +0 -0
  27. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/cloudwatch_listener_ex.py +0 -0
  28. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/cmd_line_examples.sh +0 -0
  29. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/connection_pool_ex.py +0 -0
  30. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/constant_total_ips_ex.py +0 -0
  31. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/csvreader_ex.py +0 -0
  32. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/distributor_ex.py +0 -0
  33. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/embedded_resource_manager_ex.py +0 -0
  34. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/jmeter_listener_example.py +0 -0
  35. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/kafka_ex.py +0 -0
  36. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/mongoreader_ex.py +0 -0
  37. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/mqtt_ex.py +0 -0
  38. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/playwright-recording.py +0 -0
  39. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/playwright_ex.py +0 -0
  40. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/products.csv +0 -0
  41. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/reschedule_on_fail_ex.py +0 -0
  42. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/rest_ex.py +0 -0
  43. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/socketio_ex.py +0 -0
  44. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/ssn.csv +0 -0
  45. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/ssn.tsv +0 -0
  46. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/transaction_example.py +0 -0
  47. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/transaction_example_as_library_local.py +0 -0
  48. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/transaction_example_as_library_master.py +0 -0
  49. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/transaction_example_as_library_worker.py +0 -0
  50. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/tsvreader_ex.py +0 -0
  51. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/examples/webdriver_ex.py +0 -0
  52. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/connection_pools.py +0 -0
  53. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/csvreader.py +0 -0
  54. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/Makefile +0 -0
  55. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/README.md +0 -0
  56. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/docker-compose.yml +0 -0
  57. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-grafana/Dockerfile +0 -0
  58. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-grafana/Makefile +0 -0
  59. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-grafana/create_datasource.sh +0 -0
  60. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-grafana/grafana_setup.sh +0 -0
  61. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-grafana/import_dashboards.sh +0 -0
  62. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-timescale/Dockerfile +0 -0
  63. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-timescale/Makefile +0 -0
  64. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-timescale/timescale_schema.sql +0 -0
  65. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/locust-timescale/zz_hypertable.sql +0 -0
  66. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/screenshots/main_dashboard.png +0 -0
  67. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/screenshots/main_dashboard_by_request_graphs.png +0 -0
  68. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/screenshots/requests_table.png +0 -0
  69. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/screenshots/scatter_plot.png +0 -0
  70. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/dashboards/screenshots/testruns.png +0 -0
  71. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/listeners/__init__.py +0 -0
  72. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/listeners/appinsights.py +0 -0
  73. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/listeners/cloudwatch.py +0 -0
  74. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/listeners/jmeter.py +0 -0
  75. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/py.typed +0 -0
  76. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/transaction_manager.py +0 -0
  77. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/__init__.py +0 -0
  78. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/kafka.py +0 -0
  79. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/mqtt.py +0 -0
  80. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/playwright.py +0 -0
  81. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/resource.py +0 -0
  82. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/rest.py +0 -0
  83. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/users/socketio.py +0 -0
  84. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins/utils.py +0 -0
  85. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins.egg-info/dependency_links.txt +0 -0
  86. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins.egg-info/not-zip-safe +0 -0
  87. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/locust_plugins.egg-info/top_level.txt +0 -0
  88. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/mypy.ini +0 -0
  89. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/pyproject.toml +0 -0
  90. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/setup.cfg +0 -0
  91. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/test/test.csv +0 -0
  92. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/test/test_all.py +0 -0
  93. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/test/test_missing_extras.py +0 -0
  94. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/tox.ini +0 -0
  95. {locust-plugins-4.3.1 → locust-plugins-4.3.3}/tusk.yaml +0 -0
@@ -0,0 +1,26 @@
1
+ name: Mark stale issues
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "30 1 * * *"
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ stale:
13
+ permissions:
14
+ issues: write # for actions/stale to close stale issues
15
+ pull-requests: write # for actions/stale to close stale PRs
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/stale@v3
20
+ with:
21
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
22
+ stale-issue-message: "This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days."
23
+ close-issue-message: "This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!"
24
+ stale-pr-message: "This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days."
25
+ close-pr-message: "This PR was closed because it has been stalled for 10 days with no activity."
26
+ days-before-close: 10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: locust-plugins
3
- Version: 4.3.1
3
+ Version: 4.3.3
4
4
  Summary: Useful plugins/extensions for Locust
5
5
  Home-page: https://github.com/SvenskaSpel/locust-plugins
6
6
  Author: Lars Holmberg
@@ -26,7 +26,7 @@ Requires-Dist: typing-extensions
26
26
  Provides-Extra: websocket
27
27
  Requires-Dist: websocket-client; extra == "websocket"
28
28
  Provides-Extra: playwright
29
- Requires-Dist: playwright>=1.34.0; extra == "playwright"
29
+ Requires-Dist: playwright>=1.40.0; extra == "playwright"
30
30
  Provides-Extra: dashboards
31
31
  Requires-Dist: psycogreen; extra == "dashboards"
32
32
  Requires-Dist: psycopg2-binary; extra == "dashboards"
@@ -44,7 +44,7 @@ Provides-Extra: boto3
44
44
  Requires-Dist: boto3; extra == "boto3"
45
45
  Provides-Extra: all
46
46
  Requires-Dist: websocket-client; extra == "all"
47
- Requires-Dist: playwright>=1.34.0; extra == "all"
47
+ Requires-Dist: playwright>=1.40.0; extra == "all"
48
48
  Requires-Dist: psycogreen; extra == "all"
49
49
  Requires-Dist: psycopg2-binary; extra == "all"
50
50
  Requires-Dist: confluent-kafka; extra == "all"
@@ -1,4 +1,4 @@
1
- from .wait_time import constant_ips, constant_total_ips
1
+ from .wait_time import constant_total_ips
2
2
  import locust
3
3
  from locust.user.task import DefaultTaskSet, TaskSet
4
4
  from locust import events
@@ -258,7 +258,6 @@ def do_checks(environment, **_kw):
258
258
 
259
259
 
260
260
  def missing_extra(package, extra):
261
- traceback.print_exc()
262
261
  logging.error(
263
262
  f"'{package}' is not installed by default, you need to install it using 'pip install locust-plugins[{extra}]'"
264
263
  )
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '4.3.1'
16
- __version_tuple__ = version_tuple = (4, 3, 1)
15
+ __version__ = version = '4.3.3'
16
+ __version_tuple__ = version_tuple = (4, 3, 3)
@@ -2,13 +2,14 @@ from typing import Dict, Iterator, Optional
2
2
  import logging
3
3
  from gevent.event import AsyncResult
4
4
  import greenlet
5
+ import gevent
5
6
  from locust.env import Environment
6
7
  from locust.runners import WorkerRunner
7
8
 
8
9
  _results: Dict[int, AsyncResult] = {}
9
10
 
10
11
 
11
- class Distributor:
12
+ class Distributor(Iterator):
12
13
  def __init__(self, environment: Environment, iterator: Optional[Iterator], name="distributor"):
13
14
  """Register distributor method handlers and tie them to use the iterator that you pass.
14
15
 
@@ -23,12 +24,8 @@ class Distributor:
23
24
  if self.runner:
24
25
  # received on master
25
26
  def _distributor_request(environment: Environment, msg, **kwargs):
26
- item = next(self.iterator)
27
- self.runner.send_message(
28
- f"_{name}_response",
29
- {"item": item, "gid": msg.data["gid"]},
30
- client_id=msg.data["client_id"],
31
- )
27
+ # do this in the background to avoid blocking locust's client_listener loop
28
+ gevent.spawn(self._master_next_and_send, msg.data["gid"], msg.data["client_id"])
32
29
 
33
30
  # received on worker
34
31
  def _distributor_response(environment: Environment, msg, **kwargs):
@@ -37,6 +34,14 @@ class Distributor:
37
34
  self.runner.register_message(f"_{name}_request", _distributor_request)
38
35
  self.runner.register_message(f"_{name}_response", _distributor_response)
39
36
 
37
+ def _master_next_and_send(self, gid, client_id):
38
+ item = next(self.iterator)
39
+ self.runner.send_message(
40
+ f"_{self.name}_response",
41
+ {"item": item, "gid": gid},
42
+ client_id=client_id,
43
+ )
44
+
40
45
  def __next__(self):
41
46
  """Get the next data dict from iterator
42
47
 
@@ -1,3 +1,4 @@
1
+ # See timescale_listener_ex.py for documentation
1
2
  from contextlib import contextmanager
2
3
  from locust.exception import CatchResponseError # need to do this first to make sure monkey patching is done
3
4
  import json
@@ -34,9 +34,12 @@ class MongoLRUReader(Iterator[Dict]):
34
34
 
35
35
  """
36
36
  self.timestamp_field = timestamp_field
37
- self.coll: Collection = (
38
- coll or MongoClient(env["LOCUST_MONGO"])[env["LOCUST_MONGO_DATABASE"]][env["LOCUST_MONGO_COLLECTION"]]
39
- )
37
+ if not coll:
38
+ self.coll: Collection = MongoClient(env["LOCUST_MONGO"])[env["LOCUST_MONGO_DATABASE"]][
39
+ env["LOCUST_MONGO_COLLECTION"]
40
+ ]
41
+ else:
42
+ self.coll = coll
40
43
  self.cursor: Cursor = self.coll.find(filter, sort=[(self.timestamp_field, 1)])
41
44
  records_in_buffer = self.cursor._refresh() # trigger fetch immediately instead of waiting for the first next()
42
45
  if not records_in_buffer:
@@ -46,7 +49,7 @@ class MongoLRUReader(Iterator[Dict]):
46
49
  try:
47
50
  with dblock:
48
51
  doc: dict = next(self.cursor)
49
- self.coll.find_one_and_update(
52
+ self.coll.update_one(
50
53
  {"_id": doc["_id"]},
51
54
  {"$set": {self.timestamp_field: datetime.now(tz=timezone.utc)}},
52
55
  )
@@ -27,7 +27,8 @@ class WebdriverClient(webdriver.Remote):
27
27
  def __init__(self, user: User):
28
28
  self.user = user
29
29
  options = Options()
30
- options.headless = self.user.headless
30
+ if self.user.headless:
31
+ options.add_argument("--headless")
31
32
  for arg in [
32
33
  "--disable-translate",
33
34
  "--disable-extensions",
@@ -1,4 +1,3 @@
1
- import sys
2
1
  import logging
3
2
  import time
4
3
  from collections import deque, namedtuple
@@ -57,11 +56,5 @@ def constant_total_ips(ips: float):
57
56
  return func
58
57
 
59
58
 
60
- def constant_ips(_ips):
61
- """this function has been removed, now that it is available in locust.wait_time.constant_throughput"""
62
- logging.error("constant_ips has been removed, now that it is available in locust.wait_time.constant_throughput")
63
- sys.exit(1)
64
-
65
-
66
59
  def constant_total_pacing(seconds: float):
67
60
  return constant_total_ips(1.0 / seconds)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: locust-plugins
3
- Version: 4.3.1
3
+ Version: 4.3.3
4
4
  Summary: Useful plugins/extensions for Locust
5
5
  Home-page: https://github.com/SvenskaSpel/locust-plugins
6
6
  Author: Lars Holmberg
@@ -26,7 +26,7 @@ Requires-Dist: typing-extensions
26
26
  Provides-Extra: websocket
27
27
  Requires-Dist: websocket-client; extra == "websocket"
28
28
  Provides-Extra: playwright
29
- Requires-Dist: playwright>=1.34.0; extra == "playwright"
29
+ Requires-Dist: playwright>=1.40.0; extra == "playwright"
30
30
  Provides-Extra: dashboards
31
31
  Requires-Dist: psycogreen; extra == "dashboards"
32
32
  Requires-Dist: psycopg2-binary; extra == "dashboards"
@@ -44,7 +44,7 @@ Provides-Extra: boto3
44
44
  Requires-Dist: boto3; extra == "boto3"
45
45
  Provides-Extra: all
46
46
  Requires-Dist: websocket-client; extra == "all"
47
- Requires-Dist: playwright>=1.34.0; extra == "all"
47
+ Requires-Dist: playwright>=1.40.0; extra == "all"
48
48
  Requires-Dist: psycogreen; extra == "all"
49
49
  Requires-Dist: psycopg2-binary; extra == "all"
50
50
  Requires-Dist: confluent-kafka; extra == "all"
@@ -10,6 +10,7 @@ pyproject.toml
10
10
  setup.py
11
11
  tox.ini
12
12
  tusk.yaml
13
+ .github/workflows/stale.yml
13
14
  .github/workflows/tests.yml
14
15
  .vscode/launch.json
15
16
  .vscode/settings.json
@@ -3,7 +3,7 @@ typing-extensions
3
3
 
4
4
  [all]
5
5
  websocket-client
6
- playwright>=1.34.0
6
+ playwright>=1.40.0
7
7
  psycogreen
8
8
  psycopg2-binary
9
9
  confluent-kafka
@@ -33,7 +33,7 @@ pymongo
33
33
  paho-mqtt>=1.5.0
34
34
 
35
35
  [playwright]
36
- playwright>=1.34.0
36
+ playwright>=1.40.0
37
37
 
38
38
  [resource]
39
39
  lxml
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
6
6
 
7
7
  extras = {
8
8
  "websocket": ["websocket-client"],
9
- "playwright": ["playwright>=1.34.0"],
9
+ "playwright": ["playwright>=1.40.0"],
10
10
  "dashboards": ["psycogreen", "psycopg2-binary"],
11
11
  "kafka": ["confluent-kafka"],
12
12
  "mongo": ["pymongo"],
@@ -10,12 +10,12 @@ from unittest import TestCase
10
10
 
11
11
  setup_logging("INFO", None)
12
12
 
13
+
13
14
  class CloudwatchMock:
14
15
  def __init__(self):
15
16
  self.call_count = 0
16
17
  self.metrics_dict = {}
17
18
 
18
-
19
19
  def put_metric_data(self, Namespace, MetricData):
20
20
  self.call_count += 1
21
21
  self.metrics_dict[Namespace] = MetricData
@@ -23,6 +23,7 @@ class CloudwatchMock:
23
23
 
24
24
  cw = CloudwatchMock()
25
25
 
26
+
26
27
  def on_locust_init(environment, **_kwargs):
27
28
  CloudwatchAdapter(environment, "MyExampleService", "perf", cw)
28
29
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes