locust

Not able to install locust on windows

…衆ロ難τιáo~ 提交于 2020-01-07 08:31:41
问题 I installed locust using the command on windows py -m pip install locustio This is the output I got Collecting locustio Using cached https://files.pythonhosted.org/packages/98/12/60351b28a00c76d36022d79bead7dc217e9e49cddd7091cb164319196323/locustio-0.11.0-py2.py3-none-any.whl Collecting gevent>=1.2.2 (from locustio) Downloading https://files.pythonhosted.org/packages/8a/dd/417aad4e69fa7f8882534b778c46cb28eb0421ffa1e924ec3b4efcfcc81f/gevent-1.4.0-cp37-cp37m-win_amd64.whl (3.0MB) 100% |████████

Way to use locust.io by supplying user list

流过昼夜 提交于 2019-12-31 08:09:28
问题 I need to stress-test a system and http://locust.io seems like the best way to go about this. However, it looks like it is set up to use the same user every time. I need each spawn to log in as a different user. How do I go about setting that up? Alternatively, is there another system that would be good to use? 回答1: Locust author here. By default, each HttpLocust user instance has an HTTP client that has it's own separate session . Locust doesn't have any feature for providing a list of user

How to login to Flask App when using Locust

蹲街弑〆低调 提交于 2019-12-24 23:16:20
问题 First time using Locust. I have a Flask App that requires user to login to access most routes. I cant get Locust to successfully login to my Flask App. Here is my Locust.py file: from locust import HttpLocust, TaskSet, task import re class UserBehavior(TaskSet): def on_start(self): """ on_start is called when a Locust start before any task is scheduled """ self.client.verify = False self.get_token() self.login() def on_stop(self): """ on_stop is called when the TaskSet is stopping """ self

reqs/sec not correct when load testing with Python Locust

一个人想着一个人 提交于 2019-12-23 05:45:12
问题 In my testing, both min_wait and max_wait are set to 1 second, and I set users to 100, so I expect the reqs/sec to be close to 100. I know Locust actually need to wait server respond and then send the next request. Even though, if server respond quick, like 20ms, the outcome TPS should be close to 100, like 92 maybe. But, in actuality it is 10, as the following picture shows: What am I missing? My code is below: class UserBehavior(TaskSet): @task(1) def list_teacher(self): self.client.get("

how to pass custom parameters to a locust test class?

一世执手 提交于 2019-12-22 01:34:58
问题 I'm currently passing custom parameters to my load test using environment variables. For example, my test class looks like this: from locust import HttpLocust, TaskSet, task import os class UserBehavior(TaskSet): @task(1) def login(self): test_dir = os.environ['BASE_DIR'] auth=tuple(open(test_dir + '/PASSWORD).read().rstrip().split(':')) self.client.request( 'GET', '/myendpoint', auth=auth ) class WebsiteUser(HttpLocust): task_set = UserBehavior Then I'm running my test with: locust -H https:

In locust How to get a response from one task and pass it to other task

孤人 提交于 2019-12-21 07:56:39
问题 I have started using Locust to do performance test. I want to fire two post request to two different end points. But the second post request needs response of the first request. How to do this in convenient way. I have tried like below but not working. from locust import HttpLocust, TaskSet, task class GetDeliveryDateTasks(TaskSet): request_list = [] @task def get_estimated_delivery_date(self): self.client.headers['Content-Type'] = "application/json" response = self.client.post("/api/v1

Locust.io: Controlling the request per second parameter

。_饼干妹妹 提交于 2019-12-17 18:59:01
问题 I have been trying to load test my API server using Locust.io on EC2 compute optimized instances. It provides an easy-to-configure option for setting the consecutive request wait time and number of concurrent users . In theory, rps = wait time X #_users . However while testing, this rule breaks down for very low thresholds of #_users (in my experiment, around 1200 users). The variables hatch_rate , #_of_slaves , including in a distributed test setting had little to no effect on the rps .

LocustIO: min_wait and max_wait not being applied

感情迁移 提交于 2019-12-13 03:47:01
问题 I am playing around LocustIO. I have a single self.client.get() task with my min_wait and max_wait were set to be 1 millisecond each. class App_User(HttpLocust): ... min_wait = 1 max_wait = 1 I was using logging to see the response. I am expecting in console that timestamps of the task logs will be within the same second given a max_wait of 1 millisecond but it seems that the task runs every 1 second still. Is it wrong to expect a 1000 GET responses within a 1 second load test period given 1

Understanding locust summary result

扶醉桌前 提交于 2019-12-12 10:20:36
问题 I have a problem to understanding the locust result as this is the first time load test my server, I ran locust using command line on 00:00 local time with; 1000 total user , 100 hatch per second and 10000 request. Below are the result Name # reqs # fails Avg Min Max | Median req/s -------------------------------------------------------------------------------------------------------------------------------------------- GET /api/v0/business/result/22918 452 203(30.99%) 9980 2830 49809 | 6500

Any way to track custom statistics in locust

落花浮王杯 提交于 2019-12-11 19:30:58
问题 Locust is a great and simple load testing tool. By default it only tracks response times and content length from which it can deduce RPS, etc. Is there any way to track custom statistics in locust as well? In my case a site Im testing returns couple of stats via headers. For example a count of SQL queries within a request. It would be very helpful to track some of these statistics in conjunction to tracking standard response times. I do not see any way to do that in locust however. Is there a