collector

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockResult

type BlockResult struct {
	Number       int64     `json:"blockNumber"`
	Time         time.Time `json:"created"`
	Transactions int64     `json:"numTransactions"`
	GasUsed      int64     `json:"gasUsed"`
	GasLimit     int64     `json:"gasLimit"`
}

BlockResult is the single-block test run result

type Client

type Client interface {
	GetBlock(height *int64) (*core_types.ResultBlock, error)
	GetBlockGasUsed(height int64) (int64, error)
	GetBlockGasLimit(height int64) (int64, error)
	GetLatestBlockHeight() (int64, error)
}

type Collector

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

Collector is the transaction / block stat collector. This implementation will heavily change when transaction indexing is introduced

func NewCollector

func NewCollector(cli Client) *Collector

NewCollector creates a new instance of the collector

func (*Collector) GetRunResult

func (c *Collector) GetRunResult(
	txHashes [][]byte,
	startBlock int64,
	startTime time.Time,
) (*RunResult, error)

GetRunResult generates the run result for the passed in transaction hashes and start range

type RunResult

type RunResult struct {
	AverageTPS int            `json:"averageTPS"`
	Blocks     []*BlockResult `json:"blocks"`
}

RunResult is the complete test-run result

Jump to

Keyboard shortcuts

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