Skip to content

Instantly share code, notes, and snippets.

@danielflira
Created December 2, 2019 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielflira/ff9fe6e8e192cb669c5d11c34c9805a6 to your computer and use it in GitHub Desktop.
Save danielflira/ff9fe6e8e192cb669c5d11c34c9805a6 to your computer and use it in GitHub Desktop.
wrk strip to list request status
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