benchmark

package
v0.0.0-...-db26c95 Latest Latest
Warning

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

Go to latest
Published: May 26, 2018 License: MIT Imports: 11 Imported by: 6

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
}

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

func DeserializeBenchmarkEngine

func DeserializeBenchmarkEngine(b []byte) Engine

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

func (Engine) Serialize

func (b Engine) Serialize() []byte

Jump to

Keyboard shortcuts

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