Commit 4cf44483 by Karsa Zoltán István

load testing auth

parent eb6f5e2a
import json
from locust import HttpUser, task, between
class PerformanceTests(HttpUser):
wait_time = between(1, 3)
from locust import TaskSet, task, between, HttpUser
class PerformanceTests(TaskSet):
def on_start(self):
self.client.post("/user/login", {
resp = self.client.post("/user/login", json={
"username": "karsa",
"password": "12345678"
})
self.client.headers = {'Authorization': 'Bearer ' + json.loads(resp._content)['access_token']}
@task(1)
def testFastApi(self):
self.client.get("/lb/dashboard/acpi/vm/1/")
\ No newline at end of file
self.client.get("/lb/dashboard/acpi/vm/1/")
class WebsiteUser(HttpUser):
tasks = [PerformanceTests]
min_wait = 5000
max_wait = 9000
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment