Last active
August 29, 2015 14:04
-
-
Save dead-horse/7275f5c03ca71513b7e5 to your computer and use it in GitHub Desktop.
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 file = io.open("urls.txt", "r"); | |
local arr = {} | |
local lines = file:lines() | |
for line in file:lines() do | |
table.insert (arr, line); | |
end | |
local i = 0 | |
request = function() | |
i = (i % #arr) + 1 | |
return wrk.format(nil, arr[i]) | |
end | |
done = function(summary, latency, requests) | |
io.write("------------------------------\n") | |
for _, p in pairs({ 50, 90, 99, 99.999 }) do | |
n = latency:percentile(p) | |
io.write(string.format("%g%%,%d\n", p, n)) | |
end | |
io.write("-------------------------------\n") | |
local errors = summary.errors | |
io.write(string.format("ERRORS:\nconntect:%d, read:%d, write:%d, timeout:%d\n\n", errors.connect, errors.read, errors.read, errors.timeout)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment