Documentation
¶
Index ¶
- Variables
- func MergeLedgers(dst *xdr.LedgerCloseMeta, src xdr.LedgerCloseMeta, ...) error
- func UpdateLedgerSeqInLedgerEntries(dest XDR, getUpdatedLedger func(uint32) uint32) error
- type FileLedgerCount
- type LedgerBackend
- func (r *LedgerBackend) Close() error
- func (r *LedgerBackend) GetLatestLedgerSequence(ctx context.Context) (uint32, error)
- func (r *LedgerBackend) GetLedger(ctx context.Context, sequence uint32) (xdr.LedgerCloseMeta, error)
- func (r *LedgerBackend) IsPrepared(ctx context.Context, ledgerRange ledgerbackend.Range) (bool, error)
- func (r *LedgerBackend) PrepareRange(ctx context.Context, ledgerRange ledgerbackend.Range) error
- type LedgerBackendConfig
- type Options
- type Results
- type XDR
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 FileLedgerCount ¶ added in v0.7.0
FileLedgerCount reports how many ledgers a single bundle contributes to a replay.
func CountLedgersPerFile ¶ added in v0.7.0
func CountLedgersPerFile(paths []string, perFileLimit uint32) ([]FileLedgerCount, error)
CountLedgersPerFile returns, for each path, the number of ledgers that would be replayed under perFileLimit — the same per-file cap PrepareRange applies. Sum the counts for the total replay length, or use them as per-bundle segment bounds.
type LedgerBackend ¶
type LedgerBackend struct {
// contains filtered or unexported fields
}
LedgerBackend is used to load test ingestion. LedgerBackend will take one or more files 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 LedgersFilePaths.
LedgerBackend ledgerbackend.LedgerBackend
// LedgersFilePaths are the files containing the synthetic ledgers that will be replayed,
// in order, to the downstream ingesting system.
LedgersFilePaths []string
// LedgerCloseDuration is the rate at which ledgers will be replayed from LedgerBackend
LedgerCloseDuration time.Duration
// MaxLedgersPerFile optionally caps how many ledgers are replayed from each file in
// LedgersFilePaths. When 0, or greater than the ledgers a file holds, all of its
// ledgers are replayed.
MaxLedgersPerFile uint32
}
LedgerBackendConfig configures LedgerBackend
type Results ¶ added in v0.6.0
func ApplyLoad ¶ added in v0.6.0
ApplyLoad runs stellar-core's apply-load against the supplied config and writes benchmark ledgers + fixture entries to OutputPath / FixturesPath.
Required: ConfigPath, OutputPath, FixturesPath. Optional: CoreBinaryPath (looked up in PATH), Logger, WorkDirPath (temp dir if unspecified). The supplied config's [HISTORY] commands must publish to a `history/` subdirectory of the work dir.
type XDR ¶
type XDR interface {
encoding.BinaryUnmarshaler
encoding.BinaryMarshaler
}