Documentation ¶
Index ¶
- Constants
- Variables
- func NewArwenBenchmark(arg ArgArwenBenchmark) *arwenBenchmark
- func NewCoordinator(benchmarks []BenchmarkRunner) (*coordinator, error)
- func NewDelegationBenchmark(arg ArgDelegationBenchmark) *delegationBenchmark
- func NewErc20Benchmark(arg ArgErc20Benchmark) *erc20Benchmark
- type ArgArwenBenchmark
- type ArgDelegationBenchmark
- type ArgErc20Benchmark
- type BenchmarkRunner
- type SingleResult
- type TestResults
Constants ¶
const ThresholdEnoughComputingPower = 31 * time.Second
ThresholdEnoughComputingPower represents the threshold considered when deciding if a Node Under Test (NUT) is considered having (or not) enough compute capability when executing SC calls. if the result.TotalDuration exceeds this const, the NUT is considered less powerful (the NUT needed more time to process same amount of work). The value is hardcoded and was decided through testing.
Variables ¶
var ErrEmptyBenchmarksSlice = errors.New("empty benchmarks slice provided")
ErrEmptyBenchmarksSlice signals that the provided benchmarks slice was empty
var ErrFileDoesNotExist = errors.New("file does not exist")
ErrFileDoesNotExist signals that the required file does not exist
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 ¶
BenchmarkRunner defines a benchmark test able to measure in some way the host
type SingleResult ¶
SingleResult contains the output data after a benchmark run
type TestResults ¶
type TestResults struct { TotalDuration time.Duration Error error Results []SingleResult EnoughComputingPower bool }
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)