locust官网:https://locust.io/

locust安装(不支持python3.7):pip install locustio   或者pycharm安装

官网给出的样例

根据官网代码新建一个脚本

from locust import HttpLocust, TaskSet, task

class WebsiteTasks(TaskSet):

    @task(weight=2)  # weight:发压的比例,可以不设置
def index(self):
self.client.get("/guonei") # 百度新闻的国内:http://news.baidu.com/guonei @task(weight=8)
def about(self):
self.client.get("/guoji") # 百度新闻的国际:http://news.baidu.com/guoji class WebsiteUser(HttpLocust):
task_set = WebsiteTasks
min_wait = 1000 # 最小等待时间,毫秒
max_wait = 3000 # 最大等待时间,毫秒

执行:locust -f 脚本 --host=要压的host:locust -f locustfile.py --host=http://news.baidu.com

访问localhost:8089(不能用127.0.0.1)

Statistics页面:

Charts页面

Failures

Exceptions

Download Data

Ctrl + C结束也会在窗口生成数据

最新文章

  1. sql跨数据库转移
  2. 如何在WPF中引用Windows.System.Forms.Integration
  3. Learn python the hard way. python test program 2016.04.27
  4. 着色器(Shader)
  5. TCP/IP, HTTP, socket
  6. Codeforces Round #316 (Div. 2)
  7. xcode5下面安装Command Line Tools
  8. net 2.0使用ajax
  9. ASP.NET MVC IOC之Unity攻略
  10. 使用axis2访问webservice(webserivice基于.net平台实现)
  11. C#基础知识-函数的定义和调用(五)
  12. 转载 远程用户连接mysql授权
  13. Java VisualVM无法检测到本地java程序 的 解决办法
  14. centOS7下Spark安装配置
  15. 【代码审计】YzmCMS_PHP_v3.6 任意文件删除漏洞分析
  16. php中parse_url函数解析
  17. 分析器错误消息: 未能找到 CodeDom 提供程序类型
  18. Linux下找不到动态链接库(转)
  19. tera term通过ttl脚本 自动连接服务器(转自http://www.cnblogs.com/wxb0328/p/teraterm.html)
  20. unity, Root Motion

热门文章

  1. exsi中使用vSphere客户端复制克隆虚拟机
  2. (4.31)quotename函数
  3. Eclipse查看jdk源码(Ctrl+左键)
  4. Java方法多态性——方法的重载Overload和重写Override
  5. Maven生成可以直接运行的jar包的多种方式(转)
  6. .iml文件恢复
  7. mysql 乐观锁、悲观锁、共享锁,排它锁
  8. CSS3 Animations
  9. 阿里云ECS VSFTP上传本地文件
  10. Spring---Spring Integration