Skip to content

Commit

Permalink
Run locust in the API container (headless mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaupetit committed Nov 21, 2024
1 parent fa38871 commit d9c5779
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ data/afirev-charging.csv: data
@echo "You should download CSV file from $(AFIREV_CHARGING_DATASET_URL)"

# -- Docker/compose
bench: ## run API benchmark
bench: run
$(COMPOSE_RUN_API_PIPENV) \
locust \
-f /mnt/bench/locustfile.py \
--headless \
-u 30 \
-r 1 \
--run-time 30s \
-H 'http://api:8000/api/v1' \
--csv bench_admin \
APIAdminUser
.PHONY: bench

bootstrap: ## bootstrap the project for development
bootstrap: \
build \
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ services:
volumes:
- ./src/api:/app
- ./data:/data
- ./src/bench:/mnt/bench
depends_on:
postgresql:
condition: service_healthy
Expand Down

0 comments on commit d9c5779

Please sign in to comment.