Created
April 18, 2015 00:17
-
-
Save pablete/a2b8ac7ddf31a3229381 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from locust import HttpLocust, TaskSet, task | |
import json | |
import os | |
json_data=open(os.path.dirname(os.path.abspath(__file__)) + "/small_payload.json").read() | |
data = json.loads(json_data) | |
class MyTaskSet(TaskSet): | |
@task | |
def my_task(self): | |
headers = {'content-type': 'application/json'} | |
self.client.post("/v1/import", data=json_data, headers=headers) | |
class WebsiteUser(HttpLocust): | |
task_set = MyTaskSet | |
min_wait = 200 | |
max_wait = 500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment