c

package
v1.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

README

Load testing

The C-chain load test entrypoint is in main.go.

It runs with 5 nodes and 5 "agents".

Each "agent" runs a transaction issuer and a transaction listener asynchronously, and is assigned uniformly to the nodes available, via websocket connections.

The load test picks at weighted random a transaction type to generate and issue, defined in issuer.go.

For some transaction types, this contract is deployed and transactions call functions of this contract. This contract has different functions, each testing a particular performance aspect of the EVM, for example memory writes.

From the load test perspective, only the TPS (transactions per second) is logged out. Metrics available are:

  • total transactions issued txs_issued
  • total transactions confirmed txs_confirmed
  • total transactions failed txs_failed
  • transaction latency histogram tx_latency

There are more interesting metrics available from the tmpnet nodes being load tested.

Finally, to run the load test, run:

# Install nix (skip this step if nix is already installed)
./scripts/run_task.sh install-nix
# Start the dev shell
nix develop
# Start the load test
task test-load

Visualize metrics in Grafana

Private remote instances

If you have the credentials (internal to Ava Labs) for the CI monitoring stack, you can visualize the metrics following these steps:

  1. Start a dev shell to ensure prometheus and promtail binaries are available to the test runner so it can use them to collect metrics and logs:

    nix develop
    
  2. Set your monitoring credentials using the credentials you can find in your password manager

    export PROMETHEUS_USERNAME=<username>
    export PROMETHEUS_PASSWORD=<password>
    export LOKI_USERNAME=<username>
    export LOKI_PASSWORD=<password>
    
  3. Run the load test:

    task test-load
    
  4. Prior to the test beginning, you will see the following log:

    INFO metrics and logs available via grafana (collectors must be running)     {"uri": "https://grafana-poc.avax-dev.network/d/eabddd1d-0a06-4ba1-8e68-a44504e37535/C-Chain%20Load?from=1747817500582&to=1747817952631&var-filter=network_uuid%7C%3D%7C4f419e3a-dba5-4ccd-b2fd-bda15f9826ff"}
    
  5. Open the URL in your browser, and log in with the Grafana credentials which you can find in your password manager.

For reference, see the tmpnet monitoring section

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer struct {
	// contains filtered or unexported fields
}

Issuer generates and issues transactions that randomly call the external functions of the contracts.EVMLoadSimulator contract instance that it deploys.

func NewIssuer

func NewIssuer(
	ctx context.Context,
	client *ethclient.Client,
	nonce uint64,
	key *ecdsa.PrivateKey,
) (*Issuer, error)

func (*Issuer) GenerateAndIssueTx

func (i *Issuer) GenerateAndIssueTx(ctx context.Context) (common.Hash, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL