enricopesce / locuster

Deploy load test infrastructure based on Locust.io with AWS CDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Locuster

Example how with AWS CDK you can deploy a load test infrastructure using Locust.io

The infrastructure code is written in Python, it executes a master\slave Locust infrastructure

I totally love LOCUST and CDK!

Installation and requirements:

Install the CDK framework

npm install -g aws-cdk

Install the Python dependencies

pip install -r requirements.txt

Authenticate in your AWS account:

Follow this guide: Configuring the AWS CLI

Bootstrap AWS CDK (if needed)

cdk bootstrap --region eu-west-1

Usage

Deploy locust:

export AWS_PROFILE="profilename"
export AWS_DEFAULT_REGION="eu-west-1"
cdk deploy locuster

.....

 ✅  locuster

Outputs:
locuster.LocustWebConsole = http://locus-nbala-15IY958M7LUVF-ab8bf6ee96743c80.elb.eu-west-1.amazonaws.com:8089

After the deployment you need to wait for a 1-minute maximum, you can start the load using the output address

Destroy locust:

cdk destroy locuster

Local test:

You can try locally the platform:

cd docker
docker-compose up --scale worker=2 --build

Customize the loucustfile test code:

You can customize the code inside the docker/code directory

Have fun!

About

Deploy load test infrastructure based on Locust.io with AWS CDK


Languages

Language:Python 92.7%Language:Batchfile 5.4%Language:Dockerfile 1.9%