executor

package
v0.0.0-...-0afbc09 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricNsPerOpDisplay           string = "time"        // NsPerOp metric
	MetricAllocedBytesPerOpDisplay string = "memory"      // AllocedBytesPerOp metric
	MetricAllocsPerOpDisplay       string = "allocations" // AllocsPerOp metric
)

These constants specifies the display name for some metrics

View Source
const (
	MetricNsPerOpMeasure           string = "ns"    // Nanoseconds per operation
	MetricAllocedBytesPerOpMeasure string = "bytes" // Bytes allocated per operation
	MetricAllocsPerOpMeasure       string = "times" // Allocation times per operation
)

Measures used in the metrics

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparision

type Comparision struct {
	Name    string
	Test    string
	Metrics []MetricComparision
}

Comparision represents a whole comparision between two results

func Compare

func Compare(latest *Result, current *Result, threshold uint) (bool, []Comparision)

Compare two different benchmark results

func (*Comparision) IsValid

func (cmp *Comparision) IsValid() bool

IsValid determines if is valid even being worse but stills over threshold

func (*Comparision) IsWorse

func (cmp *Comparision) IsWorse() bool

IsWorse indicates if comparasion is fully or partially worse than previous one

type MetricComparision

type MetricComparision struct {
	Metric       string
	CurrentValue float64
	LatestValue  float64
	Measure      string
	Diff         float64
	Valid        bool
}

MetricComparision represents a metric comparision against latest results

func (*MetricComparision) IsWorse

func (mc *MetricComparision) IsWorse() bool

IsWorse defines whether metric is worse than previous one or not

type Result

type Result map[string]*TestResult

Result of a complete benchmark execution

func FromFile

func FromFile(file string) (*Result, error)

FromFile takes benchmarks results directly printed to from file

func Parse

func Parse(output *bytes.Buffer) (*Result, error)

Parse parse benchmarks results

func Run

func Run(duration time.Duration, debug bool) (*Result, error)

Run benchmarks

type TestResult

type TestResult parse.Benchmark

TestResult represents an specific test benchmark result

func NewTestResult

func NewTestResult(b *parse.Benchmark) *TestResult

NewTestResult generates a TestResult from a benchmark parse

Jump to

Keyboard shortcuts

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