forked from locustio/locust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from locustio/master
Sync with fork
- Loading branch information
Showing
21 changed files
with
475 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from locust import HttpLocust, TaskSet, task | ||
from locust.contrib.fasthttp import FastHttpLocust | ||
|
||
|
||
class UserTasks(TaskSet): | ||
@task | ||
def index(self): | ||
self.client.get("/") | ||
|
||
@task | ||
def stats(self): | ||
self.client.get("/stats/requests") | ||
|
||
|
||
class WebsiteUser(FastHttpLocust): | ||
""" | ||
Locust user class that does requests to the locust web server running on localhost, | ||
using the fast HTTP client | ||
""" | ||
host = "http://127.0.0.1:8089" | ||
min_wait = 2000 | ||
max_wait = 5000 | ||
task_set = UserTasks | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from locust import HttpLocust, TaskSet, task | ||
|
||
|
||
class WebsiteUser(HttpLocust): | ||
""" | ||
Example of the ability of inline nested TaskSet classes | ||
""" | ||
host = "http://127.0.0.1:8089" | ||
min_wait = 2000 | ||
max_wait = 5000 | ||
|
||
class task_set(TaskSet): | ||
@task | ||
class IndexTaskSet(TaskSet): | ||
@task(10) | ||
def index(self): | ||
self.client.get("/") | ||
|
||
@task(1) | ||
def stop(self): | ||
self.interrupt() | ||
|
||
@task | ||
def stats(self): | ||
self.client.get("/stats/requests") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .core import HttpLocust, Locust, TaskSet, TaskSequence, task, seq_task | ||
from .exception import InterruptTaskSet, ResponseError, RescheduleTaskImmediately | ||
|
||
__version__ = "0.12.1" | ||
__version__ = "0.12.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.