benchmarks

package
v1.1.45 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyBenchmarksSlice = errors.New("empty benchmarks slice provided")

ErrEmptyBenchmarksSlice signals that the provided benchmarks slice was empty

View Source
var ErrFileDoesNotExist = errors.New("file does not exist")

ErrFileDoesNotExist signals that the required file does not exist

View Source
var ErrNilBenchmark = errors.New("nil benchmark")

ErrNilBenchmark signals that a nil benchmark was provided

Functions

func NewArwenBenchmark

func NewArwenBenchmark(arg ArgArwenBenchmark) *arwenBenchmark

NewArwenBenchmark creates a new benchmark based on SC execution through Arwen VM

func NewCoordinator

func NewCoordinator(benchmarks []BenchmarkRunner) (*coordinator, error)

NewCoordinator will create a coordinator used to launch all provided benchmarks

func NewDelegationBenchmark

func NewDelegationBenchmark(arg ArgDelegationBenchmark) *delegationBenchmark

NewDelegationBenchmark creates a new benchmark based on delegation SC execution through Arwen VM

func NewErc20Benchmark

func NewErc20Benchmark(arg ArgErc20Benchmark) *erc20Benchmark

NewErc20Benchmark creates a new benchmark based on erc20 SC execution through Arwen VM

Types

type ArgArwenBenchmark

type ArgArwenBenchmark struct {
	Name         string
	ScFilename   string
	TestingValue uint64
	Function     string
	Arguments    [][]byte
	NumRuns      int
}

ArgArwenBenchmark is the Arwen type benchmark argument used in constructor

type ArgDelegationBenchmark

type ArgDelegationBenchmark struct {
	Name               string
	ScFilename         string
	NumRuns            int
	NumBatches         uint32
	NumTxPerBatch      uint32
	NumQueriesPerBatch uint32
}

ArgDelegationBenchmark is the delegation type benchmark argument used in constructor

type ArgErc20Benchmark

type ArgErc20Benchmark struct {
	Name               string
	ScFilename         string
	Function           string
	NumRuns            int
	NumTransfersPerRun int
}

ArgErc20Benchmark is the erc20 type benchmark argument used in constructor

type BenchmarkRunner

type BenchmarkRunner interface {
	Run() (time.Duration, error)
	Name() string
	IsInterfaceNil() bool
}

BenchmarkRunner defines a benchmark test able to measure in some way the host

type SingleResult

type SingleResult struct {
	time.Duration
	Name  string
	Error error
}

SingleResult contains the output data after a benchmark run

type TestResults

type TestResults struct {
	TotalDuration time.Duration
	Error         error
	Results       []SingleResult
}

TestResults represents the output structure containing the test results data

func (*TestResults) ToDisplayTable

func (tr *TestResults) ToDisplayTable() string

ToDisplayTable will output the contained data as an ASCII table

func (*TestResults) ToStrings

func (tr *TestResults) ToStrings() [][]string

ToStrings will return the contained data as strings (to be easily written, e.g. in a file)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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