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:
+9
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user