(2) install Locust

Source: Internet
Author: User

To:

Http://www.testclass.net/locust/install/

 

Locust is a performance test Library Based on the Python language. If you want to use it for performance testing, you must first install python.

Python installation, refer

 

Locust Installation

Method 1: Install the SDK using the PIP command

> pip install locustCollecting locust  Downloading locust-0.8.tar.gz (225kB)    59% |███████████████████             | 133kB 199kB/s eta 0:00:0    63% |████████████████████▍           | 143kB 304kB/s eta 0:00:    68% |█████████████████████▉          | 153kB 358kB/s eta 0:0    72% |███████████████████████▎        | 163kB 355kB/s eta 0:    77% |████████████████████████▊       | 174kB 421kB/s eta    81% |██████████████████████████▏     | 184kB 449kB/s eta    86% |███████████████████████████▋    | 194kB 439kB/s e    90% |█████████████████████████████   | 204kB 487kB/s    95% |██████████████████████████████▌ | 215kB 492kB/s    99% |████████████████████████████████| 225kB 487kB    100% |████████████████████████████████| 235kB 417k    ....

Method 2: download and install the SDK on GitHub

GitHub address: https://github.com/locustio/locust/

Clone the project and run the setup. py file in Python.

...\locust> python setup.py installrunning installrunning bdist_eggrunning egg_infocreating locustio.egg-infowriting locustio.egg-info\PKG-INFOwriting dependency_links to locustio.egg-info\dependency_links.txtwriting entry points to locustio.egg-info\entry_points.txtwriting requirements to locustio.egg-info\requires.txtwriting top-level names to locustio.egg-info\top_level.txtwriting manifest file ‘locustio.egg-info\SOURCES.txt‘...

Finally, check whether the installation is successful. Open the windows command prompt and enter "locust-help" and press Enter.

> locust --helpUsage: locust [options] [LocustClass [LocustClass2 ... ]]Options:  -h, --help            show this help message and exit...

The meaning of each parameter will be described later.

Install dependency analysis

Here, I would like to briefly introduce the databases that Locust is based on. Open the setup. py file in the locust installation directory. View installation requirements:

Install_requires = ["gevent> = 1.1.2", "flask> = 0.10.1", "Requests> = 2.9.1", "msgpack-Python> = 0.4.2", "Six> = 1.10.0 ", "pyzmq = 15.2.0"]

Gevent is a third-party library that implements coroutine in Python. Coroutine, also known as coroutine ). Gevent can achieve extremely high concurrency performance.

Flask is a web development framework of Python.

Requests is used for HTTP interface testing.

Msgpack-python is a fast and compact binary serialization format and is suitable for JSON-like data.

Six provides some simple tools to encapsulate the differences between python2 and python3.

If you plan to run the locust command on multiple processes/machines, we recommend that you install pyzmq.

When we install locust, it will check whether these libraries have been installed in our current Python environment. If not, it will first install these libraries one by one. And there are requirements for these database versions, some must be equal to a certain version, and some must be later than a certain version. We can also install all these libraries as required in advance, and the installation of locust will be much faster.

(2) install Locust

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.