Created
December 2, 2019 12:56
-
-
Save danielflira/ff9fe6e8e192cb669c5d11c34c9805a6 to your computer and use it in GitHub Desktop.
wrk strip to list request status
This file contains 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
local threads = {} | |
function setup(thread) | |
table.insert(threads, thread) | |
end | |
function init(args) | |
results = {} | |
end | |
function response(status) | |
if results[status] == nil then | |
results[status] = 0 | |
end | |
results[status] = results[status] + 1 | |
end | |
function done(summary, latency, requests) | |
local results = {} | |
for index, thread in ipairs(threads) do | |
local status_results = thread:get("results") | |
for k, v in pairs(status_results) do | |
if results[k] == nil then | |
results[k] = 0 | |
end | |
results[k] = results[k] + v | |
end | |
end | |
for i, k in pairs(results) do | |
print(i, k) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment