作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我想通过 API 调用 Locust 负载测试,以便能够从 CI 工具开始测试。
我没有看到很多关于这种情况的文档,locust API 中没有“Runner”或类似的类文档。
我检查了在 Windows 中安装后可用的“locust”命令。它是一个 .exe,所以不确定它的作用以及它如何实际启动测试
所以,具体的问题是,是否有一个接口(interface)可以从另一个Python程序开始测试
最佳答案
目前,除命令行界面外,没有记录在案的用于控制蝗虫的 API。 CLI 可用于开始运行负载测试,但目前无法在没有 Web UI 的情况下运行分布式 Locust。
您也可以将 Web UI 用作 API,然后自己从您的程序中发出 HTTP 请求,浏览器将其发送到 Web UI。
在 Windows 中(由 python 的设置工具)创建的 locust.exe 文件只是一个小包装器,它将在 locust/main.py 中运行 main()
关于python - 蝗虫 : How to invoke the test through an API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25422351/
我是一名优秀的程序员,十分优秀!