finalised script to run benchmark
This commit is contained in:
parent
8c6666a2bb
commit
aeff3d23b8
10 changed files with 500 additions and 3 deletions
36
scripts/fullrunV2.lua
Normal file
36
scripts/fullrunV2.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
local proto = { "http://", "https://" }
|
||||
local sizes = { "1kb", "10kb", "100kb", "1000kb" }
|
||||
local testUrl = "test.fluffyb.net"
|
||||
|
||||
local current_proto = 1
|
||||
local current_size = 1
|
||||
|
||||
function init(args)
|
||||
current_proto = 1
|
||||
current_size = 1
|
||||
end
|
||||
|
||||
function request()
|
||||
-- Build the URL using the current protocol and file size
|
||||
local url = proto[current_proto] .. testUrl .. "/" .. sizes[current_size] .. ".file"
|
||||
|
||||
-- Move to the next size
|
||||
current_size = current_size + 1
|
||||
|
||||
-- If we've gone through all sizes, move to the next protocol and reset size
|
||||
if current_size > #sizes then
|
||||
current_size = 1
|
||||
current_proto = current_proto + 1
|
||||
end
|
||||
|
||||
-- If we've gone through all protocols, reset everything (looping back)
|
||||
if current_proto > #proto then
|
||||
current_proto = 1
|
||||
end
|
||||
|
||||
return wrk.format("GET", url)
|
||||
end
|
||||
|
||||
function done(summary, latency, requests)
|
||||
io.write(string.format("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n\n",latency.min,latency.mean,latency.max,latency.stdev,latency:percentile(50),latency:percentile(70),latency:percentile(90),latency:percentile(99),summary.requests,summary.bytes))
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue