locust 2.43.4.dev25__tar.gz → 2.43.4.dev33__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.
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/PKG-INFO +1 -1
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/_version.py +2 -2
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/task.py +2 -1
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/users.py +2 -1
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/wait_time.py +11 -8
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/.gitignore +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/LICENSE +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/README.md +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/hatch_build.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/__init__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/__main__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/argument_parser.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/clients.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/__init__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/dns.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/fasthttp.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/milvus.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/mongodb.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/mqtt.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/oai.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/postgres.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/qdrant.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/contrib/socketio.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/debug.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/dispatch.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/env.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/event.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/exception.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/html.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/input_events.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/log.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/main.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/opentelemetry.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/py.typed +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/rpc/__init__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/rpc/protocol.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/rpc/zmqrpc.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/runners.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/shape.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/stats.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/__init__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/inspectuser.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/markov_taskset.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/user/sequential_taskset.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/__init__.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/cache.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/date.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/deprecation.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/directory.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/exception_handler.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/load_locustfile.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/rounding.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/timespan.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/util/url.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/web.py +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/favicon-dark.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/favicon-light.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/graphs-dark.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/graphs-light.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/index-Bl8icIRq.js +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/terminal.gif +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/testruns-dark.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/assets/testruns-light.png +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/auth.html +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/index.html +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/locust/webui/dist/report.html +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/pyproject.toml +0 -0
- {locust-2.43.4.dev25 → locust-2.43.4.dev33}/pytest_locust/plugin.py +0 -0
|
@@ -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.43.4.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 43, 4, '
|
|
31
|
+
__version__ = version = '2.43.4.dev33'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 43, 4, 'dev33')
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -316,7 +316,8 @@ class TaskSet(metaclass=TaskSetMeta):
|
|
|
316
316
|
self.max_wait = self.user.max_wait
|
|
317
317
|
if not self.wait_function:
|
|
318
318
|
self.wait_function = self.user.wait_function
|
|
319
|
-
self._cp_last_run = time() # used by constant_pacing wait_time
|
|
319
|
+
self._cp_last_run: float = time() # used by constant_pacing wait_time
|
|
320
|
+
self._cp_last_wait_time: float = 0 # used by constant_pacing wait_time
|
|
320
321
|
|
|
321
322
|
@property
|
|
322
323
|
def user(self) -> User:
|
|
@@ -136,7 +136,8 @@ class User(metaclass=UserMeta):
|
|
|
136
136
|
self._greenlet: greenlet.Greenlet | None = None
|
|
137
137
|
self._group: Group
|
|
138
138
|
self._taskset_instance: TaskSet | None = None
|
|
139
|
-
self._cp_last_run = time.time() # used by constant_pacing wait_time
|
|
139
|
+
self._cp_last_run: float = time.time() # used by constant_pacing wait_time
|
|
140
|
+
self._cp_last_wait_time: float = 0 # used by constant_pacing wait_time
|
|
140
141
|
|
|
141
142
|
def on_start(self) -> None:
|
|
142
143
|
"""
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import random
|
|
2
|
+
from collections.abc import Callable
|
|
2
3
|
from time import time
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
3
5
|
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from locust import User
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
|
|
10
|
+
def between(min_wait: float, max_wait: float) -> Callable[["User"], float]:
|
|
6
11
|
"""
|
|
7
12
|
Returns a function that will return a random number between min_wait and max_wait.
|
|
8
13
|
|
|
@@ -15,7 +20,7 @@ def between(min_wait, max_wait):
|
|
|
15
20
|
return lambda instance: min_wait + random.random() * (max_wait - min_wait)
|
|
16
21
|
|
|
17
22
|
|
|
18
|
-
def constant(wait_time):
|
|
23
|
+
def constant(wait_time: float) -> Callable[["User"], float]:
|
|
19
24
|
"""
|
|
20
25
|
Returns a function that just returns the number specified by the wait_time argument
|
|
21
26
|
|
|
@@ -27,7 +32,7 @@ def constant(wait_time):
|
|
|
27
32
|
return lambda instance: wait_time
|
|
28
33
|
|
|
29
34
|
|
|
30
|
-
def constant_pacing(wait_time):
|
|
35
|
+
def constant_pacing(wait_time: float) -> Callable[["User"], float]:
|
|
31
36
|
"""
|
|
32
37
|
Returns a function that will track the run time of the tasks, and for each time it's
|
|
33
38
|
called it will return a wait time that will try to make the total time between task
|
|
@@ -46,10 +51,8 @@ def constant_pacing(wait_time):
|
|
|
46
51
|
the next task.
|
|
47
52
|
"""
|
|
48
53
|
|
|
49
|
-
def wait_time_func(self):
|
|
50
|
-
|
|
51
|
-
self._cp_last_wait_time = 0
|
|
52
|
-
run_time = time() - self._cp_last_run - self._cp_last_wait_time
|
|
54
|
+
def wait_time_func(self: "User") -> float:
|
|
55
|
+
run_time: float = time() - self._cp_last_run - self._cp_last_wait_time
|
|
53
56
|
self._cp_last_wait_time = max(0, wait_time - run_time)
|
|
54
57
|
self._cp_last_run = time()
|
|
55
58
|
return self._cp_last_wait_time
|
|
@@ -57,7 +60,7 @@ def constant_pacing(wait_time):
|
|
|
57
60
|
return wait_time_func
|
|
58
61
|
|
|
59
62
|
|
|
60
|
-
def constant_throughput(task_runs_per_second):
|
|
63
|
+
def constant_throughput(task_runs_per_second: float) -> Callable[["User"], float]:
|
|
61
64
|
"""
|
|
62
65
|
Returns a function that will track the run time of the tasks, and for each time it's
|
|
63
66
|
called it will return a wait time that will try to make the number of task runs per second
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|