mirror of https://github.com/locustio/locust.git
Add open/closed workload example.
This commit is contained in:
parent
d0ac47c2b4
commit
3186f60ba3
|
@ -0,0 +1,22 @@
|
|||
from locust import HttpUser, constant, constant_pacing, task
|
||||
|
||||
|
||||
class ClosedWorkload(HttpUser):
|
||||
wait_time = constant(10) # sleep 10s after each task, regardless of execution time
|
||||
|
||||
@task
|
||||
def t(self):
|
||||
pass
|
||||
|
||||
|
||||
class OpenWorkload(HttpUser):
|
||||
wait_time = constant_pacing(10) # sleep just enough so that we run one task iteration every 10s
|
||||
|
||||
@task
|
||||
def t(self):
|
||||
pass
|
||||
|
||||
|
||||
# Note: A test using constant_pacing is still limited by the number of Users you spawn,
|
||||
# so if response times increase to the point where one task execution takes more than 10s,
|
||||
# you still wont reach your target throughput.
|
Loading…
Reference in New Issue