Example tests and snippets
Increase Performance with FastHTTP
By default, LoadForge uses the HttpUser class which is based on Python requests. This allows a large amount of flexibility with customizing your test, however, for most use cases it's not required.
There is an alternative and significantly faster method (4-5x more requests/second) by using FastHttpUser instead of HttpUser. Below is an example of a test configured to use FastHttpUser.
Advanced Users Only
This is an advanced feature and is not recommended for most users. FastHttpUser is more limited in functionality than the typical HttpUser class.
Below is a very simple test with no wait_time, designed to send the maximum number of requests per virtual user.
from locust import task, FastHttpUser class MyUser(FastHttpUser): @task(1) def index(self): response = self.client.get("/")
Locust Test Example
LoadForge is powered by locust, meaning open source locust users can copy this script as well. If you are a locust user, consider importing your script to LoadForge to supercharge your testing!