The following small series to bring you a Python 3.6 Performance testing Framework locust installation and use of the method (detailed). Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
Background
Construction and use of Python3.6 Performance test Framework Locust
Basis
Python version: python3.6
Development tools: Pycharm
Installation and configuration of locust
Click "File" → "setting"
Click "Setting" to go to the Setup window and select "Project interpreter"
Click "+"
Input requires "Locust", click "Install Package"
The installation is complete and ready to use.
After installing the Locust tool, you only need to write a simple Python file to load test the system. Here's an example:
From Locust import Locust, TaskSet, Taskclass Userbehavior (TaskSet): @task def Job (self): passclass User (locust): TAS K_set = Userbehavior min_wait = max_wait = 3000
Then enter in the terminal:
mars@mars-ideapad-v460:~/test$ locust[2015-09-12 10:46:36,876] mars-ideapad-v460/info/locust.main:starting web Monitor at *:8089[2015-09-12 10:46:36,919] mars-ideapad-v460/info/locust.main:starting locust 0.7.3
Then access the localhost:8089 in the browser, pop up the following page:
The first line number of users to simulate is the amount of the impersonated user, the second line hatch rate (users Spawned/second represents the speed of the impersonated user, all users start testing statistics after completion, click "Start Swarming "to start testing: