An open source load testing tool. 一个开源性能测试工具. define user behaviour with python code, and swarm your system with millions of simultaneous users. 使用Python代码来定义用户行为.用它可以模拟百万计的并发用户访问你的系统. 如果你常关注我的博客,大概会注意到我有三.四年没有写过关于性能测试的文章了,其实,今年也没更新几篇像样的博客,反而是我最忙的一年,…
脚本增强 面对较复杂的测试场景,我们可能还是会感觉无从下手:例如,很多时候脚本需要做关联或参数化处理,Locust中就不知道怎么实现了.可能也是这方面的原因,感觉难以将Locust应用到实际的性能测试工作当中.其实这也跟Locust的目标定位有关,Locust的定位就是small and very hackable.但是小巧并不意味着功能弱,我们完全可以通过Python脚本本身来实现各种各样的功能. 在LoadRunner这款功能全面应用广泛的商业性能测试工具中,脚本增强无非就涉及到四个方面:…
那如何理解Locust和TaskSet这两个类呢? class HttpLocust(Locust) 在Locust类中,具有一个client属性,它对应着虚拟用户作为客户端所具备的请求能力,也就是我们常说的请求方法.通常情况下,我们不会直接使用Locust类,因为其client属性没有绑定任何方法.因此在使用Locust时,需要先继承Locust类,然后在继承子类中的client属性中绑定客户端的实现类. 对于常见的HTTP(S)协议,Locust已经实现了HttpLocust类,其clien…
An open source load testing tool. 一个开源性能测试工具. define user behaviour with python code, and swarm your system with millions of simultaneous users. 使用Python代码来定义用户行为.用它可以模拟百万计的并发用户访问你的系统. 为何突然关注性能测试工具?其实,我只是单纯对Locust工具本身感兴趣而已. 1.它与目前主流的LoadRunner和Jmeter…
What is Locust? Locust is an easy-to-use, distributed, user load testing tool. It is intended for load-testing web sites (or other systems) and figuring out how many concurrent users a system can handle. The idea is that during a test, a swarm of loc…