diff options
author | Ziv Scully <ziv@mit.edu> | 2015-11-17 04:08:12 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-11-17 04:08:12 -0500 |
commit | de5089fc5dfb8904ad3a8e36f042ce234ac9340b (patch) | |
tree | cee1595f198ba7db55df574115f548815cf60c02 /caching-tests/bench.lua | |
parent | 39804bcf37a35ca6a2cb5e49849ce9453c9025bc (diff) |
Ran a benchmark!
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 00000000..6799ca87 --- /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 |