loadtest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLoadTestDone = fmt.Errorf("the load test is done")

ErrLoadTestDone indicates that the load test has run to completion.

Functions

func MergeLedgers

func MergeLedgers(dst *xdr.LedgerCloseMeta, src xdr.LedgerCloseMeta, getLedgerSeq func(cur uint32) uint32) error

MergeLedgers merges two xdr.LedgerCloseMeta instances. getLedgerSeq is used to determine the ledger sequence value for all ledger entries contained in src during the merge.

func UpdateLedgerSeqInLedgerEntries

func UpdateLedgerSeqInLedgerEntries(dest XDR, getUpdatedLedger func(uint32) uint32) error

UpdateLedgerSeqInLedgerEntries will traverse the ledger entries contained within dest and update any ledger sequence values that are found in the ledger entries. The new ledger sequence values will be determined by calling getUpdatedLedger().

Types

type LedgerBackend

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

LedgerBackend is used to load test ingestion. LedgerBackend will take a file of synthetically generated ledgers (see services/horizon/internal/integration/generate_ledgers_test.go) and replay them to the downstream ingesting system at a configurable rate. It is also possible to merge the synthetically generated ledgers with real ledgers from the network. To enable the merging behavior, configure the LedgerBackend field in LedgerBackendConfig.

func NewLedgerBackend

func NewLedgerBackend(config LedgerBackendConfig) *LedgerBackend

NewLedgerBackend constructs an LedgerBackend instance

func (*LedgerBackend) Close

func (r *LedgerBackend) Close() error

func (*LedgerBackend) GetLatestLedgerSequence

func (r *LedgerBackend) GetLatestLedgerSequence(ctx context.Context) (uint32, error)

func (*LedgerBackend) GetLedger

func (r *LedgerBackend) GetLedger(ctx context.Context, sequence uint32) (xdr.LedgerCloseMeta, error)

func (*LedgerBackend) IsPrepared

func (r *LedgerBackend) IsPrepared(ctx context.Context, ledgerRange ledgerbackend.Range) (bool, error)

func (*LedgerBackend) PrepareRange

func (r *LedgerBackend) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) error

type LedgerBackendConfig

type LedgerBackendConfig struct {
	// NetworkPassphrase is the passphrase of the Stellar network from where the real ledgers
	// will be obtained
	NetworkPassphrase string
	// LedgerBackend is an optional parameter. When LedgerBackend is configured, ledgers from
	// LedgerBackend will be merged with the synthetic ledgers from LedgersFilePath.
	LedgerBackend ledgerbackend.LedgerBackend
	// LedgersFilePath is a file containing the synthetic ledgers that will be replayed to
	// the downstream ingesting system.
	LedgersFilePath string
	// LedgerCloseDuration is the rate at which ledgers will be replayed from LedgerBackend
	LedgerCloseDuration time.Duration
}

LedgerBackendConfig configures LedgerBackend

Jump to

Keyboard shortcuts

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