from locust import HttpLocust, TaskSet, task class TestIndex(TaskSet): @task def getIndex(self): self.client.get("https://tianqiapi.com/api?appid=21714715&appsecret=IIyz3c8o") print("hello") class WebSite(HttpLocust): task_set = TestIndex min_wait = 1000 max_wait = 2000 ‘‘‘ 编写脚本打开CMD进入源码文件目录执行 locust -f test.py --host=https://tianqiapi.com/api?appid=21714715&appsecret=IIyz3c8o打开浏览器访问 http://localhost:8089/输入并发数和循环次数‘‘‘
原文地址:https://www.cnblogs.com/lbfang/p/12416976.html
时间: 2024-11-09 03:53:24