标签:secret oca 输入 class index elf def api ebs
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/
输入并发数和循环次数
‘‘‘
标签:secret oca 输入 class index elf def api ebs
原文地址:https://www.cnblogs.com/lbfang/p/12416976.html