benchmark

package
v0.0.0-...-eef6c14 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Benchmark

type Benchmark struct {
	AvgTime    float64
	Difficulty uint8
}

Benchmark holds a difficulty and the average time the node takes to run the difficulty

func NewBenchmark

func NewBenchmark(avgTime float64, difficulty uint8) Benchmark

NewBenchmark returns a new benchmark

func (Benchmark) GetAvgTime

func (b Benchmark) GetAvgTime() float64

GetAvgTime returns the avgTime

func (Benchmark) GetDifficulty

func (b Benchmark) GetDifficulty() uint8

GetDifficulty returns the difficulty

func (*Benchmark) SetAvgTime

func (b *Benchmark) SetAvgTime(avg float64)

SetAvgTime set's the avgTime

func (*Benchmark) SetDifficulty

func (b *Benchmark) SetDifficulty(d uint8)

SetDifficulty set's the difficulty

type Engine

type Engine struct {
	Data  []Benchmark
	Score float64
	// contains filtered or unexported fields
}

Engine hold's an array of benchmarks and a score of the node

func NewEngine

func NewEngine() Engine

NewEngine returns a Engine with benchmarks run

func (Engine) GetData

func (b Engine) GetData() []Benchmark

GetData returns an array of benchmarks

func (Engine) GetScore

func (b Engine) GetScore() float64

GetScore returns the score

Jump to

Keyboard shortcuts

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