项目作者: luxms

项目描述 :
locust load test in docker container
高级语言: Python
项目地址: git://github.com/luxms/docker-locust.git
创建时间: 2017-03-24T17:22:01Z
项目社区:https://github.com/luxms/docker-locust

开源协议:

下载


docker-locust

Dockerfile to create Docker containers for Locust load testing tool.

Build or Image

You can either build your own image using the included Dockerfile or just pull the existing image from the Docker Index.

Build container:

  1. $ docker build -t [user|organization]/locust .
  2. $ docker images
  3. $ docker tag [user|organization]/locust my-registry:5000/my-image
  4. $ docker push my-registry:5000/my-image
  5. $ docker rmi [user|organization]/locust

Pull image:

  1. $ docker pull [user|organization]/locust

Usage

The following usage instructions assumes Docker >= 0.5.3 and your running
user in the docker system group (to prevent needed sudo usage).

Run in Single node mode:

  1. $ docker run -d -e host='http://<insert_target_host>' -v `pwd`/locustfiles:/opt/locustfiles [user|organization]/locust locust -f /opt/locustfiles/locustfile.py

Run as Master:

  1. $ docker run -d -e host='http://<insert_target_host>' -p 8089:8089 -p 5557:5557 -p 5558:5558 -v `pwd`/locustfiles:/opt/locustfiles [user|organization]/locust locust --master -f /opt/locustfiles/locustfile.py

Run as Slave:

  1. $ docker run -d -e host='http://<insert_target_host>' -v `pwd`/locustfiles:/opt/locustfiles [user|organization]/locust locust --slave --master-host=<ip_of_docker_host> -f /opt/locustfiles/locustfile.py

The locustfile.py included is just an example that uses an evironment variable to load information. To use your own locustfile, just change -v `pwd`/locustfiles:/opt/locustfiles to point to your own locustfile.

Once your master/standalone container is running, connect to your Docker host on 8089 to access the webui.