from locust import HttpUser, task, between
class WebsiteUser(HttpUser):
wait_time = between(1, 2.5) # 用户之间请求的等待时间范围
@task
def view_video(self):
url = “http://127.0.0.1/video/5-2 go语言的调度器”
self.client.get(url, name=”/video/…”)
# 注意:由于 URL 很长且包含特殊字符,我在这里简化了 name 参数以便在 Locust UI 中更容易识别
发表回复