locust 2.38.2.dev7__tar.gz → 2.39.1.dev1__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 (64) hide show
  1. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/PKG-INFO +3 -1
  2. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/_version.py +2 -2
  3. locust-2.39.1.dev1/locust/contrib/__init__.py +5 -0
  4. locust-2.39.1.dev1/locust/contrib/socketio.py +95 -0
  5. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/pyproject.toml +6 -0
  6. locust-2.38.2.dev7/locust/util/__init__.py +0 -0
  7. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/.gitignore +0 -0
  8. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/LICENSE +0 -0
  9. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/README.md +0 -0
  10. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/hatch_build.py +0 -0
  11. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/__init__.py +0 -0
  12. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/__main__.py +0 -0
  13. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/argument_parser.py +0 -0
  14. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/clients.py +0 -0
  15. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/contrib/fasthttp.py +0 -0
  16. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/contrib/milvus.py +0 -0
  17. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/contrib/mongodb.py +0 -0
  18. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/contrib/oai.py +0 -0
  19. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/contrib/postgres.py +0 -0
  20. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/debug.py +0 -0
  21. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/dispatch.py +0 -0
  22. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/env.py +0 -0
  23. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/event.py +0 -0
  24. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/exception.py +0 -0
  25. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/html.py +0 -0
  26. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/input_events.py +0 -0
  27. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/log.py +0 -0
  28. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/main.py +0 -0
  29. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/py.typed +0 -0
  30. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/rpc/__init__.py +0 -0
  31. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/rpc/protocol.py +0 -0
  32. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/rpc/zmqrpc.py +0 -0
  33. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/runners.py +0 -0
  34. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/shape.py +0 -0
  35. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/stats.py +0 -0
  36. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/__init__.py +0 -0
  37. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/inspectuser.py +0 -0
  38. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/markov_taskset.py +0 -0
  39. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/sequential_taskset.py +0 -0
  40. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/task.py +0 -0
  41. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/users.py +0 -0
  42. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/user/wait_time.py +0 -0
  43. {locust-2.38.2.dev7/locust/contrib → locust-2.39.1.dev1/locust/util}/__init__.py +0 -0
  44. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/cache.py +0 -0
  45. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/date.py +0 -0
  46. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/deprecation.py +0 -0
  47. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/directory.py +0 -0
  48. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/exception_handler.py +0 -0
  49. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/load_locustfile.py +0 -0
  50. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/rounding.py +0 -0
  51. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/timespan.py +0 -0
  52. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/util/url.py +0 -0
  53. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/web.py +0 -0
  54. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/favicon-dark.png +0 -0
  55. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/favicon-light.png +0 -0
  56. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/graphs-dark.png +0 -0
  57. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/graphs-light.png +0 -0
  58. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/index-BjqxSg7R.js +0 -0
  59. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/terminal.gif +0 -0
  60. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/testruns-dark.png +0 -0
  61. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/assets/testruns-light.png +0 -0
  62. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/auth.html +0 -0
  63. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/index.html +0 -0
  64. {locust-2.38.2.dev7 → locust-2.39.1.dev1}/locust/webui/dist/report.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust
3
- Version: 2.38.2.dev7
3
+ Version: 2.39.1.dev1
4
4
  Summary: Developer-friendly load testing framework
5
5
  Project-URL: homepage, https://locust.io/
6
6
  Project-URL: repository, https://github.com/locustio/locust
@@ -33,6 +33,8 @@ Requires-Dist: geventhttpclient>=2.3.1
33
33
  Requires-Dist: locust-cloud>=1.26.3
34
34
  Requires-Dist: msgpack>=1.0.0
35
35
  Requires-Dist: psutil>=5.9.1
36
+ Requires-Dist: python-engineio>=4.12.2
37
+ Requires-Dist: python-socketio[client]>=5.13.0
36
38
  Requires-Dist: pywin32; sys_platform == 'win32'
37
39
  Requires-Dist: pyzmq>=25.0.0
38
40
  Requires-Dist: requests>=2.26.0; python_version <= '3.11'
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '2.38.2.dev7'
32
- __version_tuple__ = version_tuple = (2, 38, 2, 'dev7')
31
+ __version__ = version = '2.39.1.dev1'
32
+ __version_tuple__ = version_tuple = (2, 39, 1, 'dev1')
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -0,0 +1,5 @@
1
+ # This directory contains modules that are experimental.
2
+
3
+ # Generally they should not have any significant issues, but they may change without a major version bump for locust.
4
+
5
+ # Some modules may require optional dependencies, typically installed with `pip install locust[name-of-module]`.
@@ -0,0 +1,95 @@
1
+ from locust import User
2
+
3
+ import gevent
4
+ import socketio
5
+
6
+
7
+ class SocketIOUser(User):
8
+ """
9
+ SocketIOUser wraps an instance of :class:`socketio.Client` to log requests.
10
+ See example in :gh:`examples/socketio/socketio_ex.py`.
11
+ """
12
+
13
+ abstract = True
14
+ options: dict = {}
15
+ """socketio.Client options, e.g. `{"reconnection_attempts": 1, "reconnection_delay": 2}`"""
16
+ client: socketio.Client
17
+ """The underlying :class:`socketio.Client` instance. Can be useful to call directly if you want to skip logging a requests."""
18
+
19
+ def __init__(self, *args, **kwargs):
20
+ super().__init__(*args, **kwargs)
21
+ self.client = socketio.Client(**self.options)
22
+ self.ws_greenlet = gevent.spawn(self.client.wait)
23
+ self.client.on("*", self.on_message)
24
+
25
+ #
26
+ def on_message(self, event: str, data: str) -> None:
27
+ """
28
+ This is the default handler for events. You can override it for custom behavior,
29
+ or even register separate handlers using self.client.on(event, handler)
30
+
31
+ Measuring response_time isn't obvious for for WebSockets. Sometimes a response time
32
+ can be inferred from the event data (if it contains a timestamp) or related to
33
+ a message that you sent. Override this method in your User class to do that.
34
+ """
35
+ self.environment.events.request.fire(
36
+ request_type="WSR",
37
+ name=event,
38
+ response_time=0,
39
+ response_length=len(data or []),
40
+ exception=None,
41
+ context={},
42
+ )
43
+
44
+ def connect(self, *args, **kwargs):
45
+ """
46
+ Wraps :meth:`socketio.Client.connect`.
47
+ """
48
+ with self.environment.events.request.measure("WS", "connect") as _:
49
+ self.client.connect(*args, **kwargs)
50
+
51
+ def send(self, name, data=None, namespace=None) -> None:
52
+ """
53
+ Wraps :meth:`socketio.Client.send`.
54
+ """
55
+ exception = None
56
+ try:
57
+ self.client.send(data, namespace)
58
+ except Exception as e:
59
+ exception = e
60
+ self.environment.events.request.fire(
61
+ request_type="WSS",
62
+ name=name,
63
+ response_time=0,
64
+ response_length=len(data or []),
65
+ exception=exception,
66
+ context={},
67
+ )
68
+
69
+ def emit(self, name, data=None, namespace=None, callback=None) -> None:
70
+ """
71
+ Wraps :meth:`socketio.Client.emit`.
72
+ """
73
+ exception = None
74
+ try:
75
+ self.client.emit(name, data, namespace, callback)
76
+ except Exception as e:
77
+ exception = e
78
+ self.environment.events.request.fire(
79
+ request_type="WSE",
80
+ name=name,
81
+ response_time=0,
82
+ response_length=len(data or []),
83
+ exception=exception,
84
+ context={},
85
+ )
86
+
87
+ def call(self, event, data=None, *args, **kwargs):
88
+ """
89
+ Wraps :meth:`socketio.Client.call`.
90
+ """
91
+ with self.environment.events.request.measure("WSC", event) as _:
92
+ return self.client.call(event, data, *args, **kwargs)
93
+
94
+ def on_stop(self):
95
+ self.client.disconnect()
@@ -50,6 +50,8 @@ dependencies = [
50
50
  "setuptools>=70.0.0",
51
51
  "locust-cloud>=1.26.3",
52
52
  "gevent>=24.10.1,<26.0.0",
53
+ "python-socketio[client]>=5.13.0",
54
+ "python-engineio>=4.12.2",
53
55
  ]
54
56
 
55
57
  [project.optional-dependencies]
@@ -100,6 +102,10 @@ docs = [
100
102
  "sphinxcontrib-qthelp==1.0.3",
101
103
  "sphinxcontrib-serializinghtml==1.1.10",
102
104
  "sphinxcontrib-googleanalytics>=0.4",
105
+ # these optional dependencies are needed to build the some contrib modules
106
+ "pymilvus>=2.5.0",
107
+ "psycopg[binary]>=3.2.1",
108
+ "pymongo>=4.8.0"
103
109
  ]
104
110
  milvus = [
105
111
  "pymilvus>=2.5.0",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes