Skip to content

Instantly share code, notes, and snippets.

@cengizhancaliskan
Created November 4, 2018 13:58
Show Gist options
  • Save cengizhancaliskan/5689a382d11bac018fe309d3d76649ca to your computer and use it in GitHub Desktop.
Save cengizhancaliskan/5689a382d11bac018fe309d3d76649ca to your computer and use it in GitHub Desktop.
Locust example
# -*- 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