benchmark

package
v0.0.0-...-cb49678 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitoring

type Monitoring struct {
	Report  *Report
	Stream  chan *TxPending
	TxFired int
	Done    bool
	// contains filtered or unexported fields
}

func InitMonitoring

func InitMonitoring(ctx context.Context, cancel context.CancelFunc) *Monitoring

func (*Monitoring) IsOurTx

func (monitoring *Monitoring) IsOurTx(ctx context.Context, hash string) bool

func (*Monitoring) NoMorePendingTxs

func (monitoring *Monitoring) NoMorePendingTxs() bool

func (*Monitoring) RecordTxs

func (monitoring *Monitoring) RecordTxs(ctx context.Context, hashes []string, endTime time.Time)

type Recipe

type Recipe struct {
	Duration           time.Duration // the duration of the benchmark
	Amount             int           // the number of transactions to post. If set duration must be ignored
	Endpoint           string        // the URL address of the blockchain node to benchmark
	TendermintEndpoint string        // (only for Cosmos chains) the node's Tendermint RPC endpoint to use
	Runs               []Run         // multiple runs are run concurrently
}

a recipe is an internal representation of a user-initiated benchmark

func ProcessFlags

func ProcessFlags(endpoint string, tendermintEndpoint string, txPaths []string, duration int, amount int, threads int, maxCores int, defaultDuration time.Duration) *Recipe

Processes user CLI flags and determines the level of concurrency by which to run the benchmark.

type Report

type Report struct {
	Latencies         *hdrhistogram.Histogram
	BlockTimes        *hdrhistogram.Histogram
	TPS               *hdrhistogram.Histogram
	BenchmarkDuration time.Duration
}

func (*Report) PrintReport

func (report *Report) PrintReport(ctx context.Context)

func (*Report) RecordBenchmarkDuration

func (report *Report) RecordBenchmarkDuration(ctx context.Context, start time.Time, end time.Time)

func (*Report) RecordBlockTime

func (report *Report) RecordBlockTime(ctx context.Context, start time.Time, end time.Time)

func (*Report) RecordLatency

func (report *Report) RecordLatency(ctx context.Context, start time.Time, end time.Time)

func (*Report) RecordTPS

func (report *Report) RecordTPS(ctx context.Context, blockTimeStart time.Time, blockTimeEnd time.Time, txsInBlock int)

type Run

type Run struct {
	TxPaths []string // a run executes one or more transaction files synchronously
}

a single synchronous execution of signed transaction file/s

type TxPending

type TxPending struct {
	Hash  string
	Start *time.Time
}

Jump to

Keyboard shortcuts

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