-
-
Save schfkt/43d61bee62e3d17276fe40ba32c3bf2c to your computer and use it in GitHub Desktop.
Random path benchmark Lua script for wrk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://github.com/wg/wrk | |
-- wrk -c 1000 -d 10s -s random-path-url.lua http://localhost:8080 | |
local paths = { | |
"/path1.txt", | |
"/path2.txt", | |
"/path3.txt", | |
"/path4.txt", | |
"/path5.txt", | |
"/path6.txt" | |
} | |
math.randomseed(os.time()) | |
randomPath = function() | |
local path = math.random(1,table.getn(paths)) | |
return paths[path] | |
end | |
request = function() | |
path = randomPath() | |
return wrk.format(nil, path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment