loadbot

package
v0.7.1-alpha1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 28 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 added in v0.3.0

func GetCommand() *cobra.Command

Types

type Account

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

type BlockGasMetrics added in v0.3.3

type BlockGasMetrics struct {
	sync.Mutex

	Blocks map[uint64]GasMetrics
}

func (*BlockGasMetrics) AddBlockMetric added in v0.3.3

func (b *BlockGasMetrics) AddBlockMetric(blockNum uint64, gasMetric GasMetrics)

AddBlockMetric adds a block gas metric for the specified block number [Thread safe]

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 added in v0.3.3

type ContractMetricsData struct {
	FailedContractTransactionsCount uint64
	ContractDeploymentDuration      ExecDuration
	ContractAddress                 ethgo.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 added in v0.3.3

type GasMetrics struct {
	GasUsed     uint64
	GasLimit    uint64
	Utilization float64
}

type Loadbot

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

func NewLoadbot added in v0.3.0

func NewLoadbot(cfg *Configuration) *Loadbot

func (*Loadbot) GetGenerator added in v0.3.0

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

func (*Loadbot) GetMetrics added in v0.3.0

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        ethgo.Address        `json:"contract_address,omitempty"`
	ContractBlockData      TxnBlockData         `json:"contract_block_data,omitempty"`
}

func (*LoadbotResult) GetOutput added in v0.3.0

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