* add tps * get block build metrics * Add issuance time, confirmed time, issued-> acceptance time, verify time * Log times at end of batch * cleaner * address comments * remove unused code block * avoids taking len of channel * nits * pass in stringID * move to loader * remove unused field * revert file back * cleaner * lint * make it work for ws or for rpc * protect * endpoint * no return on defer * sep to a funciton * have blockchainidstr passed in * typo * pass in metrics through config * address comments * address more comments and edit err policy of metrics functions * add more logging to load_test * typo * better check * fix endpoints * typo: * individual * histogram * address feedback: * remove metrics from default * address comments * simplify time metrics * better explanation * address comments * address comments * cleanup * more cleanup * rename vars for clarity * ws * cleanup * address comments * ws * expose metrics add flag * fix blocking issue of http server and gracefully stop it * cleanup * use constant * add issuance to confirmation metrics * ws * simplify metrics server * Bump avalanchego to v1.10.5 and bump Subnet-EVM for v0.5.3 release (#757) * Bump avalanchego to v1.10.5 and bump Subnet-EVM for v0.5.3 release * bump anr version to v1.7.1 * handle control c * print out output * clean up * clean up * remove go routines to close client * address comments * memory leak * fix * print
Load Simulator
When building developing your own blockchain using subnet-evm, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed cmd/simulator. cmd/simulator lets you drive arbitrary load across any number of [endpoints] with a user-specified keys directory (insecure) timeout, workers, max-fee-cap, and max-tip-cap.
Building the Load Simulator
To build the load simulator, navigate to the base of the simulator directory:
cd $GOPATH/src/github.com/ava-labs/subnet-evm/cmd/simulator
Build the simulator:
go build -o ./simulator main/*.go
To confirm that you built successfully, run the simulator and print the version:
./simulator --version
This should give the following output:
v0.1.0
To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and Subnet-EVM, so we will start a single node network and run the load simulator on the C-Chain.
To start a single node network, follow the instructions from the AvalancheGo README to build from source.
Once you've built AvalancheGo, open the AvalancheGo directory in a separate terminal window and run a single node non-staking network with the following command:
./build/avalanchego --sybil-protection-enabled=false --network-id=local
WARNING:
The staking-enabled flag is only for local testing. Disabling staking serves two functions explicitly for testing purposes:
- Ignore stake weight on the P-Chain and count each connected peer as having a stake weight of 1
- Automatically opts in to validate every Subnet
Once you have AvalancheGo running locally, it will be running an HTTP Server on the default port 9650. This means that the RPC Endpoint for the C-Chain will be http://127.0.0.1:9650/ext/bc/C/rpc and ws://127.0.0.1:9650/ext/bc/C/ws for WebSocket connections.
Now, we can run the simulator command to simulate some load on the local C-Chain for 30s:
./simulator --timeout=1m --workers=1 --max-fee-cap=300 --max-tip-cap=10 --txs-per-worker=50
Command Line Flags
To see all of the command line flag options, run
./simulator --help