Skip to content

Commit

Permalink
feat(mojaloop/#3398): Performance characterisation for ALS - Setup te…
Browse files Browse the repository at this point in the history
…st-cases

- re-factored k6 test-cases into a seperate package, which has clear seperation of scenarios, test-cases driving by a common test-config
- re-factored the docker compose for perf tests to split out the Callback-Handler-Svc into sepeerate dedicated simulators for Oracles, PayerDFSP, PayeeDFSP, and Central-Ledger Admin Services
- added a new perf.env config to store all perf related env vars
  • Loading branch information
mdebarros committed Jul 24, 2023
1 parent d89a1ff commit 05f14a7
Show file tree
Hide file tree
Showing 17 changed files with 692 additions and 66 deletions.
7 changes: 2 additions & 5 deletions .env
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
## Docker Image Versions

ML_API_ADAPTER_VERSION=v14.0.0
ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.2
QUOTING_SERVICE_VERSION=v15.0.2
CENTRAL_LEDGER_VERSION=v17.0.3

# Callback Handler SVC Env Vars
FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002
FSPIOP_FSP_ID=perffsp2
FSPIOP_CALLBACK_URL=http://callback-handler-svc:3001
7 changes: 4 additions & 3 deletions docker-compose-load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ services:
k6:
image: grafana/k6:0.45.0
env_file:
- ./docker/k6/.env
- .env
- perf.env
command:
- run
# - '--help' ## Useful to list run options
- '--include-system-env-vars'
- '/scripts/test-ws.js'
- '/scripts/index.js'
networks:
- load-net
- monitoring-net
Expand All @@ -34,4 +35,4 @@ services:
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true # Ref: https://k6.io/docs/results-output/real-time/prometheus-remote-write/#options
- K6_OUT=experimental-prometheus-rw # Ref: https://k6.io/docs/results-output/real-time/prometheus-remote-write/
volumes:
- ./docker/k6/scripts:/scripts
- ./packages/k6-tests:/scripts
145 changes: 142 additions & 3 deletions docker-compose-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ services:

account-lookup-service:
image: mojaloop/account-lookup-service:${ACCOUNT_LOOKUP_SERVICE_VERSION}
env_file:
- .env
- perf.env
scale: 1
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/account-lookup-service.js /opt/app/config/default.json && /opt/app/wait4/wait4.js account-lookup-service && npm run migrate && node src/index.js server"
# ports:
Expand Down Expand Up @@ -41,6 +44,9 @@ services:

mysql-als:
image: mysql/mysql-server
env_file:
- .env
- perf.env
container_name: mysql-als
ports:
- "3307:3306"
Expand All @@ -67,6 +73,9 @@ services:
## Testing Toolkit
mojaloop-testing-toolkit:
image: mojaloop/ml-testing-toolkit:v16.1.1
env_file:
- .env
- perf.env
volumes:
- "./docker/ml-testing-toolkit/spec_files:/opt/app/spec_files"
- "./docker/ml-testing-toolkit/test-cases:/opt/app/examples"
Expand All @@ -92,6 +101,9 @@ services:

mojaloop-testing-toolkit-ui:
image: mojaloop/ml-testing-toolkit-ui:v15.3.0
env_file:
- .env
- perf.env
ports:
- "6060:6060"
environment:
Expand All @@ -108,6 +120,9 @@ services:

ttk-provisioning:
image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0
env_file:
- .env
- perf.env
volumes:
- "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections"
- "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments"
Expand All @@ -127,17 +142,140 @@ services:
profiles:
- ttk-provisioning

callback-handler-svc:
## Generic Callback Handler Service
# callback-handler-svc:
# # scale: 1
# scale: 4
# image: mojaloop/callback-handler-svc:local
# env_file:
# - .env
# - perf.env
# build:
# context: ./packages/callback-handler-svc
# cache_from:
# - mojaloop/callback-handler-svc:local
# # ports:
# # - "3001:3001"
# networks:
# - mojaloop-net
# volumes:
# - ./packages/callback-handler-svc/config:/opt/app/config
# - ./packages/callback-handler-svc/handlers:/opt/app/handlers
# environment:
# - LOG_LEVEL=info
# healthcheck:
# test: wget -q http://localhost:3001/health -O /dev/null || exit 1
# timeout: 20s
# retries: 30
# interval: 15s
# user: root
# profiles:
# - simulators
# - callback-handler
# - all-services

callback-handler-svc-payee-sim:
scale: 1
image: mojaloop/callback-handler-svc:local
env_file:
- .env
- perf.env
build:
context: ./packages/callback-handler-svc
cache_from:
- mojaloop/callback-handler-svc:local
ports:
- "3001:3001"
# ports:
# - "3001:3001"
networks:
- mojaloop-net
volumes:
- ./packages/callback-handler-svc/config:/opt/app/config
- ./packages/callback-handler-svc/handlers:/opt/app/handlers
environment:
- LOG_LEVEL=info
healthcheck:
test: wget -q http://localhost:3001/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
user: root
profiles:
- simulators
- callback-handler
- all-services

callback-handler-svc-oracle-sim:
scale: 1
image: mojaloop/callback-handler-svc:local
env_file:
- .env
- perf.env
build:
context: ./packages/callback-handler-svc
cache_from:
- mojaloop/callback-handler-svc:local
# ports:
# - "3001:3001"
networks:
- mojaloop-net
volumes:
- ./packages/callback-handler-svc/config:/opt/app/config
- ./packages/callback-handler-svc/handlers:/opt/app/handlers
environment:
- LOG_LEVEL=info
healthcheck:
test: wget -q http://localhost:3001/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
user: root
profiles:
- simulators
- callback-handler
- all-services

callback-handler-svc-cl-sim:
scale: 1
image: mojaloop/callback-handler-svc:local
env_file:
- .env
- perf.env
build:
context: ./packages/callback-handler-svc
cache_from:
- mojaloop/callback-handler-svc:local
# ports:
# - "3001:3001"
networks:
- mojaloop-net
volumes:
- ./packages/callback-handler-svc/config:/opt/app/config
- ./packages/callback-handler-svc/handlers:/opt/app/handlers
environment:
- LOG_LEVEL=info
healthcheck:
test: wget -q http://localhost:3001/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
user: root
profiles:
- simulators
- callback-handler
- all-services

callback-handler-svc-payer-sim:
scale: 1
image: mojaloop/callback-handler-svc:local
env_file:
- .env
- perf.env
build:
context: ./packages/callback-handler-svc
cache_from:
- mojaloop/callback-handler-svc:local
# ports:
# - "3001:3001"
networks:
- mojaloop-net
volumes:
Expand All @@ -152,5 +290,6 @@ services:
interval: 15s
user: root
profiles:
- simulators
- callback-handler
- all-services
Loading

0 comments on commit 05f14a7

Please sign in to comment.