Documentation
¶
Index ¶
- Variables
- func RecordTPSSample(endpoint, chainID, scenario string, tps float64)
- type Dispatcher
- func (d *Dispatcher) GetStats() DispatcherStats
- func (d *Dispatcher) Prewarm(ctx context.Context) error
- func (d *Dispatcher) Run(ctx context.Context) error
- func (d *Dispatcher) RunBatch(ctx context.Context, count int) error
- func (d *Dispatcher) SetPrewarmGenerator(prewarmGen generator.Generator)
- func (d *Dispatcher) SetStatsCollector(collector *stats.Collector)
- type DispatcherStats
- type HttpClientOption
- type RampCurve
- type RampCurveStep
- type Ramper
- type ShardedSender
- func (s *ShardedSender) GetNumShards() int
- func (s *ShardedSender) GetWorkerStats() []WorkerStats
- func (s *ShardedSender) Run(ctx context.Context) error
- func (s *ShardedSender) Send(ctx context.Context, tx *types.LoadTx) error
- func (s *ShardedSender) SetDebug(debug bool)
- func (s *ShardedSender) SetDryRun(dryRun bool)
- func (s *ShardedSender) SetStatsCollector(collector *stats.Collector, logger *stats.Logger)
- func (s *ShardedSender) SetTrackBlocks(trackBlocks bool)
- func (s *ShardedSender) SetTrackReceipts(trackReceipts bool)
- type TxSender
- type TxWriteData
- type TxsWriter
- type Worker
- func (w *Worker) GetChannelLength() int
- func (w *Worker) GetEndpoint() string
- func (w *Worker) Run(ctx context.Context) error
- func (w *Worker) Send(ctx context.Context, tx *types.LoadTx) error
- func (w *Worker) SetDebug(debug bool)
- func (w *Worker) SetDryRun(dryRun bool)
- func (w *Worker) SetStatsCollector(collector *stats.Collector, logger *stats.Logger)
- func (w *Worker) SetTrackReceipts(trackReceipts bool)
- type WorkerStats
Constants ¶
This section is empty.
Variables ¶
var ErrRampTestFailedSLO = errors.New("ramp test failed SLO")
Functions ¶
func RecordTPSSample ¶
RecordTPSSample publishes the latest TPS sample read by the tps_achieved gauge.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher continuously generates transactions and dispatches them to the sender
func NewDispatcher ¶
func NewDispatcher(gen generator.Generator, sender TxSender) *Dispatcher
NewDispatcher creates a new dispatcher
func (*Dispatcher) GetStats ¶
func (d *Dispatcher) GetStats() DispatcherStats
GetStats returns dispatcher statistics
func (*Dispatcher) Prewarm ¶
func (d *Dispatcher) Prewarm(ctx context.Context) error
Prewarm runs the prewarm generator to completion before starting the main load test
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run(ctx context.Context) error
Start begins the dispatcher's transaction generation and sending loop
func (*Dispatcher) RunBatch ¶
func (d *Dispatcher) RunBatch(ctx context.Context, count int) error
StartBatch generates and sends a specific number of transactions then stops
func (*Dispatcher) SetPrewarmGenerator ¶
func (d *Dispatcher) SetPrewarmGenerator(prewarmGen generator.Generator)
SetPrewarmGenerator sets the prewarm generator for this dispatcher
func (*Dispatcher) SetStatsCollector ¶
func (d *Dispatcher) SetStatsCollector(collector *stats.Collector)
SetStatsCollector sets the statistics collector for this dispatcher
type DispatcherStats ¶
type DispatcherStats struct {
TotalSent uint64
}
DispatcherStats contains statistics for the dispatcher
type HttpClientOption ¶
HttpClientOption configures the Transport used by newHttpClient.
func WithMaxIdleConns ¶
func WithMaxIdleConns(n int) HttpClientOption
WithMaxIdleConns overrides the global idle-connection pool size.
func WithMaxIdleConnsPerHost ¶
func WithMaxIdleConnsPerHost(n int) HttpClientOption
WithMaxIdleConnsPerHost overrides the per-host idle-connection pool size. Scale with goroutine count to avoid TCP re-dial on each completion.
type RampCurve ¶
RampCurve is a function that returns the target TPS at a given time in the ramp period
type RampCurveStep ¶
type RampCurveStep struct {
StartTps float64
IncrementTps float64
LoadInterval time.Duration
RecoveryInterval time.Duration
Step int
CurrentTPS float64
}
func NewRampCurveStep ¶
func (*RampCurveStep) GetCurveStats ¶
func (r *RampCurveStep) GetCurveStats() string
this should return the highest target TPS that is PRIOR to the current step
func (*RampCurveStep) GetIncrementTps ¶
func (r *RampCurveStep) GetIncrementTps() float64
func (*RampCurveStep) GetStartTps ¶
func (r *RampCurveStep) GetStartTps() float64
type Ramper ¶
type Ramper struct {
// contains filtered or unexported fields
}
func (*Ramper) FormatRampStats ¶
func (*Ramper) LogFinalStats ¶
func (r *Ramper) LogFinalStats()
type ShardedSender ¶
type ShardedSender struct {
// contains filtered or unexported fields
}
ShardedSender implements TxSender with multiple workers, one per endpoint
func NewShardedSender ¶
func NewShardedSender(cfg *config.LoadConfig, bufferSize int, workers int, limiter *rate.Limiter) (*ShardedSender, error)
NewShardedSender creates a new sharded sender with workers for each endpoint
func (*ShardedSender) GetNumShards ¶
func (s *ShardedSender) GetNumShards() int
GetNumShards returns the number of shards (workers)
func (*ShardedSender) GetWorkerStats ¶
func (s *ShardedSender) GetWorkerStats() []WorkerStats
GetWorkerStats returns statistics for all workers
func (*ShardedSender) Run ¶
func (s *ShardedSender) Run(ctx context.Context) error
Start initializes and starts all workers
func (*ShardedSender) Send ¶
Send implements TxSender interface - calculates shard ID and routes to appropriate worker
func (*ShardedSender) SetDebug ¶
func (s *ShardedSender) SetDebug(debug bool)
func (*ShardedSender) SetDryRun ¶
func (s *ShardedSender) SetDryRun(dryRun bool)
SetDryRun sets the dry-run flag for the sender and its workers
func (*ShardedSender) SetStatsCollector ¶
func (s *ShardedSender) SetStatsCollector(collector *stats.Collector, logger *stats.Logger)
SetStatsCollector sets the statistics collector for all workers
func (*ShardedSender) SetTrackBlocks ¶
func (s *ShardedSender) SetTrackBlocks(trackBlocks bool)
SetTrackBlocks sets the track-blocks flag (placeholder - blocks are tracked separately)
func (*ShardedSender) SetTrackReceipts ¶
func (s *ShardedSender) SetTrackReceipts(trackReceipts bool)
SetTrackReceipts sets the track-receipts flag for the sender and its workers
type TxWriteData ¶
type TxWriteData struct {
TxPayloads [][]byte `json:"tx_payloads"`
}
type TxsWriter ¶
type TxsWriter struct {
// contains filtered or unexported fields
}
func NewTxsWriter ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker handles sending transactions to a specific endpoint
func NewWorker ¶
func NewWorker(id int, seiChainID string, endpoint string, bufferSize int, workers int, limiter *rate.Limiter) *Worker
NewWorker creates a new worker for a specific endpoint
func (*Worker) GetChannelLength ¶
GetChannelLength returns the current length of the worker's channel (for monitoring). This function is safe for concurrent calls.
func (*Worker) GetEndpoint ¶
GetEndpoint returns the worker's endpoint
func (*Worker) SetStatsCollector ¶
SetStatsCollector sets the statistics collector for this worker
func (*Worker) SetTrackReceipts ¶
SetTrackReceipts sets the track-receipts mode for the worker
type WorkerStats ¶
WorkerStats contains statistics for a single worker