Created
November 4, 2018 13:58
-
-
Save cengizhancaliskan/5689a382d11bac018fe309d3d76649ca to your computer and use it in GitHub Desktop.
Locust example
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
# -*- coding: utf-8 -*- | |
from locust import HttpLocust, TaskSet, task | |
class FirstTestClass(TaskSet): | |
# @task attribute' methodumuzun task olduğunu belirtmek için kullanıyoruz. | |
@task | |
def index(self): | |
self.client.get("/locustio/locust") | |
@task | |
def profile(self): | |
with self.client.get("/orgs/locustio/people", catch_response=True) as response: | |
if 200 == response.status_code: | |
response.success() | |
class MyFirstLocust(HttpLocust): | |
# İstek yapılacak host (isteğe bağlı), konsoldan da verebilirsiniz. | |
host = "https://github.com" | |
# Test Class'ımız | |
task_set = FirstTestClass | |
# İstekler arası minimum ve maksimum bekleme süresi milisaniye cinsinden, Default "1000" | |
min_wait = 0 | |
max_wait = 7000 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment