Skip to content

Commit

Permalink
scripts: Resolve benchmark build issues
Browse files Browse the repository at this point in the history
Signed-off-by: arekkas <[email protected]>
  • Loading branch information
arekkas committed Aug 6, 2018
1 parent e30d48b commit 2663d42
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/run-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ we have set \`BCRYPT_COST=8\`.
EOF

BCRYPT_COST=8 PORT=9000 ISSUER_URL=http://localhost:9000 DATABASE_URL=memory hydra serve --dangerous-force-http --disable-telemetry > /dev/null 2>&1 &
BCRYPT_COST=8 PUBLIC_PORT=9000 ADMIN_PORT=9001 ISSUER_URL=http://localhost:9000 DATABASE_URL=memory hydra serve --dangerous-force-http --disable-telemetry > /dev/null 2>&1 &

while ! echo exit | nc 127.0.0.1 9000; do sleep 1; done
while ! echo exit | nc 127.0.0.1 9001; do sleep 1; done

sleep 1

Expand All @@ -49,7 +50,7 @@ hydra clients create \
--id $clientId \
--secret $clientSecret \
-a foo \
--endpoint http://localhost:9000
--endpoint http://localhost:9001

echo "Generating initial access tokens for token introspection benchmark"
authToken=$(hydra token client --endpoint http://localhost:9000 --client-id $clientId --client-secret $clientSecret)
Expand All @@ -66,10 +67,9 @@ This section contains various benchmarks against OAuth 2.0 endpoints
EOF

hey -n $numReqs -c $numParallel -m POST \
-H "Authorization: Bearer $authToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "token=$introToken" \
http://localhost:9000/oauth2/introspect 2>&1 \
http://localhost:9001/oauth2/introspect 2>&1 \
| tee -a BENCHMARKS.md


Expand Down Expand Up @@ -108,7 +108,7 @@ EOF
##hey -n $numReqs -c $numParallel -m POST \
# -H "Content-Type: application/json" \
# -d '{}' \
# http://localhost:9000/clients 2>&1 \
# http://localhost:9001/clients 2>&1 \
# | tee -a BENCHMARKS.md

cat >> BENCHMARKS.md << EOF
Expand All @@ -120,7 +120,7 @@ cat >> BENCHMARKS.md << EOF
EOF

hey -n $numReqs -c $numParallel -m GET \
http://localhost:9000/clients 2>&1 \
http://localhost:9001/clients 2>&1 \
| tee -a BENCHMARKS.md

cat >> BENCHMARKS.md << EOF
Expand All @@ -132,7 +132,7 @@ cat >> BENCHMARKS.md << EOF
EOF

hey -n $numReqs -c $numParallel -m GET \
http://localhost:9000/clients/$clientId 2>&1 \
http://localhost:9001/clients/$clientId 2>&1 \
| tee -a BENCHMARKS.md

cat >> BENCHMARKS.md << EOF
Expand Down

0 comments on commit 2663d42

Please sign in to comment.