Skip to content

wei-go/locust-load-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Performance Test Tool

Performance Test Tool is a python based project which is triggered by Locust Load Tests Framework.

Locust Git


Running on local with config

It's easy to run the performance test on local with config.

Prepare your test case file under the tests folder, and modify the master.conf file to set the test case file name.

Steps:

  1. setup the python environment

pip install -r requirements.txt

  1. prepare the test case file under the tests folder

ex: tests/locust_testfile.py

  1. modify the

master.conf


locustfile = tests/{TEST_CASE_FILE_NAME}.py

host = ""

users = {MAX_NUM_OF_USERS}

spawn-rate = {SPAWN_RATE}

run-time = 10m # set the run time

headless = true # if you want to run it without UI

  1. execute the command to run the performance test

locust -f master.conf


Dsitributed Performance Test on Kubernetes

  • We use Helm to do deployment, so please check you have it.

Pre-Actions:

  1. Build the docker image and push to the GCR

For Grafana:

cd {REPO_ROOT}/build/grafana
docker build -t {PATH_OF_DOCKER_NAME}:{TAG} .
docker push {PATH_OF_DOCKER_NAME}:{TAG}

For TimescaleDB:
cd {REPO_ROOT}/build/timescaledb
docker build -t {PATH_OF_DOCKER_NAME}:{TAG} .
docker push {PATH_OF_DOCKER_NAME}:{TAG}

For Locust:

cd {REPO_ROOT}/
docker build -t {PATH_OF_DOCKER_NAME}:{TAG} .
docker push {PATH_OF_DOCKER_NAME}:{TAG}

  1. Push the test file to Git Repo

  2. Modify the helm/values.yml file to set the image path, test file, repo...etc

Steps:

  1. Go to kubernetes cluster and assign the namespace kubectl config set-context --current --namespace={NAMESPACE}

  2. install the helm chart helm install {RELEASE_NAME} helm/

  3. Wait for the pods are ready, then forward the port to your local to access locust UI kubectl port-forward service/locust-service 8000:80

if you want to establish a public link to access the locust UI, you can use the following command to get the public IP and setup ingress
  1. open the http://localhost:8000/ on your browser then you should see the locust page with workers



All set. Enjoy it!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published