好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Python3.6性能测试框架Locust安装与使用详解(图)

下面小编就为大家带来一篇Python 3.6 性能测试框架Locust安装及使用方法(详解)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

from locust import Locust, TaskSet, task

class UserBehavior(TaskSet):
 @task
 def job(self):
  pass

class User(Locust):
 task_set = UserBehavior
 min_wait = 1000
 max_wait = 3000 
mars@mars-Ideapad-V460:~/test$ locust
[2015-09-12 10:46:36,876] mars-Ideapad-V460/INFO/locust.main: Starting web monitor at *:8089
[2015-09-12 10:46:36,919] mars-Ideapad-V460/INFO/locust.main: Starting Locust 0.7.3 

然后在浏览器中访问localhost:8089,弹出如下页面:

第一行Number of users to simulate是模拟用户的数量,第二行Hatch rate (users spawned/second表示产生模拟用户的速度,所有用户产生完后开始测试统计,填写完成后点击“Start swarming”即可开始测试:

以上就是Python3.6性能测试框架Locust安装与使用详解(图)的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于Python3.6性能测试框架Locust安装与使用详解(图)的详细内容...

  阅读:53次