Untitled
unknown
plain_text
2 years ago
571 B
9
Indexable
from locust import HttpUser, TaskSet, task, constant, between
from locust.env import Environment
from locust import LoadTestShape
import requests
import json
class WebsiteTasks(TaskSet):
def on_start(self):
print("start !!")
@task(1)
def about(self):
url = "http://0.0.0.0:8001/api/heartbeat/monitor/monitor_alert_api"
response = self.client.get(url)
print("Response text:", response.text)
class WebsiteUser(HttpUser):
tasks = [WebsiteTasks]
# wait_time = constant(1)
wait_time = between(0.5, 3)Editor is loading...