Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeViper ¶
InitializeViper sets up Viper with CLI flags and defaults
func LoadSettings ¶
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 ¶
Duration wraps time.Duration to provide JSON unmarshaling support
func (Duration) MarshalJSON ¶
MarshalJSON implements json.Marshaler for Duration
func (Duration) ToDuration ¶
ToDuration converts Duration back to time.Duration
func (*Duration) UnmarshalJSON ¶
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 (*GasPicker) UnmarshalJSON ¶
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 ¶
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