Add end-to-end benchmaking

This commit is contained in:
Vikram Rangnekar
2019-06-17 01:58:00 -04:00
parent cd6d6f97a8
commit 4c07ad1102
9 changed files with 43 additions and 15 deletions

8
bench/bench.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if brew ls --versions wrk > /dev/null; then
wrk -t12 -c400 -d30s --timeout 10s --script=query.lua --latency http://localhost:8080/api/v1/graphql
else
brew install wek
wrk -t12 -c400 -d30s --timeout 10s --script=query.lua --latency http://localhost:8080/api/v1/graphql
fi

3
bench/query.lua Normal file
View File

@ -0,0 +1,3 @@
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json"
wrk.body = [[{"query":" { products( limit: 30, order_by: { price: desc }, distinct: [ price ] where: { id: { and: { greater_or_equals: 20, lt: 28 } } }) { id name price user { id email } } } "}]]