Skip to content

Instantly share code, notes, and snippets.

@ashsepra
Last active December 28, 2020 03:00
Show Gist options
  • Save ashsepra/a13769808cea2ad53f81cf95851126d0 to your computer and use it in GitHub Desktop.
Save ashsepra/a13769808cea2ad53f81cf95851126d0 to your computer and use it in GitHub Desktop.
Sample web load testing
# Author ashsepra@gmail.com
# This load test for example
# Scope on load test at wikipedia
import time
from locust import HttpUser, TaskSet, task, between
class SubClassTest(TaskSet):
@task
def main_page(self):
self.client.get('/wiki/Halaman_Utama')
@task(2)
def perihal_page(self):
self.client.get('/wiki/Wikipedia:Perihal')
class MainClassTest(HttpUser):
tasks = [SubClassTest]
wait_time = between(5, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment