2024-04-18 09:21:07 +00:00
|
|
|
VUS ?= 20
|
|
|
|
DURATION ?= "200s"
|
|
|
|
ZITADEL_HOST ?=
|
|
|
|
ADMIN_LOGIN_NAME ?=
|
|
|
|
ADMIN_PASSWORD ?=
|
2024-10-17 19:15:55 +00:00
|
|
|
DATE := $(shell date '+%d-%H:%M:%S')
|
2024-04-18 09:21:07 +00:00
|
|
|
|
2024-10-15 12:26:16 +00:00
|
|
|
K6 := ./../../xk6-modules/k6
|
|
|
|
|
2024-04-18 09:21:07 +00:00
|
|
|
.PHONY: human_password_login
|
|
|
|
human_password_login: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/human_password_login.js --vus ${VUS} --duration ${DURATION} --out csv=output/human_password_login_${DATE}.csv
|
2024-04-18 09:21:07 +00:00
|
|
|
|
|
|
|
.PHONY: machine_pat_login
|
|
|
|
machine_pat_login: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/machine_pat_login.js --vus ${VUS} --duration ${DURATION} --out csv=output/machine_pat_login_${DATE}.csv
|
2024-04-18 09:21:07 +00:00
|
|
|
|
2024-07-09 15:16:50 +00:00
|
|
|
.PHONY: machine_client_credentials_login
|
|
|
|
machine_client_credentials_login: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/machine_client_credentials_login.js --vus ${VUS} --duration ${DURATION} --out csv=output/machine_client_credentials_login_${DATE}.csv
|
2024-07-09 15:16:50 +00:00
|
|
|
|
2024-04-18 09:21:07 +00:00
|
|
|
.PHONY: user_info
|
|
|
|
user_info: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/user_info.js --vus ${VUS} --duration ${DURATION} --out csv=output/user_info_${DATE}.csv
|
2024-04-18 09:21:07 +00:00
|
|
|
|
|
|
|
.PHONY: manipulate_user
|
|
|
|
manipulate_user: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/manipulate_user.js --vus ${VUS} --duration ${DURATION} --out csv=output/manipulate_user_${DATE}.csv
|
2024-04-18 09:21:07 +00:00
|
|
|
|
|
|
|
.PHONY: introspect
|
|
|
|
introspect: ensure_modules bundle
|
|
|
|
go install go.k6.io/xk6/cmd/xk6@latest
|
|
|
|
cd ../../xk6-modules && xk6 build --with xk6-zitadel=.
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/introspection.js --vus ${VUS} --duration ${DURATION} --out csv=output/introspect_${DATE}.csv
|
2024-04-18 09:21:07 +00:00
|
|
|
|
2024-07-09 15:16:50 +00:00
|
|
|
.PHONY: add_session
|
|
|
|
add_session: bundle
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/session.js --vus ${VUS} --duration ${DURATION} --out csv=output/add_session_${DATE}.csv
|
2024-08-27 13:06:03 +00:00
|
|
|
|
|
|
|
.PHONY: machine_jwt_profile_grant
|
|
|
|
machine_jwt_profile_grant: ensure_modules ensure_key_pair bundle
|
|
|
|
go install go.k6.io/xk6/cmd/xk6@latest
|
|
|
|
cd ../../xk6-modules && xk6 build --with xk6-zitadel=.
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/machine_jwt_profile_grant.js --vus ${VUS} --duration ${DURATION} --out csv=output/machine_jwt_profile_grant_${DATE}.csv
|
2024-07-09 15:16:50 +00:00
|
|
|
|
2024-09-11 09:23:24 +00:00
|
|
|
.PHONY: machine_jwt_profile_grant_single_user
|
|
|
|
machine_jwt_profile_grant_single_user: ensure_modules ensure_key_pair bundle
|
|
|
|
go install go.k6.io/xk6/cmd/xk6@latest
|
|
|
|
cd ../../xk6-modules && xk6 build --with xk6-zitadel=.
|
2024-10-17 19:15:55 +00:00
|
|
|
${K6} run --summary-trend-stats "min,avg,max,p(50),p(95),p(99)" dist/machine_jwt_profile_grant_single_user.js --vus ${VUS} --duration ${DURATION} --out csv=output/machine_jwt_profile_grant_single_user_${DATE}.csv
|
2024-09-11 09:23:24 +00:00
|
|
|
|
2024-04-18 09:21:07 +00:00
|
|
|
.PHONY: lint
|
|
|
|
lint:
|
|
|
|
npm i
|
|
|
|
npm run lint:fix
|
|
|
|
|
|
|
|
.PHONY: ensure_modules
|
|
|
|
ensure_modules:
|
|
|
|
ifeq (,$(wildcard $(PWD)/../../xk6-modules))
|
|
|
|
@echo "cloning xk6-modules"
|
|
|
|
cd ../.. && git clone https://github.com/zitadel/xk6-modules.git
|
|
|
|
endif
|
|
|
|
cd ../../xk6-modules && git pull
|
|
|
|
|
|
|
|
.PHONY: bundle
|
|
|
|
bundle:
|
2024-10-17 19:15:55 +00:00
|
|
|
mkdir -p output
|
2024-04-18 09:21:07 +00:00
|
|
|
npm i
|
2024-08-27 13:06:03 +00:00
|
|
|
npm run bundle
|
2024-10-15 12:26:16 +00:00
|
|
|
go install go.k6.io/xk6/cmd/xk6@latest
|
|
|
|
cd ../../xk6-modules && xk6 build --with xk6-zitadel=.
|
2024-08-27 13:06:03 +00:00
|
|
|
|
|
|
|
.PHONY: ensure_key_pair
|
|
|
|
ensure_key_pair:
|
|
|
|
ifeq (,$(wildcard $(PWD)/.keys))
|
|
|
|
mkdir .keys
|
|
|
|
endif
|
|
|
|
ifeq (,$(wildcard $(PWD)/.keys/key.pem))
|
|
|
|
openssl genrsa -out .keys/key.pem 2048
|
|
|
|
endif
|
|
|
|
ifeq (,$(wildcard $(PWD)/.keys/key.pem.pub))
|
|
|
|
openssl rsa -in .keys/key.pem -outform PEM -pubout -out .keys/key.pem.pub
|
2024-10-15 12:26:16 +00:00
|
|
|
endif
|