Skip to content

Instantly share code, notes, and snippets.

@anandtripathi5
Created April 1, 2022 11:50
Show Gist options
  • Save anandtripathi5/576be7bd888093a6742daebac97b2a48 to your computer and use it in GitHub Desktop.
Save anandtripathi5/576be7bd888093a6742daebac97b2a48 to your computer and use it in GitHub Desktop.
from locust import HttpUser, task
from random import randint
class AwesomeApplication(HttpUser):
@task
def hello(self):
self.client.get("/hello")
@task
def world(self):
self.client.get("/world")
@task
def square(self):
self.client.get(f"/square/{randint(0,100)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment