view third_party/wrk/scripts/counter.lua @ 182:d6ab5921fedc

Merging in changes I had on my mac related to JSON parser and MPC endpoints.
author June Park <parkjune1995@gmail.com>
date Fri, 23 Jan 2026 21:09:49 -0800
parents 94705b5986b3
children
line wrap: on
line source

-- 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