Python3.6 Performance test framework locust installation and use

Source: Internet
Author: User
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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.