1
0
mirror of https://github.com/wg/wrk synced 2026-06-11 10:23:37 +08:00

add script setup() and thread methods

This commit is contained in:
Will
2015-02-07 17:03:17 +09:00
Unverified
parent 6f0aa32ede
commit 9b84d3e1a4
14 changed files with 386 additions and 153 deletions
+9 -1
View File
@@ -5,7 +5,8 @@ local wrk = {
method = "GET",
path = "/",
headers = {},
body = nil
body = nil,
thread = nil,
}
function wrk.resolve(host, service)
@@ -18,6 +19,13 @@ function wrk.resolve(host, service)
wrk.addrs = addrs
end
function wrk.setup(thread)
thread.addr = wrk.addrs[1]
if type(setup) == "function" then
setup(thread)
end
end
function wrk.init(args)
if not wrk.headers["Host"] then
local host = wrk.host