Last active
December 3, 2019 10:39
-
-
Save mariusmitrofan/3773afba00b68c07f470223682fb46ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: "alpine:3.10" | |
stages: | |
- load_test | |
variables: | |
API_KEY: your_api_key | |
TIMEOUT: 40 | |
before_script: | |
- apk add --no-cache curl jq | |
load_test: | |
stage: load_test | |
script: | |
- | | |
cat > start.json <<EOF | |
{ | |
"numClients": 500, | |
"hatchRate": 500, | |
"runTime": 30, | |
"maxThreads": 1, | |
"hostname": "netbears.com", | |
"protocol": "https", | |
"workflow": [ | |
{ | |
"path": "/devops/", | |
"method": "GET", | |
"headers": { | |
"Content-Type": "application/json" | |
} | |
} | |
] | |
} | |
EOF | |
curl \ | |
-X POST \ | |
-d "@start.json" \ | |
-H "x-api-key: ${API_KEY}" \ | |
-H "Content-Type: application/json" \ | |
https://beta.rungutan.com/start | jq -r .requestId > request_id | |
sleep ${TIMEOUT} | |
export request_id=$(cat request_id) | |
cat > results.json <<EOF | |
{ | |
"requestId": "${request_id}" | |
} | |
EOF | |
curl \ | |
-X POST \ | |
-d "@results.json" \ | |
-H "x-api-key: ${API_KEY}" \ | |
-H "Content-Type: application/json" \ | |
https://beta.rungutan.com/result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment