diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2017-07-23 09:50:04 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2017-07-23 09:50:04 -0400 |
commit | 0cccdb0ae595cd7e3e136e984ac7b95b99f71a53 (patch) | |
tree | 491d3b13813610943c60460d3e178d3a73916346 /caching-tests/bench.lua |
Import urweb_20170720+dfsg.orig.tar.gz
[dgit import orig urweb_20170720+dfsg.orig.tar.gz]
Diffstat (limited to 'caching-tests/bench.lua')
-rw-r--r-- | caching-tests/bench.lua | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/caching-tests/bench.lua b/caching-tests/bench.lua new file mode 100644 index 0000000..6799ca8 --- /dev/null +++ b/caching-tests/bench.lua @@ -0,0 +1,25 @@ +math.randomseed(os.time()) + +p = 0.25 +n = 2000 + +function init(args) + if args[1] then + p = tonumber(args[1]) + end + if args[2] then + n = tonumber(args[2]) + end +end + +function request() + path = "/Bench/" + if math.random() < p then + path = path .. "flush" + else + path = path .. "check" + end + id = math.random(n) + path = path .. "/" .. id + return wrk.format(nil, path) +end |