API
HttpUser
Bases: User
Source code in src/aiolocust/users/http.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
session_kwargs = {}
class-attribute
instance-attribute
Extra arguments to pass to aiohttp.ClientSession, e.g.
class TimeoutUser(HttpUser):
session_kwargs = {
"timeout": aiohttp.ClientTimeout(0.0001),
"skip_auto_headers": {"User-Agent"},
}
...
User
Bases: ABC
Source code in src/aiolocust/__init__.py
5 6 7 8 9 10 11 12 13 14 15 16 | |
cm()
async
Override this method if you need an async context manager around the run method
Source code in src/aiolocust/__init__.py
13 14 15 16 | |
datatypes
SafeCounter
A thread-safe counter.
Source code in src/aiolocust/datatypes.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
main
is_user_class(item)
Check if a variable is a runnable (non-abstract) User class
Source code in src/aiolocust/main.py
34 35 36 37 38 | |
users
http
HttpUser
Bases: User
Source code in src/aiolocust/users/http.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
session_kwargs = {}
class-attribute
instance-attribute
Extra arguments to pass to aiohttp.ClientSession, e.g.
class TimeoutUser(HttpUser):
session_kwargs = {
"timeout": aiohttp.ClientTimeout(0.0001),
"skip_auto_headers": {"User-Agent"},
}
...
request_hook(span, params)
Request hook for renaming spans based on name parameter (passed via context vars)
Typical usage:
AioHttpClientInstrumentor().instrument(request_hook=aiolocust.users.http.request_hook)
Source code in src/aiolocust/users/http.py
114 115 116 117 118 119 120 121 122 123 124 125 | |
pw
LocustPage
A wrapper for the Playwright Page object to automatically generate OTel spans.
Source code in src/aiolocust/users/pw.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |