-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
util/rich-indexer/src/tests/stress_test_scripts/get_cells.lua
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,34 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_cells", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", | ||
"hash_type": "type", | ||
"args": "0x5989ae415bb667931a99896e5fbbfad9ba53a223" | ||
}, | ||
"script_type": "lock", | ||
"script_search_mode": "exact" | ||
}, | ||
"asc", | ||
"0x64" | ||
] | ||
} | ||
]] | ||
|
||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_cells.lua --latency http://127.0.0.1:8114 |
32 changes: 32 additions & 0 deletions
32
util/rich-indexer/src/tests/stress_test_scripts/get_cells_capacity.lua
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,32 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_cells_capacity", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", | ||
"hash_type": "type", | ||
"args": "0x5989ae415bb667931a99896e5fbbfad9ba53a223" | ||
}, | ||
"script_type": "lock", | ||
"script_search_mode": "exact" | ||
} | ||
] | ||
} | ||
]] | ||
|
||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_cells_capacity.lua --latency http://127.0.0.1:8114 |
36 changes: 36 additions & 0 deletions
36
util/rich-indexer/src/tests/stress_test_scripts/get_cells_capacity_partial_mode.lua
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,36 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_cells_capacity", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494", | ||
"hash_type": "type", | ||
"args": "0x" | ||
}, | ||
"script_type": "type", | ||
"script_search_mode": "partial", | ||
"filter": { | ||
"output_data": "0x0000", | ||
"output_data_filter_mode": "partial" | ||
} | ||
} | ||
] | ||
} | ||
]] | ||
|
||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_cells_capacity_partial_mode.lua --latency http://127.0.0.1:8114 |
38 changes: 38 additions & 0 deletions
38
util/rich-indexer/src/tests/stress_test_scripts/get_cells_partial_mode.lua
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,38 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_cells", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494", | ||
"hash_type": "type", | ||
"args": "0x" | ||
}, | ||
"script_type": "type", | ||
"script_search_mode": "partial", | ||
"filter": { | ||
"output_data": "0x0000", | ||
"output_data_filter_mode": "partial" | ||
} | ||
}, | ||
"asc", | ||
"0x64" | ||
] | ||
} | ||
]] | ||
|
||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_cells_partial_mode.lua --latency http://127.0.0.1:8114 |
34 changes: 34 additions & 0 deletions
34
util/rich-indexer/src/tests/stress_test_scripts/get_transactions.lua
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,34 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_transactions", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8", | ||
"hash_type": "type", | ||
"args": "0x5989ae415bb667931a99896e5fbbfad9ba53a223" | ||
}, | ||
"script_type": "lock", | ||
"script_search_mode": "exact", | ||
"group_by_transaction": true | ||
}, | ||
"asc", | ||
"0x64" | ||
] | ||
} | ||
]] | ||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_transactions.lua --latency http://127.0.0.1:8114 |
38 changes: 38 additions & 0 deletions
38
util/rich-indexer/src/tests/stress_test_scripts/get_transactions_partial_mode.lua
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,38 @@ | ||
wrk.method = "POST" | ||
wrk.headers["Content-Type"] = "application/json" | ||
|
||
wrk.body = [[ | ||
{ | ||
"id": 2, | ||
"jsonrpc": "2.0", | ||
"method": "get_transactions", | ||
"params": [ | ||
{ | ||
"script": { | ||
"code_hash": "0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494", | ||
"hash_type": "type", | ||
"args": "0x" | ||
}, | ||
"script_type": "type", | ||
"script_search_mode": "partial", | ||
"group_by_transaction": true, | ||
"filter": { | ||
"output_data": "0x0000", | ||
"output_data_filter_mode": "partial" | ||
} | ||
}, | ||
"asc", | ||
"0x64" | ||
] | ||
} | ||
]] | ||
|
||
function response(status, headers, body) | ||
if (string.find(body, '"error"')) then | ||
print('error, resp: ', body) | ||
wrk.thread:stop() | ||
end | ||
end | ||
|
||
-- This command is run under the condition that the CPU has 4 cores | ||
-- wrk -t4 -c100 -d60s -s ./util/rich-indexer/src/tests/stress_test_scripts/get_transactions_partial_mode.lua --latency http://127.0.0.1:8114 |