from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(5, 9)
@task(3)
def index_page(self):
self.client.get("/")
# Load CSS
self.client.get("/assets/css/app.css?v=5182f1a68d")
self.client.get("/assets/css/home.css?v=5182f1a68d")
self.client.get("/public/cards.min.css?v=5182f1a68d")
# Load JavaScript
self.client.get("/public/cards.min.js?v=5182f1a68d")
self.client.get("/assets/js/manifest.js?v=5182f1a68d")
self.client.get("/assets/js/vendor.js?v=5182f1a68d")
self.client.get("/assets/js/app.js?v=5182f1a68d")
# Simulate visiting different pages
@task(1)
def visit_pages(self):
urls = [
"", "/", "/products/", "/we-care/", "/corporate/", "/products",
"/1000-screenshots-per-month-for-free/", "/author/gbv/",
"/loadforge-launches-white-labelling-for-reports/", "/tag/loadforge/",
"/sponsoring-laravel-io/", "/tag/news/"
]
for url in urls:
self.client.get(url)