Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
571 B
1
Indexable
Never
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)