wrk -c <user-count> -t <cpu-core-count> -d 10 --latency https://your-server/endpoint
wrk -s script.lua https://your-server/api/graphql
| wrk.method = "POST" | |
| wrk.headers["Content-Type"] = "application/json" | |
| wrk.headers["Accept"] = "application/json" | |
| query = [[ | |
| query books($ids: [Integer]) { | |
| books(ids: $ids) { | |
| id | |
| name | |
| price | |
| } | |
| } | |
| } | |
| ]] | |
| variables = [[ | |
| "ids": [1,2,3,4] | |
| ]] | |
| wrk.body ='{"query": "' .. string.gsub(query, '\n', '') .. '", "variables": {' .. string.gsub(variables, '\n', '') .. '} }' |