MCPcopy
hub / github.com/locustio/locust / constant

Function constant

locust/user/wait_time.py:23–32  ·  view source on GitHub ↗

Returns a function that just returns the number specified by the wait_time argument Example:: class MyUser(User): wait_time = constant(3)

(wait_time: float)

Source from the content-addressed store, hash-verified

21
22
23def constant(wait_time: float) -> Callable[["User"], float]:
24 """
25 Returns a function that just returns the number specified by the wait_time argument
26
27 Example::
28
29 class MyUser(User):
30 wait_time = constant(3)
31 """
32 return lambda instance: wait_time
33
34
35def constant_pacing(wait_time: float) -> Callable[["User"], float]:

Callers 15

UserClass · 0.90
MyUserClass · 0.90
MySubTaskSetClass · 0.90
MySubTaskSetClass · 0.90
TestUserClass · 0.90
MyUser1Class · 0.90
MyUser2Class · 0.90
MyUserClass · 0.90
BaseUserClass · 0.90
MyUserClass · 0.90
MyUser1Class · 0.90
MyUser2Class · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…