Last active
July 19, 2022 04:52
-
-
Save sonufrienko/4354a67b59987086c95bd252d5580a66 to your computer and use it in GitHub Desktop.
Revisions
-
sonufrienko revised this gist
Jul 19, 2022 . 2 changed files with 12 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ## Basic use ``` wrk -c <user-count> -t <cpu-core-count> -d 10 --latency https://your-server/endpoint ``` ## GraphQL API ``` wrk -s script.lua https://your-server/api/graphql ``` This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,3 @@ wrk.method = "POST" wrk.headers["Content-Type"] = "application/json" wrk.headers["Accept"] = "application/json" @@ -28,5 +15,4 @@ query = [[ variables = [[ "ids": [1,2,3,4] ]] wrk.body ='{"query": "' .. string.gsub(query, '\n', '') .. '", "variables": {' .. string.gsub(variables, '\n', '') .. '} }' -
sonufrienko created this gist
Jul 19, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ # Basic use ``` wrk -c <user-count> -t <cpu-core-count> -d 10 --latency https://your-server/endpoint ``` # GraphQL API ``` wrk -s script.lua https://your-server/api/graphql ``` ```lua 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', '') .. '} }' ```