-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] add benchmarks to pipeline (#821)
* [WIP] add benchmarks to pipeline * debug yarn run * debug add timeout * add lightweight-bench.lua * run 5 tests in a row * run benchmark 10 minutes * add variables * move ci files; add artifacts * change image * add publish benchmark * fix pipeline * emulate specific metric * finish * fix rule * fix rules * fix fmt
- Loading branch information
Showing
2 changed files
with
285 additions
and
41 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
blocks = { | ||
'28831', -- Sudo setKey(0, -> 1) | ||
'29258', -- sudo.sudo(forceTransfer) | ||
'188836', -- sudo.sudoUncheckedWeight runtime upgrade(v5 generalized proxies identity) | ||
'197681', -- sudo.sudo(forceTransfer) | ||
'199405', -- sudo.sudoUncheckedWeight runtime upgrade(v6 council / sudo can move claims) | ||
'200732', -- sudo.sudo(batch assign indices) | ||
'214264', -- sudo.sudoUncheckedWeight runtime upgrade(v7 frozen indices) | ||
'214576', -- proxy sudo batch of transfers | ||
'243601', -- proxy sudo batch of transfers | ||
'244358', -- sudo.sudoUncheckedWeight runtime upgrade(v8 (un)reserve events) | ||
'287352', -- sudo.sudo forceTransfer | ||
'300532', -- proxy.addProxy for `Any` from sudo(direct to proxy module) | ||
'301569', -- proxy sudo mint claim | ||
'302396', -- proxy sudo set vested claim | ||
'303079', -- sudo.sudoUncheckedWeight runtime upgrade(v9 add vested forceTransfer and new origin filtering) | ||
'304468', -- proxy sudo set balance(W3F)(failed) | ||
'313396', -- proxy sudo set storage | ||
'314201', -- sudo.sudoUncheckedWeight runtime upgrade(v10 allow sudo to do anything(i.e.fix new filtering)) | ||
'314326', -- proxy sudo set balance(W3F) | ||
'325148', -- scheduler dispatched | ||
'326556', -- sudo.sudo force new era always | ||
'341469', -- proxy sudo force transfer | ||
'342400', -- sudo.sudoUncheckedWeight runtime upgrade(v11 scale validator count functions) | ||
'342477', -- sudo.sudo schedule regular validator set increases | ||
'442600', -- scheduler dispatched | ||
'443963', -- sudo.sudoUncheckedWeight runtime upgrade(v12 new staking rewards curve) | ||
'444722', -- proxy sudo batch of transfers | ||
'516904', -- sudo.sudo batch of transfers | ||
'528470', -- sudo.sudoUncheckedWeight runtime upgrade(v13 payout creates controller allow voting registrar proxy refactor as_sub) | ||
'543510', -- sudo.sudo force transfer | ||
'645697', -- proxy sudo batch of transfers | ||
'744556', -- proxy sudo batch of transfers | ||
'746085', -- sudo.sudoUncheckedWeight runtime upgrade(v15 enable council elections purchase) | ||
'746605', -- sudo.sudoAs add governance proxy | ||
'786421', -- sudo force transfer | ||
'787923', -- sudo.sudoUncheckedWeight runtime upgrade(v16 enable governance) | ||
'790128', -- proxy sudo batch of transfers | ||
'799302', -- runtime upgraded no more sudo | ||
'799310', -- after v17 | ||
} | ||
|
||
function shuffle(paths) | ||
local j, k | ||
local n = #paths | ||
|
||
for i = 1, n do | ||
j, k = math.random(n), math.random(n) | ||
paths[j], paths[k] = paths[k], paths[j] | ||
end | ||
|
||
return paths | ||
end | ||
|
||
counter = 1 | ||
|
||
request = function() | ||
local shuffle_data = shuffle(blocks) | ||
|
||
if counter > #shuffle_data then | ||
counter = 1 | ||
end | ||
|
||
local height = shuffle_data[counter] | ||
counter = counter + 1 | ||
|
||
local path = string.format('/blocks/%s', height) | ||
|
||
return wrk.format('GET', path) | ||
end | ||
|
||
delay = function() | ||
-- delay each request by 1 millisecond | ||
return 1 | ||
end | ||
|
||
done = function(summary, latency, requests) | ||
|
||
local bytes = summary.bytes | ||
local errors = summary.errors.status -- http status is not at the beginning of 200,300 | ||
local requests = summary.requests -- total requests | ||
|
||
print("--------------------------\n") | ||
print("Total completed requests: ", summary.requests) | ||
print("Failed requests: ", summary.errors.status) | ||
print("Timeouts: ", summary.errors.status) | ||
print("Average latency: ", (latency.mean/1000).."ms") | ||
print("--------------------------\n") | ||
print("Total completed requests: " .. requests .. "\n") | ||
print("Failed requests: " .. errors .. "\n") | ||
print("Timeouts: " .. errors .. "\n") | ||
print("Avg RequestTime(Latency): "..string.format("%.2f",latency.mean / 1000).."ms".."\n") | ||
print("Max RequestTime(Latency): "..(latency.max / 1000).."ms".."\n") | ||
print("Min RequestTime(Latency): "..(latency.min / 1000).."ms".."\n") | ||
print("--------------------------\n") | ||
print("AvgRequestTime(Latency,ms): "..string.format("%.2f",latency.mean / 1000).."\n") | ||
print("--------------------------\n") | ||
-- Save to a local txt file | ||
-- local file = io.open("./benchmarks/gcp-instance/sidecar-bench-results.txt", "w") | ||
-- file:write("Total completed requests: " .. requests .. "\n") | ||
-- file:write("Failed requests: " .. errors .. "\n") | ||
-- file:write("Timeouts: " .. errors .. "\n") | ||
-- file:write("Avg RequestTime(Latency): "..string.format("%.2f",latency.mean / 1000).."ms".."\n") | ||
-- file:write("Max RequestTime(Latency): "..(latency.max / 1000).."ms".."\n") | ||
-- file:write("Min RequestTime(Latency): "..(latency.min / 1000).."ms".."\n") | ||
-- file:write("--------------------------\n") | ||
-- file:close() | ||
end |