分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

(四)Locust no-web模式

发布时间:2023-09-06 01:54责任编辑:苏小强关键词:暂无标签

熟悉 Apache ab 工具的同学都知道,它是没有界面的,通过命令行执行。 Locust 同样也提供的命令行运行,好处就是更节省客户端资源。

命令行运行 Locust 测试


以上一节的 baidu 首页测试(load_test.py)为例 通过 no-web 模式运行测试。

> locust -f load_test.py --host=https://www.baidu.com --no-web -c 10 -r 2 -t 1m[2017-10-30 22:17:30,292] DESKTOP-SMGQBBM/INFO/locust.main: Run time limit set to 60 seconds[2017-10-30 22:17:30,302] DESKTOP-SMGQBBM/INFO/locust.main: Starting Locust 0.8[2017-10-30 22:17:30,302] DESKTOP-SMGQBBM/INFO/locust.runners: Hatching and swarming 10 clients at the rate 2 clients/s... Name ?????????????????????????????????????????????????????????# reqs ?????# fails ????Avg ????Min ????Max ?| ?Median ??req/s.... [2017-10-30 22:18:30,301] DESKTOP-SMGQBBM/INFO/locust.main: Time limit reached. Stopping Locust. [2017-10-30 22:18:30,302] DESKTOP-SMGQBBM/INFO/locust.main: Shutting down (exit code 0), bye. ?Name ?????????????????????????????????????????????????????????# reqs ?????# fails ????Avg ????Min ????Max ?| ?Median ??req/s -------------------------------------------------------------------------------------------------------------------------------------------- ?GET / ???????????????????????????????????????????????????????????117 ????0(0.00%) ?????31 ?????17 ?????96 ?| ?????28 ???2.10 -------------------------------------------------------------------------------------------------------------------------------------------- ?Total ???????????????????????????????????????????????????????????117 ????0(0.00%) ??????????????????????????????????????2.10 Percentage of the requests completed within given times ?Name ??????????????????????????????????????????????????????????# reqs ???50% ???66% ???75% ???80% ???90% ???95% ???98% ???99% ??100% -------------------------------------------------------------------------------------------------------------------------------------------- ?GET / ????????????????????????????????????????????????????????????117 ????28 ????30 ????36 ????37 ????49 ????62 ????69 ????72 ????96 -------------------------------------------------------------------------------------------------------------------------------------------- ?Total ????????????????????????????????????????????????????????????117 ????28 ????30 ????36 ????37 ????49 ????62 ????69 ????72 ????96

启动参数:

–no-web 表示不使用Web界面运行测试。

-c 设置虚拟用户数。

-r 设置每秒启动虚拟用户数。

-t 设置设置运行时间。

(四)Locust no-web模式

原文地址:https://www.cnblogs.com/jason89/p/9034083.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved