python-locust报错问题笔记

我们在编写locust脚本时,先定义个用户行为,继承TastSet类,然后再创建一个类继承HttpUser类,那么在编写过程中就会出现以下问题:

1、DeprecationWarning: Usage of User.task_set is deprecated since version1.0. Set the tasks attribute instead (tasks = [UserBehavior])

这个问题是说,从版本1.0以后,task_set已经被tasks代替

class WebsiteUser(HttpUser):
    host = "https://www.baidu.com"
    tasks = [UserBehavior]       # >>原来是task_set = UserBehavior
    min_wait = 1500
    max_wait = 5000

2、System open file limit setting is not high enough for load testing, a
nd the OS wouldnt allow locust to increase it by itself.

这个提示,暂时不知道什么意思,翻译后只知道:系统打开文件限制设置不够高,无法进行负载测试,操作系统不允许蝗虫自行增加

你可能感兴趣的:(python-locust报错问题笔记)