Here we have a example of how implement a load test using Shell Scrip/Soroban CLI.
The main goal of load test is examines behavior under an expected high load, normally is simulating with multiple users accessing the program concurrently, and analyzing behavior under various conditions;
Was build Load Test under different conditions and collected the results, each test variable is described below:
- Scenario: Set of functions and parameters that will be executed in the tests.
- Parallel Accounts: Number of accounts executing requests in parallel
- Network:
- Testnet: Free-to-use network maintained by SDF that functions like the Pubnet but doesn’t connect to real money.
- Futurenet: Native smart contracts platform on the Stellar network, incentivized testing environment for first-wave developers;
- RPC: Service allows you to communicate directly with Soroban (live network gateway for Soroban);
- Local
- Remote
- Functions: Deposit, Swap, Withdraw, Get Resources.
Run the initialize.sh
script to deploy and initialize the liquidity pool contracts:
$ ./initialize.sh
This script will set up the necessary smart contracts and configure the initial state for the load test.
Adjust the load test configurations by editing the config.sh
file:
$ nano config.sh
Specify parameters such as the number of users, number of transactions, network, and any other relevant settings for your load test.
Execute the following command to start the load test:
$ make run
This will launch the load test using the configurations from config.sh
. The script will simulate user interactions with the liquidity pool based on the specified parameters.
Upon completion, the results of the load test will be saved in the invoke-log.csv file. You can analyze this file to review transaction details, response times, and other relevant metrics:
$ cat invoke-log.csv
View Previous Load Test Results
Feel free to analyze the data to gather insights into transaction performance, response times, and other relevant metrics.