Mercurial
comparison third_party/wrk/scripts/counter.lua @ 178:94705b5986b3
[ThirdParty] Added WRK and luajit for load testing.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Thu, 22 Jan 2026 20:10:30 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 177:24fe8ff94056 | 178:94705b5986b3 |
|---|---|
| 1 -- example dynamic request script which demonstrates changing | |
| 2 -- the request path and a header for each request | |
| 3 ------------------------------------------------------------- | |
| 4 -- NOTE: each wrk thread has an independent Lua scripting | |
| 5 -- context and thus there will be one counter per thread | |
| 6 | |
| 7 counter = 0 | |
| 8 | |
| 9 request = function() | |
| 10 path = "/" .. counter | |
| 11 wrk.headers["X-Counter"] = counter | |
| 12 counter = counter + 1 | |
| 13 return wrk.format(nil, path) | |
| 14 end |