当前位置:网站首页>Locust performance test - environment construction and use
Locust performance test - environment construction and use
2022-07-04 22:31:00 【Peng Yuyan in the testing industry】
1. What is? Locust?
Locust Is an easy to use , Scriptable and extensible performance testing tool . You can use the general Python Code defines user behavior , This makes Locust It can be expanded infinitely , And very friendly to developers .
2. features
Distributed and scalable - Support hundreds of thousands of users
Locust Make it easy to run load tests on multiple computers . It's event based ( Use gevent), This allows a single process to handle thousands of concurrent users . Although there may be other tools that can perform more requests per second on a given hardware , But every one of them Locust The user's low overhead makes it ideal for testing high concurrency workloads .
be based on Web Of UI
Locust Have user-friendly Web Interface , It can display the test progress in real time . You can even change the load while the test runs . It can also be in the absence of UI Operation in case of , So that it can be easily used for CI / CD test .
Can test any system
Even if Locust Main content and website / Services are used together , It can also be used to test almost any system or protocol . just Write a client for what you want to test , Or browse some clients created by the community .
3. Environmental installation
Official documents
https://docs.locust.io/en/1.4.4/what-is-locust.html
install Python 3.6 Or later .
Use pip install
Locust.pip install locust
Verify the installation and display locust Version number
pip show locust
(venv) E:\workspace\LocustConcurrent>pip show locust
Name: locust
Version: 1.4.4
Summary: Developer friendly load testing framework
Home-page: https://locust.io/
4. Quick start
stay Locust in , You can use Python Code defines user behavior . then , You can use the locust Command and ( Optional ) Its Web The interface generates and simulates a large number of these users as it collects request statistics .
locust_cnblogs.py
''''
Create by dell on 2021/4/13
Author :wencheng
describe :
'''
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 2.5)
@task
def bky_deom(self):
self.client.get("/")
@task(3)
def bky_demo2(self):
self.client.get("/wen-cheng")
if __name__ == '__main__':
import os
os.system('locust -f locust_cnblogs.py -H https://www.cnblogs.com')
5. Startup and operation locust
open locust Of web Interface , Browser access :http://127.0.0.1:8089
Set the number of virtual users 20, Start every second 5 Users , Click on Start swarming Began to run
locust Of web Interface analysis :
Number of users to simulate It's the number of simulated users
Hatch rate (users spawned/second Represents the speed at which simulated users are generated
Start swarming Start testing
6. Analyze test results
Type: Request type ;
Name: Request path ;
Requests: Number of current requests ;
Fails: Number of current request failures ;
Median: In the middle , Unit millisecond , Generally, the server response time is lower than this value , The other half is higher than that ;
Average: Average response time for all requests , millisecond ;
Min: Minimum server response time for requests , millisecond ;
Max: Maximum server response time for a request , millisecond ;
Content Size: The size of a single request , Unit byte ;
Reqs/sec: Number of requests per second .
Interface chart display
throughput / Number of response transactions per second (rps) Real time statistics Mean response time / Real time statistics of average transactions Number of virtual users running
Derived data
The above is the whole content of this article , I hope the content of this article has a certain reference value for your study or work , If you have any questions, you can leave a message , Thank you for your support .
Learning resource sharing
Finally, thank everyone who reads my article carefully , Watching the rise and attention of fans all the way , Reciprocity is always necessary , Although it's not very valuable , If you can use it, you can take it
These materials , For thinking 【 Advanced automated testing 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful …….
边栏推荐
- 湘江鲲鹏加入昇腾万里伙伴计划,与华为续写合作新篇章
- 好用app推荐:扫描二维码、扫描条形码并查看历史
- Scala download and configuration
- Mysql root 账号如何重置密码
- LOGO特訓營 第三節 首字母創意手法
- 高中物理:直线运动
- sqlserver对数据进行加密、解密
- Éducation à la transmission du savoir | Comment passer à un test logiciel pour l'un des postes les mieux rémunérés sur Internet? (joindre la Feuille de route pour l'apprentissage des tests logiciels)
- 使用 BlocConsumer 同时构建响应式组件和监听状态
- 傳智教育|如何轉行互聯網高薪崗比特之一的軟件測試?(附軟件測試學習路線圖)
猜你喜欢
Machine learning notes mutual information
With this PDF, we finally got offers from eight major manufacturers, including Alibaba, bytek and Baidu
Logo special training camp section III initial creative techniques
A large number of virtual anchors in station B were collectively forced to refund: revenue evaporated, but they still owe station B; Jobs was posthumously awarded the U.S. presidential medal of freedo
都说软件测试很简单有手就行,但为何仍有这么多劝退的?
More than 30 institutions jointly launched the digital collection industry initiative. How will it move forward in the future?
复数在数论、几何中的用途 - 曹则贤
i. Mx6ull driver development | 24 - platform based driver model lights LED
Scala下载和配置
TLA+ 入门教程(1):形式化方法简介
随机推荐
Ascendex launched Walken (WLKN) - an excellent and leading "walk to earn" game
【米哈游2023届秋招】开启【校招唯一专属内推码EYTUC】
Which securities company has the lowest Commission for opening an account online? I want to open an account. Is it safe to open an account online
并发优化总结
POM in idea XML dependency cannot be imported
UML图记忆技巧
[Yugong series] go teaching course 003-ide installation and basic use in July 2022
高中物理:直线运动
LOGO特训营 第五节 字体结构与设计常用技法
Introducing QA into the software development lifecycle is the best practice that engineers should follow
傳智教育|如何轉行互聯網高薪崗比特之一的軟件測試?(附軟件測試學習路線圖)
NAACL-22 | 在基于Prompt的文本生成任务上引入迁移学习的设置
Force buckle 3_ 383. Ransom letter
嵌入式开发:技巧和窍门——提高嵌入式软件代码质量的7个技巧
2022-07-04:以下go语言代码输出什么?A:true;B:false;C:编译错误。 package main import “fmt“ func main() { fmt.Pri
我在linux里面 通过调用odspcmd 查询数据库信息 怎么静默输出 就是只输出值 不要这个
力扣_回文数
ACM Multimedia 2022 | 视觉语言预训练模型中社会偏见的反事实衡量和消除
How to manage 15million employees easily?
Shell 脚本实现应用服务日志入库 Mysql