loadbot

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERC20ABI = `` /* 5512-byte string literal not displayed */

	//nolint:lll
	ERC20BIN = "" /* 10442-byte string literal not displayed */

	ERC721ABI = `` /* 7531-byte string literal not displayed */

	//nolint:lll
	ERC721BIN = "" /* 24336-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func GetCommand

func GetCommand() *cobra.Command

Types

type Account

type Account struct {
	Address    types.Address
	PrivateKey *ecdsa.PrivateKey
}

type BlockGasMetrics

type BlockGasMetrics struct {
	Blocks        map[uint64]GasMetrics
	BlockGasMutex *sync.Mutex
}

type Configuration

type Configuration struct {
	TPS              uint64
	Sender           types.Address
	Receiver         types.Address
	Value            *big.Int
	Count            uint64
	JSONRPC          string
	GRPC             string
	MaxConns         int
	GeneratorMode    Mode
	ChainID          uint64
	GasPrice         *big.Int
	GasLimit         *big.Int
	ContractArtifact *generator.ContractArtifact
	ConstructorArgs  []byte // smart contract constructor args
	MaxWait          uint64 // max wait time for receipts in minutes
}

type ContractMetricsData

type ContractMetricsData struct {
	FailedContractTransactionsCount uint64
	ContractDeploymentDuration      ExecDuration
	ContractAddress                 web3.Address
	ContractGasMetrics              *BlockGasMetrics
}

type ExecDuration

type ExecDuration struct {

	// AverageTurnAround is the average turn around time for all passing transactions
	AverageTurnAround time.Duration

	// FastestTurnAround is the fastest turn around time recorded for a transaction
	FastestTurnAround time.Duration

	// SlowestTurnAround is the slowest turn around time recorded for a transaction
	SlowestTurnAround time.Duration

	// TotalExecTime is the total execution time for a single loadbot run
	TotalExecTime time.Duration
	// contains filtered or unexported fields
}

type GasMetrics

type GasMetrics struct {
	GasUsed     uint64
	GasLimit    uint64
	Utilization float64
}

type Loadbot

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

func NewLoadbot

func NewLoadbot(cfg *Configuration) *Loadbot

func (*Loadbot) GetGenerator

func (l *Loadbot) GetGenerator() generator.TransactionGenerator

func (*Loadbot) GetMetrics

func (l *Loadbot) GetMetrics() *Metrics

func (*Loadbot) Run

func (l *Loadbot) Run() error

type LoadbotResult

type LoadbotResult struct {
	CountData              TxnCountData         `json:"count_data"`
	TurnAroundData         TxnTurnAroundData    `json:"turn_around_data"`
	ContractTurnAroundData TxnTurnAroundData    `json:"contract_turn_around_data"`
	BlockData              TxnBlockData         `json:"block_data"`
	DetailedErrorData      TxnDetailedErrorData `json:"detailed_error_data,omitempty"`
	ApproxTPS              uint64               `json:"approx_tps"`
	ContractAddress        web3.Address         `json:"contract_address,omitempty"`
	ContractBlockData      TxnBlockData         `json:"contract_block_data,omitempty"`
}

func (*LoadbotResult) GetOutput

func (lr *LoadbotResult) GetOutput() string

type Metrics

type Metrics struct {
	TotalTransactionsSentCount uint64
	FailedTransactionsCount    uint64
	TransactionDuration        ExecDuration
	ContractMetrics            ContractMetricsData
	GasMetrics                 *BlockGasMetrics
}

type Mode

type Mode string

type TxnBlockData

type TxnBlockData struct {
	// BlocksRequired is the required number of blocks to seal the data
	BlocksRequired uint64 `json:"blocks_required"`

	// BlockTransactionsMap maps the block number to the number of loadbot transactions in it
	BlockTransactionsMap map[uint64]uint64 `json:"block_transactions_map"`

	// Total amount of gas used in block
	GasData map[uint64]GasMetrics `json:"gas_used"`
}

type TxnCountData

type TxnCountData struct {
	Total  uint64 `json:"total"`
	Failed uint64 `json:"failed"`
}

type TxnDetailedErrorData

type TxnDetailedErrorData struct {
	// DetailedErrorMap groups transaction errors by error type, with each transaction hash
	// mapping to its specific error
	DetailedErrorMap map[generator.TxnErrorType][]*generator.FailedTxnInfo `json:"detailed_error_map"`
}

type TxnTurnAroundData

type TxnTurnAroundData struct {
	FastestTurnAround float64 `json:"fastest_turn_around"`
	SlowestTurnAround float64 `json:"slowest_turn_around"`
	AverageTurnAround float64 `json:"average_turn_around"`
	TotalExecTime     float64 `json:"total_exec_time"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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