Created
August 14, 2018 02:15
-
-
Save zhu327/6bb6d56ed379b36534c6db4365dbb431 to your computer and use it in GitHub Desktop.
logging response from wrk
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 characters
wrk.path = "/rest/ping" | |
wrk.method = "POST" | |
wrk.body = "id=7579764573763278289&platformid=ANDROID&version=1.0.0" | |
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded" | |
wrk.headers["deviceid"] = "354435052821931" | |
wrk.headers["Accept"] = "application/json" | |
logfile = io.open("wrk.log", "w"); | |
local cnt = 0; | |
response = function(status, header, body) | |
logfile:write("status:" .. status .. "\n"); | |
cnt = cnt + 1; | |
logfile:write("status:" .. status .. "\n" .. body .. "\n-------------------------------------------------\n"); | |
end | |
done = function(summary, latency, requests) | |
logfile:write("------------- SUMMARY -------------\n") | |
print("Response count: ", cnt) | |
logfile.close(); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment