Python 3.6 Performance Testing Framework Locust installation and use, pythonlocust

Source: Internet
Author: User

Python 3.6 Performance Testing Framework Locust installation and use, pythonlocust

Background

Build and use of Python3.6 Performance Testing Framework Locust

Basic

Python version: python3.6

Development Tool: pycharm

Installation and configuration of Locust

Click "File"> "setting"

Click "setting" to enter the settings window. Select "Project Interpreter"

Click "+"

Enter "Locust" and click "Install Package"

After the installation is complete, you can use it.

After installing the Locust tool, you only need to write a simple Python file to test the system load. The following is an example:

 1 from locust import Locust, TaskSet, task 2  3 class UserBehavior(TaskSet): 4     @task 5     def job(self): 6         pass 7  8 class User(Locust): 9     task_set = UserBehavior10     min_wait = 100011     max_wait = 3000

Enter the following information on the terminal:

1 mars@mars-Ideapad-V460:~/test$ locust2 [2015-09-12 10:46:36,876] mars-Ideapad-V460/INFO/locust.main: Starting web monitor at *:80893 [2015-09-12 10:46:36,919] mars-Ideapad-V460/INFO/locust.main: Starting Locust 0.7.3

Access localhost: 8089 in the browser. The following page is displayed:

First lineNumber of users to simulateIs the number of simulated users, the second lineHatch rate (users spawned/secondIt indicates the speed at which the simulated user is generated. After all users generate the simulated user, Start the test statistics. after entering the information, click "Start swarming" to Start the test:

 

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.