Performance Test Tool
Performance Test Tool is a python based project which is triggered by Locust Load Tests Framework.
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:
- setup the python environment
pip install -r requirements.txt
- prepare the test case file under the
tests
folder
ex: tests/locust_testfile.py
- 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
- execute the command to run the performance test
locust -f master.conf
- We use Helm to do deployment, so please check you have it.
Pre-Actions:
- 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}
-
Push the test file to Git Repo
-
Modify the
helm/values.yml
file to set the image path, test file, repo...etc
-
Go to kubernetes cluster and assign the namespace
kubectl config set-context --current --namespace={NAMESPACE}
-
install the helm chart
helm install {RELEASE_NAME} helm/
-
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
- open the
http://localhost:8000/
on your browser then you should see the locust page with workers
All set. Enjoy it!