config

package
v0.0.0-...-571cdb7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeViper

func InitializeViper(cmd *cobra.Command) error

InitializeViper sets up Viper with CLI flags and defaults

func LoadSettings

func LoadSettings(settings *Settings) error

LoadSettings reads and merges the config file into Viper

Types

type AccountConfig

type AccountConfig struct {
	NewAccountRate float64 `json:"newAccountRate,omitempty"`
	Accounts       int     `json:"count,omitempty"`
}

AccountConfig stores the configuration for account generation.

type Duration

type Duration time.Duration

Duration wraps time.Duration to provide JSON unmarshaling support

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler for Duration

func (Duration) ToDuration

func (d Duration) ToDuration() time.Duration

ToDuration converts Duration back to time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler for Duration

type FixedGasGenerator

type FixedGasGenerator struct {
	Gas uint64 `json:"Gas"`
}

func (*FixedGasGenerator) GenerateGas

func (f *FixedGasGenerator) GenerateGas() (uint64, error)

type GasPicker

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

func (*GasPicker) GenerateGas

func (g *GasPicker) GenerateGas() (uint64, error)

func (*GasPicker) Name

func (g *GasPicker) Name() string

func (*GasPicker) UnmarshalJSON

func (g *GasPicker) UnmarshalJSON(data []byte) error

type LoadConfig

type LoadConfig struct {
	ChainID int64 `json:"chainId,omitempty"`
	// SeiChainID is the textual chain ID used for tagging metric collection.
	SeiChainID string         `json:"seiChainID,omitempty"`
	Endpoints  []string       `json:"endpoints"`
	Accounts   *AccountConfig `json:"accounts,omitempty"`
	Scenarios  []Scenario     `json:"scenarios,omitempty"`
	MockDeploy bool           `json:"mockDeploy,omitempty"`
	Settings   *Settings      `json:"settings,omitempty"`
	// Path to write a JSON report of the load test.
	ReportPath string `json:"reportPath,omitempty"`
}

LoadConfig stores the configuration for load-related settings.

func (*LoadConfig) GetChainID

func (c *LoadConfig) GetChainID() *big.Int

GetChainID returns the chain ID as a big.Int.

type RandomGasGenerator

type RandomGasGenerator struct {
	Min uint64 `json:"Min"`
	Max uint64 `json:"Max"`
}

func (*RandomGasGenerator) GenerateGas

func (r *RandomGasGenerator) GenerateGas() (uint64, error)

type Scenario

type Scenario struct {
	Name            string         `json:"name,omitempty"`
	Weight          int            `json:"weight,omitempty"`
	Accounts        *AccountConfig `json:"accounts,omitempty"`
	GasPicker       *GasPicker     `json:"gasPicker,omitempty"`
	GasFeeCapPicker *GasPicker     `json:"gasFeeCapPicker,omitempty"`
	GasTipCapPicker *GasPicker     `json:"gasTipCapPicker,omitempty"`
}

Scenario represents each scenario in the load configuration.

type Settings

type Settings struct {
	Workers          int      `json:"workers,omitempty"`
	TPS              float64  `json:"tps,omitempty"`
	StatsInterval    Duration `json:"statsInterval,omitempty"`
	BufferSize       int      `json:"bufferSize,omitempty"`
	DryRun           bool     `json:"dryRun,omitempty"`
	Debug            bool     `json:"debug,omitempty"`
	TrackReceipts    bool     `json:"trackReceipts,omitempty"`
	TrackBlocks      bool     `json:"trackBlocks,omitempty"`
	TrackUserLatency bool     `json:"trackUserLatency,omitempty"`
	Prewarm          bool     `json:"prewarm,omitempty"`
	RampUp           bool     `json:"rampUp,omitempty"`
	ReportPath       string   `json:"reportPath,omitempty"`
	TxsDir           string   `json:"txsDir,omitempty"`
	TargetGas        uint64   `json:"targetGas,omitempty"`
	NumBlocksToWrite int      `json:"numBlocksToWrite,omitempty"`
}

Settings holds all CLI-configurable parameters

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the default configuration values

func ResolveSettings

func ResolveSettings() Settings

ResolveSettings gets the final resolved settings from Viper

Jump to

Keyboard shortcuts

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