diff --git a/benchmarks/README.md b/benchmarks/README.md index 1cb89c8ee..e9f2a47b6 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -77,6 +77,8 @@ sudo cp wrk /usr/local/bin In order to run each benchmark you should `cd` into the appropriate directory you want to run, set the `WRK_TIME_LENGTH` env var (ex: `export WRK_TIME_LENGTH=30s`) and then `sh init.sh`. You are required to have sidecar running, as well as a fully synced archive node. +NOTE: Some benchmarks might have multiple `sh` scripts with different names in order to run specific benchmarks. + ### Running via Scripts (Root) Below are flags, and examples on how to run these benchmarks from the root of the repository. See /scripts/README.md for more information. diff --git a/benchmarks/blocksBlockId/benchHighLoadBlocks.lua b/benchmarks/blocksBlockId/benchHighLoadBlocks.lua new file mode 100644 index 000000000..9b8d45b67 --- /dev/null +++ b/benchmarks/blocksBlockId/benchHighLoadBlocks.lua @@ -0,0 +1,25 @@ +-- Copyright 2017-2023 Parity Technologies (UK) Ltd. +-- This file is part of Substrate API Sidecar. +-- +-- Substrate API Sidecar is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package.path = package.path .. ";../util/util.lua" +local util = require('util') +local highLoadBlocks = require('highLoadBlocks') + +request = util.request(highLoadBlocks, '/blocks/%s') + +delay = util.delay + +done = util.done() diff --git a/benchmarks/blocksBlockId/blocks.lua b/benchmarks/blocksBlockId/blocks.lua index b28025616..1d82ced5f 100644 --- a/benchmarks/blocksBlockId/blocks.lua +++ b/benchmarks/blocksBlockId/blocks.lua @@ -14,6 +14,8 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . +local highLoadBlocks = require('highLoadBlocks') + local blocks = { '28831', -- Sudo setKey(0, -> 1) '29258', -- sudo.sudo(forceTransfer) @@ -58,6 +60,7 @@ local blocks = { '1603025', -- staking.withdrawUnbonded '6800002', -- blocks.transfer '11873016', -- vesting.vest + unpack(highLoadBlocks) } return blocks diff --git a/benchmarks/blocksBlockId/highLoadBlocks.lua b/benchmarks/blocksBlockId/highLoadBlocks.lua new file mode 100644 index 000000000..181863a8a --- /dev/null +++ b/benchmarks/blocksBlockId/highLoadBlocks.lua @@ -0,0 +1,50 @@ +-- Copyright 2017-2023 Parity Technologies (UK) Ltd. +-- This file is part of Substrate API Sidecar. +-- +-- Substrate API Sidecar is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +local highLoadBlocks = { + '18687076', -- 414 extrinsics + '18687064', -- 404 extrinsics + '18687053', -- 402 extrinsics + '18687063', -- 435 extrinsics + '18687111', -- 460 extrinsics + '18687104', -- 274 extrinsics + '18687099', -- 288 extrinsics + '18687162', -- 436 extrinsics + '18687150', -- 409 extrinsics + '18687146', -- 358 extrinsics + '18687186', -- 416 extrinsics + '18687181', -- 306 extrinsics + '18687219', -- 458 extrinsics + '18687214', -- 292 extrinsics + '18687212', -- 341 extrinsics + '18687264', -- 401 extrinsics + '18687255', -- 437 extrinsics + '18687246', -- 276 extrinsics + '18687338', -- 488 extrinsics + '18687370', -- 512 extrinsics + '18687387', -- 484 extrinsics + '18687436', -- 352 extrinsics + '18687425', -- 372 extrinsics + '18687507', -- 402 extrinsics + '18687526', -- 266 extrinsics + '18687604', -- 348 extrinsics + '18687639', -- 489 extrinsics + '18687630', -- 524 extrinsics + '18687692', -- 377 extrinsics + '18687712', -- 349 extrinsics +} + +return highLoadBlocks diff --git a/benchmarks/blocksBlockId/highLoadInit.sh b/benchmarks/blocksBlockId/highLoadInit.sh new file mode 100644 index 000000000..75ea3350f --- /dev/null +++ b/benchmarks/blocksBlockId/highLoadInit.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +wrk -d$WRK_TIME_LENGTH -t4 -c6 --timeout 120s --latency -s ./benchHighLoadBlocks.lua http://127.0.0.1:8080