diff --git a/test/locust/README.md b/test/locust/README.md new file mode 100644 index 00000000..d179bdda --- /dev/null +++ b/test/locust/README.md @@ -0,0 +1,16 @@ +## Locust Performance Testing +Locust website: http://locust.io/ + +Locust is an easy-to-use, distributed, user load testing tool. +Intended for load testing web sites (or other systems) and figuring out how many +concurrent users a system can handle. + +## Usage +```bash +locust -f locustfile.py --host=http://localhost:1026 +``` + +Open the browser at localhost:8089 and start the swarm. + +## Documentation +http://docs.locust.io/en/latest/index.html diff --git a/test/locust/checkStatus.py b/test/locust/checkStatus.py new file mode 100644 index 00000000..656edab9 --- /dev/null +++ b/test/locust/checkStatus.py @@ -0,0 +1,19 @@ +from locust import HttpLocust, TaskSet, task, ResponseError + +class CheckStatus(TaskSet): + def on_start(self): + """ on_start is called when a Locust start before any task is scheduled """ + print("Locus test started") + + @task(1) + def getVersion(self): + headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} + response = self.client.get("/version", headers=headers) + + print "Response status code:", response.status_code + print "Response content:", response.content + +class HelloLocust(HttpLocust): + task_set = CheckStatus + min_wait=5000 + max_wait=9000