1
0
mirror of https://github.com/wg/wrk synced 2025-01-10 00:32:56 +08:00
wrk/scripts/counter.lua

15 lines
448 B
Lua
Raw Normal View History

2013-12-07 13:09:44 +08:00
-- example dynamic request script which demonstrates changing
-- the request path and a header for each request
-------------------------------------------------------------
-- NOTE: each wrk thread has an independent Lua scripting
-- context and thus there will be one counter per thread
counter = 0
request = function()
path = "/" .. counter
wrk.headers["X-Counter"] = counter
counter = counter + 1
return wrk.format(nil, path)
end