Created
January 7, 2018 12:30
-
-
Save bloatfan/5159d04c330c7f3131eac65b7aeaea67 to your computer and use it in GitHub Desktop.
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
local threads = {} | |
setup = function (thread) | |
table.insert(threads, thread) | |
end | |
init = function (args) | |
results = {} | |
end | |
response = function (status, headers, body) | |
if (results[status] == nil) then | |
results[status] = 1 | |
else | |
results[status] = results[status] + 1 | |
end | |
end | |
done = function (summary, latency, requests) | |
local output = {} | |
for index, thread in ipairs(threads) do | |
local results = thread:get('results') | |
for status, count in pairs(results) do | |
if (output[status] == nil) then | |
output[status] = results[status] | |
else | |
output[status] = output[status] + results[status] | |
end | |
end | |
end | |
for status, count in pairs(output) do | |
print(status, ':', count) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment